Re: [Spice-devel] [PATCH 4/4] drm/qxl: add drm_driver.release callback.

2019-12-20 Thread Gerd Hoffmann
On Fri, Dec 20, 2019 at 07:09:20AM -0500, Frediano Ziglio wrote: > > > > Move final cleanups to qxl_drm_release() callback. > > Can you explain in the commit why this is better or preferable? It gets called when the drm device refcount goes down to zero. It's needed for a proper cleanup in the c

Re: bochs_drm: failed bochs_hw_init() results in panic

2020-01-09 Thread Gerd Hoffmann
On Fri, Jan 10, 2020 at 02:33:28AM +0100, Marek Marczykowski-Górecki wrote: > Hi, > > It looks like bochs_kms_fini() don't like being called if > bochs_kms_init() wasn't. Regardless of the reason for the > bochs_hw_init() failure (that's another story), it shouldn't cause a > panic. Any idea how t

[PATCH] drm/virtio: add missing virtio_gpu_array_lock_resv call

2020-01-10 Thread Gerd Hoffmann
When submitting a fenced command we must lock the object reservations because virtio_gpu_queue_fenced_ctrl_buffer() unlocks after adding the fence. Reported-by: Jann Horn Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_plane.c | 1 + 1 file changed, 1 insertion(+) diff --git a

Re: bochs_drm: failed bochs_hw_init() results in panic

2020-01-12 Thread Gerd Hoffmann
> Now the messages looks like this: > > [ 29.800835] bochs-drm :00:02.0: remove_conflicting_pci_framebuffers: > bar 0: 0xc000 -> 0xc0ff > [ 29.800840] bochs-drm :00:02.0: remove_conflicting_pci_framebuffers: > bar 2: 0xc1087000 -> 0xc1087fff > [ 29.800842] checking generic

Re: bochs_hw_init fails to request framebuffer on EFI boot with plymouth visible

2020-01-12 Thread Gerd Hoffmann
On Fri, Jan 10, 2020 at 05:32:11PM +0100, Marek Marczykowski-Górecki wrote: > Hi, > > This is the context of "bochs_drm: failed bochs_hw_init() results in > panic". When I boot the system, if plymouth is visible, it crashes. But > if I press ESC to hide it, it boots fine. bochs_drm is build as mod

Re: bochs_hw_init fails to request framebuffer on EFI boot with plymouth visible

2020-01-15 Thread Gerd Hoffmann
Hi, > > No clue why, also doesn't reproduce here (standard fedora 31 5.4.7 > > kernel). I don't have an encrypted disk, so no passphrase prompt, > > maybe that makes a difference. > > Extra data point: it worked on 4.19.89. > > > How does /proc/iomem look after boot, specifically the :00:

Re: bochs_hw_init fails to request framebuffer on EFI boot with plymouth visible

2020-01-15 Thread Gerd Hoffmann
Hi, > > And "grep -A1 :00:02.0 /proc/iomem" ? > > c000-c0ff : :00:02.0 > c100-c103 : :00:04.0 So no reservation left. Whatever blocked the pci bar resource (efifb probably) is gone now. So the interesting question is why that reservation sticked long enough to

Re: bochs_hw_init fails to request framebuffer on EFI boot with plymouth visible

2020-01-15 Thread Gerd Hoffmann
On Wed, Jan 15, 2020 at 03:27:41PM +0100, Marek Marczykowski-Górecki wrote: > On Wed, Jan 15, 2020 at 03:13:53PM +0100, Gerd Hoffmann wrote: > > Hi, > > > > > > And "grep -A1 :00:02.0 /proc/iomem" ? > > > > > > c000-c0ff

Re: bochs_hw_init fails to request framebuffer on EFI boot with plymouth visible

2020-01-17 Thread Gerd Hoffmann
> Should switching to bochsdrmfb be deferred until efifb gets properly > destroyed? How? Should be in do_remove_conflicting_framebuffers, everyone might run into this. So lets try wait for all (other) references went away: diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/

Re: bochs_hw_init fails to request framebuffer on EFI boot with plymouth visible

2020-01-20 Thread Gerd Hoffmann
On Fri, Jan 17, 2020 at 04:22:11PM +0100, Marek Marczykowski-Górecki wrote: > On Fri, Jan 17, 2020 at 01:58:25PM +0100, Gerd Hoffmann wrote: > > > Should switching to bochsdrmfb be deferred until efifb gets properly > > > destroyed? How? > > > > Should be in d

Re: [PATCH v3 0/4] Use no_vblank property for drivers without VBLANK

2020-01-21 Thread Gerd Hoffmann
do not support interrupts. Xen comes with its > own VBLANK logic and disables no_vblank explictly. Acked-by: Gerd Hoffmann ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

[PATCH] drm/virtio: fix vblank handling

2020-02-04 Thread Gerd Hoffmann
virtio has its own commit fail function. Add the drm_atomic_helper_fake_vblank() call there. Fixes: 2a735ad3d211 ("drm/virtio: Remove sending of vblank event") Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_display.c | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH] drm/virtio: ratelimit error logging

2020-02-05 Thread Gerd Hoffmann
Avoid flooding the log in case we screw up badly. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_vq.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c index 5914e79d3429

[PATCH 4/4] drm/virtio: move virtio_gpu_mem_entry initialization to new function

2020-02-05 Thread Gerd Hoffmann
Introduce new virtio_gpu_object_shmem_init() helper function which will create the virtio_gpu_mem_entry array, containing the backing storage information for the host. For the most path this just moves code from virtio_gpu_object_attach(). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm

[PATCH 3/4] drm/virtio: move mapping teardown to virtio_gpu_cleanup_object()

2020-02-05 Thread Gerd Hoffmann
Stop sending DETACH_BACKING commands, that will happening anyway when releasing resources via UNREF. Handle guest-side cleanup in virtio_gpu_cleanup_object(), called when the host finished processing the UNREF command. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h

[PATCH 2/4] drm/virtio: resource teardown tweaks

2020-02-05 Thread Gerd Hoffmann
Add new virtio_gpu_cleanup_object() helper function for object cleanup. Wire up callback function for resource unref, do cleanup from callback when we know the host stopped using the resource. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h| 3 ++- drivers/gpu/drm

[PATCH 1/4] drm/virtio: simplify virtio_gpu_alloc_cmd

2020-02-05 Thread Gerd Hoffmann
Just call virtio_gpu_alloc_cmd_resp with some fixed args instead of duplicating most of the function body. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_vq.c | 25 - 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/virtio

Re: [PATCH 2/4] drm/virtio: resource teardown tweaks

2020-02-05 Thread Gerd Hoffmann
> > - > > - drm_gem_shmem_free_object(obj); > > + if (bo->created) { > > + virtio_gpu_cmd_unref_resource(vgdev, bo); > > + /* completion handler calls virtio_gpu_cleanup_object() */ > nitpick: we don't need this comment when virtio_gpu_cmd_unref_cb is > defin

Re: [PATCH 4/4] drm/virtio: move virtio_gpu_mem_entry initialization to new function

2020-02-06 Thread Gerd Hoffmann
Hi, > > virtio_gpu_cmd_resource_attach_backing(vgdev, obj->hw_res_handle, > > - ents, nents, > > + obj->ents, obj->nents, > >fence); > > + obj->

[PATCH] drm/virtio: fix ring free check

2020-02-06 Thread Gerd Hoffmann
If the virtio device supports indirect ring descriptors we need only one ring entry for the whole command. Take that into account when checking whenever the virtqueue has enough free entries for our command. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_vq.c | 9 ++--- 1

Re: [PATCH] drm/virtio: fix ring free check

2020-02-06 Thread Gerd Hoffmann
Hi, > > + indirect = virtio_has_feature(vgdev->vdev, > > VIRTIO_RING_F_INDIRECT_DESC); > > + vqcnt = indirect ? 1 : elemcnt; > Is the feature dynamic and require the lock held? If not, the result > can be cached and the fixup can happen before grabbing the lock Not dynamic, so yes

[PATCH v2] drm/virtio: fix ring free check

2020-02-06 Thread Gerd Hoffmann
If the virtio device supports indirect ring descriptors we need only one ring entry for the whole command. Take that into account when checking whenever the virtqueue has enough free entries for our command. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 1

[PATCH v2 4/4] drm/virtio: move virtio_gpu_mem_entry initialization to new function

2020-02-06 Thread Gerd Hoffmann
Introduce new virtio_gpu_object_shmem_init() helper function which will create the virtio_gpu_mem_entry array, containing the backing storage information for the host. For the most path this just moves code from virtio_gpu_object_attach(). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm

[PATCH v2 3/4] drm/virtio: move mapping teardown to virtio_gpu_cleanup_object()

2020-02-06 Thread Gerd Hoffmann
Stop sending DETACH_BACKING commands, that will happening anyway when releasing resources via UNREF. Handle guest-side cleanup in virtio_gpu_cleanup_object(), called when the host finished processing the UNREF command. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h

[PATCH v2 2/4] drm/virtio: resource teardown tweaks

2020-02-06 Thread Gerd Hoffmann
Add new virtio_gpu_cleanup_object() helper function for object cleanup. Wire up callback function for resource unref, do cleanup from callback when we know the host stopped using the resource. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h| 4 +++- drivers/gpu/drm

[PATCH v2 1/4] drm/virtio: simplify virtio_gpu_alloc_cmd

2020-02-06 Thread Gerd Hoffmann
Just call virtio_gpu_alloc_cmd_resp with some fixed args instead of duplicating most of the function body. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_vq.c | 26 +- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/virtio

Re: [PATCH 2/6] drm: Add drm_simple_encoder_{init,create}()

2020-02-07 Thread Gerd Hoffmann
> +static const struct drm_encoder_funcs drm_simple_encoder_funcs_cleanup = { > + .destroy = drm_encoder_cleanup, > +}; > + > +/** > + * drm_simple_encoder_init - Init a preallocated encoder > + * @dev: drm device > + * @funcs: callbacks for this encoder > + * @encoder_type: user visible type o

[PATCH v2] drm/bochs: downgrade pci_request_region failure from error to warning

2020-02-07 Thread Gerd Hoffmann
round this issue. Reported-by: Marek Marczykowski-Górecki Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_hw.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bochs/bochs_hw.c b/drivers/gpu/drm/bochs/bochs_hw.c index b615b7dfdd9d..a387efa9e559 1

[PATCH] drm/bochs: add drm_driver.release callback.

2020-02-07 Thread Gerd Hoffmann
From: Gurchetan Singh Move bochs_unload call from bochs_remove() to the new bochs_release() callback. Also call drm_dev_unregister() first in bochs_remove(). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_drv.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions

[PATCH] drm/qxl: add drm_driver.release callback.

2020-02-07 Thread Gerd Hoffmann
Move final cleanups to qxl_drm_release() callback. Add drm_atomic_helper_shutdown() call to qxl_pci_remove(). Reorder calls in qxl_device_fini(). Cleaning up gem & ttm might trigger qxl commands, so we should do that before releaseing command rings. Signed-off-by: Gerd Hoffmann --- dri

[PATCH] drm/cirrus: add drm_driver.release callback.

2020-02-07 Thread Gerd Hoffmann
Move final cleanups from cirrus_pci_remove() to the new callback. Add drm_atomic_helper_shutdown() call to cirrus_pci_remove(). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/cirrus/cirrus.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm

[PATCH] drm/virtio: add drm_driver.release callback.

2020-02-07 Thread Gerd Hoffmann
Split virtio_gpu_deinit(), move the drm shutdown and release to virtio_gpu_release(). Also free vbufs in case we can't queue them. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 1 + drivers/gpu/drm/virtio/virtgpu_drv.c | 4 drivers/gpu/drm/virtio/virtgpu_

Re: [PATCH 2/6] drm: Add drm_simple_encoder_{init,create}()

2020-02-07 Thread Gerd Hoffmann
> > How about using > > > > #define drm_simple_encoder_init(dev, type, name, ...) \ > > drm_encoder_init(dev, drm_simple_encoder_funcs_cleanup, type, name, > > __VA_ARGS__) > > > > instead ? > I guess you want to save a few lines in the implementation of > drm_simple_encoder_init() (?)

Re: [PATCH v2] drm/bochs: downgrade pci_request_region failure from error to warning

2020-02-07 Thread Gerd Hoffmann
On Fri, Feb 07, 2020 at 01:06:00PM +0100, Thomas Zimmermann wrote: > Hi > > Am 07.02.20 um 12:57 schrieb Gerd Hoffmann: > > Shutdown of firmware framebuffer has a bunch of problems. Because > > of this the framebuffer region might still b

[PATCH] drm/bochs: deinit bugfix

2020-02-07 Thread Gerd Hoffmann
Check whenever mode_config was actually properly initialized before trying to clean it up. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_kms.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers/gpu/drm/bochs/bochs_kms.c index

[PATCH v2] drm/bochs: add drm_driver.release callback.

2020-02-10 Thread Gerd Hoffmann
touched after bochs_pci_remove returns. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs.h | 1 + drivers/gpu/drm/bochs/bochs_drv.c | 6 +++--- drivers/gpu/drm/bochs/bochs_hw.c | 14 ++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm

[PATCH v2] drm/cirrus: add drm_driver.release callback.

2020-02-10 Thread Gerd Hoffmann
Move final cleanups from cirrus_pci_remove() to the new callback. Add drm_atomic_helper_shutdown() call to cirrus_pci_remove(). Set pointers to NULL after iounmap() and check them before using them to make sure we don't touch released hardware. Signed-off-by: Gerd Hoffmann --- drivers/gp

[PATCH v2] drm/virtio: add drm_driver.release callback.

2020-02-10 Thread Gerd Hoffmann
Split virtio_gpu_deinit(), move the drm shutdown and release to virtio_gpu_release(). Also free vbufs in case we can't queue them. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 1 + drivers/gpu/drm/virtio/virtgpu_display.c | 1 - drivers/gpu/drm/v

[PATCH v2 2/2] drm/qxl: add drm_driver.release callback.

2020-02-10 Thread Gerd Hoffmann
Move final cleanups to qxl_drm_release() callback. Add drm_atomic_helper_shutdown() call to qxl_pci_remove(). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.c | 26 +++--- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/qxl

[PATCH v2 1/2] drm/qxl: reorder calls in qxl_device_fini().

2020-02-10 Thread Gerd Hoffmann
Reorder calls in qxl_device_fini(). Cleaning up gem & ttm might trigger qxl commands, so we should do that before releaseing command rings. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_kms.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu

[PATCH v3] drm/bochs: add drm_driver.release callback.

2020-02-11 Thread Gerd Hoffmann
Call bochs_unload via drm_driver.release to make sure we release stuff when it is safe to do so. Use drm_dev_{enter,exit,unplug} to avoid touching hardware after device removal. Tidy up here and there. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_drv.c | 6 +++--- drivers/gpu

[PATCH v3] drm/cirrus: add drm_driver.release callback.

2020-02-11 Thread Gerd Hoffmann
Move final cleanups from cirrus_pci_remove() to the new callback. Add drm_atomic_helper_shutdown() call to cirrus_pci_remove(). Use drm_dev_{enter,exit,unplug} to avoid touching hardware after device removal. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/cirrus/cirrus.c | 43

[PATCH v3] drm/virtio: add drm_driver.release callback.

2020-02-11 Thread Gerd Hoffmann
Split virtio_gpu_deinit(), move the drm shutdown and release to virtio_gpu_release(). Drop vqs_ready variable, instead use drm_dev_{enter,exit,unplug} to avoid touching hardware after device removal. Tidy up here and there. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h

[PATCH] drm/virtio: rework batching

2020-02-11 Thread Gerd Hoffmann
for userspace ioctls. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 6 ++--- drivers/gpu/drm/virtio/virtgpu_display.c | 2 ++ drivers/gpu/drm/virtio/virtgpu_ioctl.c | 4 +++ drivers/gpu/drm/virtio/virtgpu_kms.c | 3 +++ drivers/gpu/drm/virtio

[PATCH 2/2] drm/virtio: fix virtio_gpu_cursor_plane_update().

2020-02-11 Thread Gerd Hoffmann
Add missing virtio_gpu_array_lock_resv() call. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_plane.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c index ac42c84d2d7f..d1c3f5fbfee4 100644

[PATCH 1/2] drm/virtio: fix virtio_gpu_execbuffer_ioctl locking

2020-02-11 Thread Gerd Hoffmann
Lockdep says we can't call vmemdup() while having objects reserved because it needs the mmap semaphore. So reorder the calls reserve the objects later. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 20 ++-- 1 file changed, 10 insertions(+

[PATCH v4] drm/bochs: add drm_driver.release callback.

2020-02-11 Thread Gerd Hoffmann
-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_drv.c | 6 +++--- drivers/gpu/drm/bochs/bochs_hw.c | 24 +++- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bochs/bochs_drv.c b/drivers/gpu/drm/bochs/bochs_drv.c index 10460878414e

[PATCH v4] drm/cirrus: add drm_driver.release callback.

2020-02-11 Thread Gerd Hoffmann
(). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/cirrus/cirrus.c | 43 - 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/cirrus/cirrus.c b/drivers/gpu/drm/cirrus/cirrus.c index a91fb0d7282c..d2ff63ce8eaf 100644 --- a/drivers/gpu/drm

[PATCH v4] drm/virtio: add drm_driver.release callback.

2020-02-11 Thread Gerd Hoffmann
Split virtio_gpu_deinit(), move the drm shutdown and release to virtio_gpu_release(). Drop vqs_ready variable, instead use drm_dev_{enter,exit,unplug} to avoid touching hardware after device removal. Tidy up here and there. v4: add changelog. v3: use drm_dev_*(). Signed-off-by: Gerd Hoffmann

Re: [PATCH v4] drm/bochs: add drm_driver.release callback.

2020-02-12 Thread Gerd Hoffmann
On Tue, Feb 11, 2020 at 03:19:56PM +0100, Daniel Vetter wrote: > On Tue, Feb 11, 2020 at 02:52:18PM +0100, Gerd Hoffmann wrote: > > Call bochs_unload via drm_driver.release to make sure we release stuff > > when it is safe to do so. Use drm_dev_{enter,exit,unplug} to avoid > &

Re: [PATCH v4] drm/virtio: add drm_driver.release callback.

2020-02-12 Thread Gerd Hoffmann
On Tue, Feb 11, 2020 at 03:27:11PM +0100, Daniel Vetter wrote: > On Tue, Feb 11, 2020 at 02:58:04PM +0100, Gerd Hoffmann wrote: > > Split virtio_gpu_deinit(), move the drm shutdown and release to > > virtio_gpu_release(). Drop vqs_ready variable, instead use > > drm_dev_{

[PATCH v2] drm/virtio: rework batching

2020-02-12 Thread Gerd Hoffmann
for userspace ioctls. v2: - rebase to latest drm-misc-next. - use "if (!atomic_read())". - add review & test tags. Signed-off-by: Gerd Hoffmann Reviewed-by: Gurchetan Singh Tested-by: Gurchetan Singh --- drivers/gpu/drm/virtio/virtgpu_drv.h | 6 ++--- drivers/

Re: [PATCH] drm/qxl: replace zero-length array with flexible-array member

2020-02-13 Thread Gerd Hoffmann
On Wed, Feb 12, 2020 at 01:33:44PM -0600, Gustavo A. R. Silva wrote: > The current codebase makes use of the zero-length array language > extension to the C90 standard, but the preferred mechanism to declare > variable-length types such as these ones is a flexible array member[1][2], > introduced i

[PATCH v3 4/4] drm/virtio: batch display query.

2020-02-13 Thread Gerd Hoffmann
Move virtio_gpu_notify() to higher-level functions for virtio_gpu_cmd_get_display_info() and virtio_gpu_cmd_get_edids(). virtio_gpu_config_changed_work_func() and virtio_gpu_init() will batch commands and notify only once per update Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio

[PATCH v3 2/4] drm/virtio: batch plane updates (pageflip)

2020-02-13 Thread Gerd Hoffmann
-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_display.c | 2 ++ drivers/gpu/drm/virtio/virtgpu_ioctl.c | 1 + drivers/gpu/drm/virtio/virtgpu_plane.c | 3 +++ drivers/gpu/drm/virtio/virtgpu_vq.c | 4 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/gpu

[PATCH v3 3/4] drm/virtio: batch resource creation

2020-02-13 Thread Gerd Hoffmann
Move virtio_gpu_notify() to higher-level functions for virtio_gpu_cmd_create_resource(), virtio_gpu_cmd_resource_create_3d() and virtio_gpu_cmd_resource_attach_backing(). virtio_gpu_object_create() will batch commands and notify only once when creating a resource. Signed-off-by: Gerd Hoffmann

[PATCH v3 1/4] drm/virtio: rework notification for better batching

2020-02-13 Thread Gerd Hoffmann
batching to separate patches. v2: - rebase to latest drm-misc-next. - use "if (!atomic_read())". - add review & test tags. Signed-off-by: Gerd Hoffmann Reviewed-by: Gurchetan Singh Tested-by: Gurchetan Singh --- drivers/gpu/drm/virtio/virtgpu_drv.h | 6 ++-- drivers/

[PATCH] drm/virtio: fix error check

2020-02-14 Thread Gerd Hoffmann
The >= compare op must happen in cpu byte order, doing it in little endian fails on big endian machines like s390. Reported-by: Sebastian Mitterle Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_vq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driv

[PATCH v4 5/6] drm/virtio: batch display query

2020-02-14 Thread Gerd Hoffmann
Move virtio_gpu_notify() to higher-level functions for virtio_gpu_cmd_get_display_info() and virtio_gpu_cmd_get_edids(). virtio_gpu_config_changed_work_func() and virtio_gpu_init() will batch commands and notify only once per update Signed-off-by: Gerd Hoffmann Reviewed-by: Chia-I Wu

[PATCH v4 1/6] drm/virtio: rework notification for better batching

2020-02-14 Thread Gerd Hoffmann
batching to separate patches. v2: - rebase to latest drm-misc-next. - use "if (!atomic_read())". - add review & test tags. Signed-off-by: Gerd Hoffmann Reviewed-by: Gurchetan Singh Tested-by: Gurchetan Singh Reviewed-by: Chia-I Wu --- drivers/gpu/drm/virtio/virtgpu_drv.h | 6

[PATCH v4 6/6] drm/virtio: move remaining virtio_gpu_notify calls

2020-02-14 Thread Gerd Hoffmann
Move all remaining virtio_gpu_notify() calls from virtio_gpu_cmd_* to the callers, for consistency reasons. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_gem.c| 2 ++ drivers/gpu/drm/virtio/virtgpu_ioctl.c | 3 +++ drivers/gpu/drm/virtio/virtgpu_kms.c| 3 +++ drivers

[PATCH v4 3/6] drm/virtio: batch plane updates (pageflip)

2020-02-14 Thread Gerd Hoffmann
-off-by: Gerd Hoffmann Reviewed-by: Chia-I Wu --- drivers/gpu/drm/virtio/virtgpu_display.c | 2 ++ drivers/gpu/drm/virtio/virtgpu_ioctl.c | 1 + drivers/gpu/drm/virtio/virtgpu_plane.c | 3 +++ drivers/gpu/drm/virtio/virtgpu_vq.c | 4 4 files changed, 6 insertions(+), 4 deletions

[PATCH v4 4/6] drm/virtio: batch resource creation

2020-02-14 Thread Gerd Hoffmann
Move virtio_gpu_notify() to higher-level functions for virtio_gpu_cmd_create_resource(), virtio_gpu_cmd_resource_create_3d() and virtio_gpu_cmd_resource_attach_backing(). virtio_gpu_object_create() will batch commands and notify only once when creating a resource. Signed-off-by: Gerd Hoffmann

[PATCH v4 2/6] drm/virtio: notify before waiting

2020-02-14 Thread Gerd Hoffmann
Before we are going to wait for virtqueue entries becoming available call virtio_gpu_notify() to make sure the host has seen everything we've submitted. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_vq.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gp

[PATCH] drm/qxl: don't take vga ports on rev5+

2020-02-14 Thread Gerd Hoffmann
qemu 5.0 introduces a new qxl hardware revision 5. Unlike revision 4 (and below) the device doesn't switch back into vga compatibility mode when someone touches the vga ports. So we don't have to reserve the vga ports any more to avoid that happening. Signed-off-by: Gerd Hoffmann --

Re: [PATCH v2 4/4] drm/qxl: Use simple encoder

2020-02-24 Thread Gerd Hoffmann
On Tue, Feb 18, 2020 at 09:48:15AM +0100, Thomas Zimmermann wrote: > The qxl driver uses an empty implementation for its encoder. Replace > the code with the generic simple encoder. > > v2: > * rebase onto new simple-encoder interface > > Signed-off-by: Thomas Zimmer

Re: [PATCH 10/52] drm/cirrus: Use drmm_add_final_kfree

2020-02-24 Thread Gerd Hoffmann
m_device and the drmm_ stuff. Acked-by: Gerd Hoffmann ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH 29/52] drm/bochs: Drop explicit drm_mode_config_cleanup

2020-02-24 Thread Gerd Hoffmann
> > Signed-off-by: Daniel Vetter > Cc: Gerd Hoffmann > Cc: virtualization@lists.linux-foundation.org Acked-by: Gerd Hoffmann ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH 30/52] drm/cirrus: Drop explicit drm_mode_config_cleanup call

2020-02-24 Thread Gerd Hoffmann
On Wed, Feb 19, 2020 at 11:21:00AM +0100, Daniel Vetter wrote: > We can even delete the drm_driver.release hook now! > > Signed-off-by: Daniel Vetter > Cc: Dave Airlie > Cc: Gerd Hoffmann > Cc: Daniel Vetter > Cc: "Noralf Trønnes" > Cc: Sam Ravnb

Re: [PATCH 31/52] drm/cirrus: Fully embrace devm_

2020-02-24 Thread Gerd Hoffmann
Daniel Vetter > Cc: Dave Airlie > Cc: Gerd Hoffmann > Cc: Daniel Vetter > Cc: "Noralf Trønnes" > Cc: Emil Velikov > Cc: Thomas Zimmermann > Cc: virtualization@lists.linux-foundation.org Acked-by: Gerd Hoffmann ___ Vir

Re: [PATCH 1/2] virtio: add dma-buf support for exported objects

2020-02-24 Thread Gerd Hoffmann
On Wed, Feb 19, 2020 at 05:06:36PM +0900, David Stevens wrote: > This change adds a new flavor of dma-bufs that can be used by virtio > drivers to share exported objects. A virtio dma-buf can be queried by > virtio drivers to obtain the UUID which identifies the underlying > exported object. That

Re: [PATCH 2/2] drm/virtio: Support virtgpu exported resources

2020-02-24 Thread Gerd Hoffmann
Hi, > +struct dma_buf *virtgpu_gem_prime_export(struct drm_gem_object *obj, > + int flags) > +{ [ ... ] > +} > + > +struct drm_gem_object *virtgpu_gem_prime_import(struct drm_device *dev, > + struct dma_buf *buf) >

[PATCH v5 2/3] drm/virtio: fix mmap page attributes

2020-02-26 Thread Gerd Hoffmann
virtio-gpu uses cached mappings, set drm_gem_shmem_object.map_cached accordingly. Cc: sta...@vger.kernel.org Fixes: c66df701e783 ("drm/virtio: switch from ttm to gem shmem helpers") Reported-by: Gurchetan Singh Reported-by: Guillaume Gardet Signed-off-by: Gerd Hoffmann --- drive

Re: [virtio-dev] Re: [PATCH 1/2] virtio: add dma-buf support for exported objects

2020-02-26 Thread Gerd Hoffmann
On Wed, Feb 26, 2020 at 12:56:58PM +0900, David Stevens wrote: > On Tue, Feb 25, 2020 at 3:10 PM Gerd Hoffmann wrote: > > > > How about dma_buf_{get,set}_uuid, simliar to dma_buf_set_name? > > While I'm not opposed to such an API, I'm also hesitant to make >

Re: [PATCH] drm/bochs: Remove vga write

2020-02-28 Thread Gerd Hoffmann
On Thu, Feb 27, 2020 at 01:04:54PM -0800, Alistair Francis wrote: > The QEMU model for the Bochs display has no VGA memory section at offset > 0x400 [1]. By writing to this register Linux can create a write to > unassigned memory which depending on machine and architecture can result > in a store f

Re: [PATCH] drm/bochs: Remove vga write

2020-03-02 Thread Gerd Hoffmann
On Mon, Mar 02, 2020 at 02:14:02PM -0800, Alistair Francis wrote: > On Fri, Feb 28, 2020 at 1:57 AM Gerd Hoffmann wrote: > > > > On Thu, Feb 27, 2020 at 01:04:54PM -0800, Alistair Francis wrote: > > > The QEMU model for the Bochs display has no VGA memory section at of

Re: [PATCH 07/51] drm/qxl: Use drmm_add_final_kfree

2020-03-02 Thread Gerd Hoffmann
On Mon, Mar 02, 2020 at 11:25:47PM +0100, Daniel Vetter wrote: > With this we can drop the final kfree from the release function. Acked-by: Gerd Hoffmann > > Signed-off-by: Daniel Vetter > Cc: Dave Airlie > Cc: Gerd Hoffmann > Cc: virtualization@lists.linux-foundation.

Re: [PATCH 09/51] drm/cirrus: Use drmm_add_final_kfree

2020-03-02 Thread Gerd Hoffmann
kfree(cirrus); > + goto err_pci_release; > + } > dev->dev_private = cirrus; > + drmm_add_final_kfree(dev, cirrus); That doesn't look like an error path improvement. With patch #30 applied it'll looks alot better though. So maybe squash

Re: [PATCH 28/51] drm/bochs: Drop explicit drm_mode_config_cleanup

2020-03-02 Thread Gerd Hoffmann
> > This is made possible by a preceeding patch which added a drmm_ > cleanup action to drm_mode_config_init(), hence all we need to do to > ensure that drm_mode_config_cleanup() is run on final drm_device > cleanup is check the new error code for _init(

Re: [PATCH 29/51] drm/cirrus: Drop explicit drm_mode_config_cleanup call

2020-03-02 Thread Gerd Hoffmann
_config_cleanup() is run on final drm_device > cleanup is check the new error code for _init(). Acked-by: Gerd Hoffmann ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH 30/51] drm/cirrus: Fully embrace devm_

2020-03-02 Thread Gerd Hoffmann
On Mon, Mar 02, 2020 at 11:26:10PM +0100, Daniel Vetter wrote: > With the drm_device lifetime fun cleaned up there's nothing in the way > anymore to use devm_ for everything hw releated. Do it, and in the > process, throw out the entire onion unwinding. Acked-by:

Re: [PATCH v2 1/4] dma-buf: add support for virtio exported objects

2020-03-03 Thread Gerd Hoffmann
On Mon, Mar 02, 2020 at 09:15:21PM +0900, David Stevens wrote: > This change adds a new dma-buf operation that allows dma-bufs to be used > by virtio drivers to share exported objects. The new operation allows > the importing driver to query the exporting driver for the UUID which > identifies the

Re: [PATCH v2 4/4] drm/virtio: Support virtgpu exported resources

2020-03-04 Thread Gerd Hoffmann
Hi, > + if (vgdev->has_resource_assign_uuid) { > + spin_lock(&vgdev->resource_export_lock); > + if (bo->uuid_state == UUID_NOT_INITIALIZED) { > + bo->uuid_state = UUID_INITIALIZING; > + needs_init = true; > + } > +

Re: [virtio-dev] [PATCH v2 4/4] drm/virtio: Support virtgpu exported resources

2020-03-04 Thread Gerd Hoffmann
On Tue, Mar 03, 2020 at 11:42:22AM +0900, David Stevens wrote: > > cmd_p->hdr.ctx_id = > > > > Before this completion of this hypercall, this resource can be > > considered context local, while afterward it can be considered > > "exported". > > Maybe I'm misunderstanding render contexts, but expor

[PATCH v3] drm/bochs: downgrade pci_request_region failure from error to warning

2020-03-13 Thread Gerd Hoffmann
round this issue. Reported-by: Marek Marczykowski-Górecki Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_hw.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bochs/bochs_hw.c b/drivers/gpu/drm/bochs/bochs_hw.c index 952199cc0462..dce4672

Re: [PATCH v3] drm/bochs: downgrade pci_request_region failure from error to warning

2020-03-13 Thread Gerd Hoffmann
Hi, > > + if (pci_request_region(pdev, 0, "bochs-drm") != 0) > > + DRM_WARN("Cannot request framebuffer, boot fb still active?\n"); > So you could use drm_WARN() which is what is preferred these days. Nope, this isn't yet in -fixes. cheers, Gerd _

Re: [PATCH v3] drm/bochs: downgrade pci_request_region failure from error to warning

2020-03-17 Thread Gerd Hoffmann
On Tue, Mar 17, 2020 at 05:49:41PM +0100, Daniel Vetter wrote: > On Fri, Mar 13, 2020 at 09:41:52AM +0100, Gerd Hoffmann wrote: > > Shutdown of firmware framebuffer has a bunch of problems. Because > > of this the framebuffer region might still be rese

Re: [PATCH] drm/virtio: fix OOB in virtio_gpu_object_create

2020-03-19 Thread Gerd Hoffmann
which has 2 more members. > > So fix that by using correct type in virtio_gpu_create_object. > > Signed-off-by: Jiri Slaby > Fixes: f651c8b05542 ("drm/virtio: factor out the sg_table from > virtio_gpu_object") > Cc: Gurchetan Singh > Cc: Gerd Hoffmann Tha

Re: [PATCH v3 0/4] Support virtio cross-device resources

2020-03-19 Thread Gerd Hoffmann
On Wed, Mar 11, 2020 at 08:20:00PM +0900, David Stevens wrote: > This patchset implements the current proposal for virtio cross-device > resource sharing [1], with minor changes based on recent comments. It > is expected that this will be used to import virtio resources into the > virtio-video driv

Re: arm64 kernel crash in bochs_get_edid_block() with QEMU '-device VGA'

2020-03-25 Thread Gerd Hoffmann
On Sat, Feb 15, 2020 at 01:11:45PM +0100, Juerg Haefliger wrote: > The QEMU default edid=off results in a kernel crash [1] on arm64 due > to commit [2]. To reproduce: Should be fixed in qemu 5.0-rc0 cheers, Gerd ___ Virtualization mailing list Virtua

Re: [PATCH Resend] drm/qxl: Use correct notify port address when creating cursor ring

2020-03-31 Thread Gerd Hoffmann
On Tue, Mar 31, 2020 at 02:18:08PM +0800, Huacai Chen wrote: > The command ring and cursor ring use different notify port addresses > definition: QXL_IO_NOTIFY_CMD and QXL_IO_NOTIFY_CURSOR. However, in > qxl_device_init() we use QXL_IO_NOTIFY_CMD to create both command ring > and cursor ring. This

Re: [PATCH 30/44] drm/qxl: Use devm_drm_dev_alloc

2020-04-05 Thread Gerd Hoffmann
On Fri, Apr 03, 2020 at 03:58:14PM +0200, Daniel Vetter wrote: > Also need to remove the drm_dev_put from the remove hook. > > Signed-off-by: Daniel Vetter > Cc: Dave Airlie > Cc: Gerd Hoffmann > Cc: virtualization@lists.linux-foundation.org > Cc: spice-de...@lists.free

Re: [PATCH 31/44] drm/qxl: Don't use drm_device->dev_private

2020-04-05 Thread Gerd Hoffmann
On Fri, Apr 03, 2020 at 03:58:15PM +0200, Daniel Vetter wrote: > Upcasting using a container_of macro is more typesafe, faster and > easier for the compiler to optimize. > > Signed-off-by: Daniel Vetter > Cc: Dave Airlie > Cc: Gerd Hoffmann > Cc: virtualization@lists.linu

Re: upstream boot error: KASAN: slab-out-of-bounds Write in virtio_gpu_object_create

2020-04-06 Thread Gerd Hoffmann
On Mon, Apr 06, 2020 at 09:07:44AM +0200, Dmitry Vyukov wrote: > On Mon, Apr 6, 2020 at 8:46 AM syzbot > wrote: > > > > Hello, > > > > syzbot found the following crash on: > > > > HEAD commit:ffc1c20c Merge tag 'for-5.7/dm-changes' of git://git.kerne.. > > git tree: upstream > > console

Re: upstream boot error: KASAN: slab-out-of-bounds Write in virtio_gpu_object_create

2020-04-06 Thread Gerd Hoffmann
Hi, > > > +drivers/gpu/drm/virtio/virtgpu_object.c maintainers > > > Now we have both mainline and linux-next boot broken (linux-next is > > > broken for the past 40 days). > > > No testing of new code happens. > > > > > > > virtio_gpu_object_shmem_init > > > > drivers/gpu/drm/virtio/virtgpu_o

Re: [PATCH v7 7/9] drm/virtio: Improve DMA API usage for shmem BOs

2022-07-05 Thread Gerd Hoffmann
Hi, > - * So for the moment keep things as-is, with a bulky comment > - * for the next person who feels like removing this > - * drm_dev_set_unique() quirk. Dragons lurking here. It's not the first attempt to ditch this, and so far all have been rolled back due to regressions.

Re: [PATCH v7 7/9] drm/virtio: Improve DMA API usage for shmem BOs

2022-07-05 Thread Gerd Hoffmann
Hi, > > Also note that pci is not the only virtio transport we have. > > The VirtIO indeed has other transports, but only PCI is really supported > in case of the VirtIO-GPU in kernel and in Qemu/crosvm, AFAICT. Hence > only the PCI transport was tested. qemu -M microvm \ -global virtio-mmio

Re: [PATCH v7 7/9] drm/virtio: Improve DMA API usage for shmem BOs

2022-07-06 Thread Gerd Hoffmann
Hi, > Gerd, thank you very much! It's was indeed unclear to me how to test the > MMIO GPU, but yours variant with microvm works! I was looking for trying > aarch64 in the past, but it also was unclear how to do it since there is > no DT support for the VirtIO-GPU, AFAICS. aarch64 uses acpi by d

Re: [PATCH v2 4/8] drm/qxl: Use the hotspot properties from cursor planes

2022-07-12 Thread Gerd Hoffmann
in > Cc: Dave Airlie > Cc: Gerd Hoffmann > Cc: Daniel Vetter > Cc: virtualization@lists.linux-foundation.org > Cc: spice-de...@lists.freedesktop.org Reviewed-by: Gerd Hoffmann ___ Virtualization mailing list Virtualizat

Re: [PATCH v2 6/8] drm/virtio: Use the hotspot properties from cursor planes

2022-07-12 Thread Gerd Hoffmann
n > Cc: David Airlie > Cc: Gerd Hoffmann > Cc: Gurchetan Singh > Cc: Chia-I Wu > Cc: Daniel Vetter > Cc: virtualization@lists.linux-foundation.org Reviewed-by: Gerd Hoffmann ___ Virtualization mailing list Virtuali

<    6   7   8   9   10   11   12   >