[PATCH v2] drm/virtio: use virtio_max_dma_size

2019-08-09 Thread Gerd Hoffmann
We must make sure our scatterlist segments are not too big, otherwise we might see swiotlb failures (happens with sev, also reproducable with swiotlb=force). Suggested-by: Laszlo Ersek Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_object.c | 10 -- 1 file changed, 8

[PATCH 2/2] drm/virtio: notify virtqueues without holding spinlock

2019-08-13 Thread Gerd Hoffmann
rather bad spinlock contention. Suggested-by: Chia-I Wu Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_vq.c | 25 +++-- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c

[PATCH 1/2] drm/virtio: cleanup queue functions

2019-08-13 Thread Gerd Hoffmann
Make the queue functions return void, none of the call sites checks the return value. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_vq.c | 41 ++--- 1 file changed, 14 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b

[PATCH v3] drm/virtio: use virtio_max_dma_size

2019-08-13 Thread Gerd Hoffmann
We must make sure our scatterlist segments are not too big, otherwise we might see swiotlb failures (happens with sev, also reproducable with swiotlb=force). Suggested-by: Laszlo Ersek Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_object.c | 10 -- 1 file changed, 8

[PATCH v4] drm/virtio: use virtio_max_dma_size

2019-08-13 Thread Gerd Hoffmann
We must make sure our scatterlist segments are not too big, otherwise we might see swiotlb failures (happens with sev, also reproducable with swiotlb=force). Suggested-by: Laszlo Ersek Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_object.c | 10 -- 1 file changed, 8

Re: [Intel-gfx] [PATCH v6 08/17] drm/ttm: use gem vma_node

2019-08-13 Thread Gerd Hoffmann
ng the order doesn't look hard. Patch attached (untested, have no test hardware). But maybe I missed some detail ... The other patch attached works around the issue with a flag, to avoid drm_vma_node_reset() being called twice. cheers, Gerd >From af43f933533140e2df58176a68df0c60ba08227

Re: [PATCH] drm/qxl: fix a memory leak bug

2019-08-19 Thread Gerd Hoffmann
On Mon, Aug 19, 2019 at 01:08:18PM -0500, Wenwen Wang wrote: > In qxl_bo_create(), the temporary 'bo' is allocated through kzalloc(). > However, it is not deallocated in the following execution if ttm_bo_init() > fails, leading to a memory leak bug. To fix this issue, free 'bo' before > returning t

[PATCH v5] drm/virtio: use virtio_max_dma_size

2019-08-21 Thread Gerd Hoffmann
We must make sure our scatterlist segments are not too big, otherwise we might see swiotlb failures (happens with sev, also reproducable with swiotlb=force). Suggested-by: Laszlo Ersek Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_object.c | 10 -- 1 file changed, 8

[PATCH v4 2/4] drm/bochs: drop yres_virtual from struct bochs_device

2019-08-21 Thread Gerd Hoffmann
Not needed, writing to VBE_DISPI_INDEX_VIRT_HEIGHT has no effect anyway. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs.h| 1 - drivers/gpu/drm/bochs/bochs_hw.c | 8 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/bochs/bochs.h b/drivers

[PATCH v4 1/4] drm/bochs: pass framebuffer to bochs_hw_setbase

2019-08-21 Thread Gerd Hoffmann
Also rename bochs_hw_setbase to bochs_hw_setfb, we have to set more than just the base address. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs.h | 5 +++-- drivers/gpu/drm/bochs/bochs_hw.c | 24 +++- drivers/gpu/drm/bochs/bochs_kms.c | 11 +++ 3

[PATCH v4 4/4] drm/bochs: move bochs_hw_setformat() call

2019-08-21 Thread Gerd Hoffmann
Call it from bochs_hw_setfb(). This also allows to make bochs_hw_setformat static. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs.h | 2 -- drivers/gpu/drm/bochs/bochs_hw.c | 5 +++-- drivers/gpu/drm/bochs/bochs_kms.c | 1 - 3 files changed, 3 insertions(+), 5 deletions

[PATCH v4 3/4] drm/bochs: drop stride and bpp from struct bochs_device

2019-08-21 Thread Gerd Hoffmann
No need to store these values. bpp is fixed (32) anyway. We lookup the stride from struct drm_framebuffer if needed. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs.h | 2 -- drivers/gpu/drm/bochs/bochs_hw.c | 8 +++- drivers/gpu/drm/bochs/bochs_kms.c | 2 +- 3 files

[PATCH 2/3] drm: drop resource_id parameter from drm_fb_helper_remove_conflicting_pci_framebuffers

2019-08-22 Thread Gerd Hoffmann
Not needed any more for remove_conflicting_pci_framebuffers calls. Signed-off-by: Gerd Hoffmann --- include/drm/drm_fb_helper.h | 4 +--- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +- drivers/gpu/drm/bochs/bochs_drv.c | 2 +- drivers/gpu/drm/cirrus/cirrus.c | 2

[PATCH v2] drm/virtio: add plane check

2019-08-22 Thread Gerd Hoffmann
Use drm_atomic_helper_check_plane_state() to sanity check the plane state. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_plane.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm

[PATCH v2] drm/virtio: make resource id workaround runtime switchable.

2019-08-22 Thread Gerd Hoffmann
Also update the comment with a reference to the virglrenderer fix. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_object.c | 44 ++--- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_object.c b/drivers/gpu/drm

[PATCH v8 02/18] drm/virtio: switch virtio_gpu_wait_ioctl() to gem helper.

2019-08-23 Thread Gerd Hoffmann
Use drm_gem_reservation_object_wait() in virtio_gpu_wait_ioctl(). This also makes the ioctl run lockless. v5: handle lookup failure. v2: use reservation_object_test_signaled_rcu for VIRTGPU_WAIT_NOWAIT. Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel Vetter --- drivers/gpu/drm/virtio

[PATCH v8 04/18] drm/virtio: remove virtio_gpu_object_wait

2019-08-23 Thread Gerd Hoffmann
No users left. Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel Vetter --- drivers/gpu/drm/virtio/virtgpu_drv.h| 1 - drivers/gpu/drm/virtio/virtgpu_object.c | 13 - 2 files changed, 14 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio

[PATCH v8 05/18] drm/virtio: drop no_wait argument from virtio_gpu_object_reserve

2019-08-23 Thread Gerd Hoffmann
All callers pass no_wait = false. Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel Vetter --- drivers/gpu/drm/virtio/virtgpu_drv.h | 5 ++--- drivers/gpu/drm/virtio/virtgpu_gem.c | 4 ++-- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions

[PATCH v8 03/18] drm/virtio: simplify cursor updates

2019-08-23 Thread Gerd Hoffmann
No need to do the reservation dance, we can just wait on the fence directly. Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel Vetter --- drivers/gpu/drm/virtio/virtgpu_plane.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/virtio

[PATCH v8 13/18] drm/virtio: drop virtio_gpu_object_list_validate/virtio_gpu_unref_list

2019-08-23 Thread Gerd Hoffmann
No users left. Signed-off-by: Gerd Hoffmann Acked-by: Daniel Vetter --- drivers/gpu/drm/virtio/virtgpu_drv.h | 3 -- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 39 -- 2 files changed, 42 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm

[PATCH v8 01/18] drm/virtio: pass gem reservation object to ttm init

2019-08-23 Thread Gerd Hoffmann
With this gem and ttm will use the same reservation object, so mixing and matching ttm / gem reservation helpers should work fine. Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel Vetter --- drivers/gpu/drm/virtio/virtgpu_object.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff

[PATCH v8 17/18] drm/virtio: drop virtio_gpu_object_{reserve, unreserve}

2019-08-23 Thread Gerd Hoffmann
No users left. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 21 - 1 file changed, 21 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h index 85f974a9837b..fb35831ed351 100644 --- a/drivers/gpu

[PATCH v8 09/18] drm/virtio: rework virtio_gpu_object_create fencing

2019-08-23 Thread Gerd Hoffmann
the command is in flight still. v6: rewrite most of the patch. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h| 2 + drivers/gpu/drm/virtio/virtgpu_object.c | 74 +++-- drivers/gpu/drm/virtio/virtgpu_vq.c | 4 ++ 3 files changed, 37 insertions

[PATCH v8 10/18] drm/virtio: rework virtio_gpu_transfer_from_host_ioctl fencing

2019-08-23 Thread Gerd Hoffmann
Switch to the virtio_gpu_array_* helper workflow. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 3 +- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 40 ++ drivers/gpu/drm/virtio/virtgpu_vq.c| 8 -- 3 files changed, 23 insertions(+), 28

[PATCH v8 08/18] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing

2019-08-23 Thread Gerd Hoffmann
object references and free virtio_gpu_object_array. v6: rewrite most of the patch. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 6 ++- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 56 +- drivers/gpu/drm/virtio/virtgpu_vq.c| 21 +++--- 3

[PATCH v8 06/18] drm/virtio: remove ttm calls from in virtio_gpu_object_{reserve, unreserve}

2019-08-23 Thread Gerd Hoffmann
Call reservation_object_* directly instead of using ttm_bo_{reserve,unreserve}. v4: check for EINTR only. v3: check for EINTR too. Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel Vetter --- drivers/gpu/drm/virtio/virtgpu_drv.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff

[PATCH v8 15/18] drm/virtio: remove virtio_gpu_alloc_object

2019-08-23 Thread Gerd Hoffmann
Thin wrapper around virtio_gpu_object_create(), but calling that directly works equally well. Signed-off-by: Gerd Hoffmann Acked-by: Daniel Vetter --- drivers/gpu/drm/virtio/virtgpu_drv.h | 4 drivers/gpu/drm/virtio/virtgpu_gem.c | 23 --- drivers/gpu/drm/virtio

[PATCH v8 07/18] drm/virtio: add virtio_gpu_object_array & helpers

2019-08-23 Thread Gerd Hoffmann
helpers. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 17 + drivers/gpu/drm/virtio/virtgpu_gem.c | 93 2 files changed, 110 insertions(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h index

[PATCH v8 14/18] drm/virtio: switch from ttm to gem shmem helpers

2019-08-23 Thread Gerd Hoffmann
fencing was sorted the switch was surprisingly easy and for the most part just removing the ttm code. v4: fix drm_gem_object_funcs name. Signed-off-by: Gerd Hoffmann Acked-by: Daniel Vetter --- drivers/gpu/drm/virtio/virtgpu_drv.h| 52 +--- drivers/gpu/drm/virtio/virtgpu_drv.c| 20

[PATCH v8 11/18] drm/virtio: rework virtio_gpu_transfer_to_host_ioctl fencing

2019-08-23 Thread Gerd Hoffmann
Switch to the virtio_gpu_array_* helper workflow. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 4 +-- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 50 +++--- drivers/gpu/drm/virtio/virtgpu_plane.c | 21 --- drivers/gpu/drm/virtio

[PATCH v8 18/18] drm/virtio: add fence sanity check

2019-08-23 Thread Gerd Hoffmann
Make sure we don't leak half-initialized fences outside the driver. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_fence.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_fence.c b/drivers/gpu/drm/virtio/virtgpu_fence.c index a0514f5

[PATCH v8 12/18] drm/virtio: rework virtio_gpu_cmd_context_{attach, detach}_resource

2019-08-23 Thread Gerd Hoffmann
Switch to the virtio_gpu_array_* helper workflow. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 4 ++-- drivers/gpu/drm/virtio/virtgpu_gem.c | 24 +++- drivers/gpu/drm/virtio/virtgpu_vq.c | 12 3 files changed, 21 insertions(+), 19

[PATCH v8 16/18] drm/virtio: drop virtio_gpu_object_{ref,unref}

2019-08-23 Thread Gerd Hoffmann
No users left. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 15 --- 1 file changed, 15 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h index 3e5b2d1db42d..85f974a9837b 100644 --- a/drivers/gpu/drm

Re: [PATCH v2] drm/virtio: add plane check

2019-08-26 Thread Gerd Hoffmann
On Mon, Aug 26, 2019 at 03:34:56PM -0700, Chia-I Wu wrote: > On Thu, Aug 22, 2019 at 2:47 AM Gerd Hoffmann wrote: > > > > Use drm_atomic_helper_check_plane_state() > > to sanity check the plane state. > > > > Signed-off-by: Gerd Hoffmann > > --- > >

[PATCH v9 06/18] drm/virtio: remove ttm calls from in virtio_gpu_object_{reserve, unreserve}

2019-08-29 Thread Gerd Hoffmann
Call reservation_object_* directly instead of using ttm_bo_{reserve,unreserve}. v4: check for EINTR only. v3: check for EINTR too. Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel Vetter --- drivers/gpu/drm/virtio/virtgpu_drv.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff

[PATCH v9 03/18] drm/virtio: simplify cursor updates

2019-08-29 Thread Gerd Hoffmann
No need to do the reservation dance, we can just wait on the fence directly. Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel Vetter --- drivers/gpu/drm/virtio/virtgpu_plane.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/virtio

[PATCH v9 08/18] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing

2019-08-29 Thread Gerd Hoffmann
object references and free virtio_gpu_object_array. v6: rewrite most of the patch. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 6 ++- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 56 +- drivers/gpu/drm/virtio/virtgpu_vq.c| 21 +++--- 3

[PATCH v9 04/18] drm/virtio: remove virtio_gpu_object_wait

2019-08-29 Thread Gerd Hoffmann
No users left. Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel Vetter --- drivers/gpu/drm/virtio/virtgpu_drv.h| 1 - drivers/gpu/drm/virtio/virtgpu_object.c | 13 - 2 files changed, 14 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio

[PATCH v9 07/18] drm/virtio: add virtio_gpu_object_array & helpers

2019-08-29 Thread Gerd Hoffmann
virtio-private instead of generic helpers. Signed-off-by: Gerd Hoffmann [fixup] virtio_gpu_array_lock_resv --- drivers/gpu/drm/virtio/virtgpu_drv.h | 17 + drivers/gpu/drm/virtio/virtgpu_gem.c | 93 2 files changed, 110 insertions(+) diff --git a/drivers/gpu/drm

[PATCH v9 15/18] drm/virtio: remove virtio_gpu_alloc_object

2019-08-29 Thread Gerd Hoffmann
Thin wrapper around virtio_gpu_object_create(), but calling that directly works equally well. Signed-off-by: Gerd Hoffmann Acked-by: Daniel Vetter --- drivers/gpu/drm/virtio/virtgpu_drv.h | 4 drivers/gpu/drm/virtio/virtgpu_gem.c | 23 --- drivers/gpu/drm/virtio

[PATCH v9 01/18] drm/virtio: pass gem reservation object to ttm init

2019-08-29 Thread Gerd Hoffmann
With this gem and ttm will use the same reservation object, so mixing and matching ttm / gem reservation helpers should work fine. Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel Vetter --- drivers/gpu/drm/virtio/virtgpu_object.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff

[PATCH v9 17/18] drm/virtio: drop virtio_gpu_object_{reserve, unreserve}

2019-08-29 Thread Gerd Hoffmann
No users left. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 21 - 1 file changed, 21 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h index 85f974a9837b..fb35831ed351 100644 --- a/drivers/gpu

[PATCH v9 10/18] drm/virtio: rework virtio_gpu_transfer_from_host_ioctl fencing

2019-08-29 Thread Gerd Hoffmann
Switch to the virtio_gpu_array_* helper workflow. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 3 +- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 40 ++ drivers/gpu/drm/virtio/virtgpu_vq.c| 8 -- 3 files changed, 23 insertions(+), 28

[PATCH v9 13/18] drm/virtio: drop virtio_gpu_object_list_validate/virtio_gpu_unref_list

2019-08-29 Thread Gerd Hoffmann
No users left. Signed-off-by: Gerd Hoffmann Acked-by: Daniel Vetter --- drivers/gpu/drm/virtio/virtgpu_drv.h | 3 -- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 39 -- 2 files changed, 42 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm

[PATCH v9 02/18] drm/virtio: switch virtio_gpu_wait_ioctl() to gem helper.

2019-08-29 Thread Gerd Hoffmann
Use drm_gem_reservation_object_wait() in virtio_gpu_wait_ioctl(). This also makes the ioctl run lockless. v9: fix return value. v5: handle lookup failure. v2: use reservation_object_test_signaled_rcu for VIRTGPU_WAIT_NOWAIT. Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel Vetter --- drivers

[PATCH v9 12/18] drm/virtio: rework virtio_gpu_cmd_context_{attach, detach}_resource

2019-08-29 Thread Gerd Hoffmann
Switch to the virtio_gpu_array_* helper workflow. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 4 ++-- drivers/gpu/drm/virtio/virtgpu_gem.c | 24 +++- drivers/gpu/drm/virtio/virtgpu_vq.c | 12 3 files changed, 21 insertions(+), 19

[PATCH v9 11/18] drm/virtio: rework virtio_gpu_transfer_to_host_ioctl fencing

2019-08-29 Thread Gerd Hoffmann
Switch to the virtio_gpu_array_* helper workflow. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 4 +-- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 50 +++--- drivers/gpu/drm/virtio/virtgpu_plane.c | 21 --- drivers/gpu/drm/virtio

[PATCH v9 05/18] drm/virtio: drop no_wait argument from virtio_gpu_object_reserve

2019-08-29 Thread Gerd Hoffmann
All callers pass no_wait = false. Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel Vetter --- drivers/gpu/drm/virtio/virtgpu_drv.h | 5 ++--- drivers/gpu/drm/virtio/virtgpu_gem.c | 4 ++-- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions

[PATCH v9 18/18] drm/virtio: add fence sanity check

2019-08-29 Thread Gerd Hoffmann
Make sure we don't leak half-initialized fences outside the driver. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_fence.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_fence.c b/drivers/gpu/drm/virtio/virtgpu_fence.c index a0514f5

[PATCH v9 16/18] drm/virtio: drop virtio_gpu_object_{ref,unref}

2019-08-29 Thread Gerd Hoffmann
No users left. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 15 --- 1 file changed, 15 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h index 3e5b2d1db42d..85f974a9837b 100644 --- a/drivers/gpu/drm

[PATCH v9 09/18] drm/virtio: rework virtio_gpu_object_create fencing

2019-08-29 Thread Gerd Hoffmann
the command is in flight still. v6: rewrite most of the patch. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h| 2 + drivers/gpu/drm/virtio/virtgpu_object.c | 74 +++-- drivers/gpu/drm/virtio/virtgpu_vq.c | 4 ++ 3 files changed, 37 insertions

[PATCH v9 14/18] drm/virtio: switch from ttm to gem shmem helpers

2019-08-29 Thread Gerd Hoffmann
fencing was sorted the switch was surprisingly easy and for the most part just removing the ttm code. v4: fix drm_gem_object_funcs name. Signed-off-by: Gerd Hoffmann Acked-by: Daniel Vetter --- drivers/gpu/drm/virtio/virtgpu_drv.h| 52 +--- drivers/gpu/drm/virtio/virtgpu_drv.c| 20

[PATCH] drm/virtio: add worker for object release

2019-08-29 Thread Gerd Hoffmann
-by: Chia-I Wu Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 8 drivers/gpu/drm/virtio/virtgpu_gem.c | 27 +++ drivers/gpu/drm/virtio/virtgpu_kms.c | 6 ++ drivers/gpu/drm/virtio/virtgpu_vq.c | 2 +- 4 files changed, 42 insertions

Re: [PATCH] drm/virtio: Use vmalloc for command buffer allocations.

2019-08-29 Thread Gerd Hoffmann
Hi, > { > if (vbuf->resp_size > MAX_INLINE_RESP_SIZE) > kfree(vbuf->resp_buf); > - kfree(vbuf->data_buf); > + kvfree(vbuf->data_buf); if (is_vmalloc_addr(vbuf->data_buf)) ... needed here I gues? > +/* Create sg_table from a vmalloc'd buffer. */ > +static struct sg

Re: [PATCH] drm/virtio: Use vmalloc for command buffer allocations.

2019-08-30 Thread Gerd Hoffmann
Hi, > > > - kfree(vbuf->data_buf); > > > + kvfree(vbuf->data_buf); > > > > if (is_vmalloc_addr(vbuf->data_buf)) ... > > > > needed here I gues? > > > > kvfree() handles vmalloc/kmalloc/kvmalloc internally by doing that check. Ok. > - videobuf_vmalloc_to_sg in drivers/media/v4l2-core/v

Re: [PATCH] drm/virtio: Use vmalloc for command buffer allocations.

2019-09-01 Thread Gerd Hoffmann
> > Completely different approach: use get_user_pages() and don't copy the > > execbuffer at all. > It would be really nice if execbuffer does not copy. > > The user space owns the buffer and may overwrite the contents > immediately after the ioctl. Oh, right. The exec ioctl doesn't block. So t

Re: [PATCH] drm/virtio: Use vmalloc for command buffer allocations.

2019-09-01 Thread Gerd Hoffmann
On Fri, Aug 30, 2019 at 10:49:25AM -0700, David Riley wrote: > Hi Gerd, > > On Fri, Aug 30, 2019 at 4:16 AM Gerd Hoffmann wrote: > > > > Hi, > > > > > > > - kfree(vbuf->data_buf); > > > > > + kvfree(vbuf-&g

[PATCH 5/5] drm/qxl: use drm_gem_ttm_print_info

2019-09-02 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.h| 1 + drivers/gpu/drm/qxl/qxl_object.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_drv.h b/drivers/gpu/drm/qxl/qxl_drv.h index 9e034c5fa87d..d4051409ce64 100644 --- a/drivers/gpu/drm/qxl

[PATCH 4/5] drm/qxl: use drm_gem_object_funcs callbacks

2019-09-02 Thread Gerd Hoffmann
Switch qxl to use drm_gem_object_funcs callbacks instead of drm_driver callbacks. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.c| 8 drivers/gpu/drm/qxl/qxl_object.c | 12 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm

Re: [PATCH 4/5] drm/qxl: use drm_gem_object_funcs callbacks

2019-09-02 Thread Gerd Hoffmann
On Mon, Sep 02, 2019 at 04:34:49PM +0200, Thomas Zimmermann wrote: > This patch seems unrelated. Well, patch 5/5 depends on it because it hooks the drm_gem_ttm_print_info helper into the new qxl_object_funcs added by this patch. > Am 02.09.19 um 14:41 schrieb Gerd Hoffmann: > > Switc

[PATCH v2 5/6] drm/qxl: use drm_gem_object_funcs callbacks

2019-09-03 Thread Gerd Hoffmann
Switch qxl to use drm_gem_object_funcs callbacks instead of drm_driver callbacks. Signed-off-by: Gerd Hoffmann Acked-by: Thomas Zimmermann --- drivers/gpu/drm/qxl/qxl_drv.c| 8 drivers/gpu/drm/qxl/qxl_object.c | 12 2 files changed, 12 insertions(+), 8 deletions

[PATCH v2 6/6] drm/qxl: use drm_gem_ttm_print_info

2019-09-03 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Acked-by: Thomas Zimmermann --- drivers/gpu/drm/qxl/qxl_drv.h| 1 + drivers/gpu/drm/qxl/qxl_object.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_drv.h b/drivers/gpu/drm/qxl/qxl_drv.h index 9e034c5fa87d..d4051409ce64 100644 --- a

[PATCH v3 7/7] drm/vram: fix Kconfig

2019-09-03 Thread Gerd Hoffmann
select isn't recursive, so we can't turn on DRM_TTM + DRM_TTM_HELPER in config DRM_VRAM_HELPER, we have to select them on the vram users instead. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/Kconfig | 2 -- drivers/gpu/drm/ast/Kconfig | 2 ++ drive

[PATCH v3 5/7] drm/qxl: use drm_gem_object_funcs callbacks

2019-09-03 Thread Gerd Hoffmann
Switch qxl to use drm_gem_object_funcs callbacks instead of drm_driver callbacks. Signed-off-by: Gerd Hoffmann Acked-by: Thomas Zimmermann --- drivers/gpu/drm/qxl/qxl_drv.c| 8 drivers/gpu/drm/qxl/qxl_object.c | 12 2 files changed, 12 insertions(+), 8 deletions

[PATCH v3 6/7] drm/qxl: use drm_gem_ttm_print_info

2019-09-03 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Acked-by: Thomas Zimmermann --- drivers/gpu/drm/qxl/qxl_drv.h| 1 + drivers/gpu/drm/qxl/qxl_object.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_drv.h b/drivers/gpu/drm/qxl/qxl_drv.h index 9e034c5fa87d..d4051409ce64 100644 --- a

[PATCH] drm/virtio: fix command submission with objects but without fence.

2019-09-04 Thread Gerd Hoffmann
Only call virtio_gpu_array_add_fence if we actually have a fence. Fixes: da758d51968a ("drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing") Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_vq.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) di

Re: [PATCH] drm/virtio: fix command submission with objects but without fence.

2019-09-04 Thread Gerd Hoffmann
On Wed, Sep 04, 2019 at 04:10:30PM -0700, Chia-I Wu wrote: > On Wed, Sep 4, 2019 at 12:48 AM Gerd Hoffmann wrote: > > > > Only call virtio_gpu_array_add_fence if we actually have a fence. > > > > Fixes: da758d51968a ("drm/virtio: rework virtio_gpu_execbuffer_ioctl

[PATCH 1/8] drm/ttm: turn ttm_bo_device.vma_manager into a pointer

2019-09-05 Thread Gerd Hoffmann
_vma_manager is used. All callers are updated to pass NULL, so the behavior doesn't change. Signed-off-by: Gerd Hoffmann --- include/drm/ttm/ttm_bo_driver.h | 8 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 1 + drivers/gpu/drm/drm_vram_mm_helper.c| 1 + drivers/gpu/drm/no

[PATCH 6/8] drm/qxl: switch to gem vma offset manager

2019-09-05 Thread Gerd Hoffmann
Pass gem vma_offset_manager to ttm_bo_device_init(), so ttm uses it instead of its own embedded struct. This makes some gem functions (specifically drm_gem_object_lookup) work on ttm objects. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_ttm.c | 2 +- 1 file changed, 1 insertion

Re: Xorg indefinitely hangs in kernelspace

2019-09-05 Thread Gerd Hoffmann
On Tue, Aug 06, 2019 at 09:00:10PM +0300, Jaak Ristioja wrote: > Hello! > > I'm writing to report a crash in the QXL / DRM code in the Linux kernel. > I originally filed the issue on LaunchPad and more details can be found > there, although I doubt whether these details are useful. Any change wit

Re: [PATCH v2] drm/virtio: Use vmalloc for command buffer allocations.

2019-09-05 Thread Gerd Hoffmann
> +/* How many bytes left in this page. */ > +static unsigned int rest_of_page(void *data) > +{ > + return PAGE_SIZE - offset_in_page(data); > +} Not needed. > +/* Create sg_table from a vmalloc'd buffer. */ > +static struct sg_table *vmalloc_to_sgt(char *data, uint32_t size, int > *sg_ents)

Re: Xorg indefinitely hangs in kernelspace

2019-09-08 Thread Gerd Hoffmann
Hi, --verbose please. Do you see the same hang? Does the patch fix it? > --- a/drivers/gpu/drm/ttm/ttm_execbuf_util.c > +++ b/drivers/gpu/drm/ttm/ttm_execbuf_util.c > @@ -97,8 +97,9 @@ int ttm_eu_reserve_buffers(struct ww_acq > struct list_head *dups, bool del_lru) [

Re: [PATCH v3 1/2] drm/virtio: Add window server support

2018-02-01 Thread Gerd Hoffmann
Hi, Sorry for joining the party late. Had a broken finger and was offline for a bunch of weeks (and a buif backlog afterwards ...). > This is to allow clients running within VMs to be able to communicate > with a compositor in the host. Clients will use the communication > protocol that the co

Re: [PATCH v3 1/2] drm/virtio: Add window server support

2018-02-05 Thread Gerd Hoffmann
Hi, > > Why not use virtio-vsock to run the wayland protocol? I don't like > > the idea to duplicate something with very simliar functionality in > > virtio-gpu. > > The reason for abandoning that approach was the type of objects that > could be shared via virtio-vsock would be extremely limite

Re: [PATCH v3 1/2] drm/virtio: Add window server support

2018-02-05 Thread Gerd Hoffmann
On Mon, Feb 05, 2018 at 03:46:17PM +0100, Tomeu Vizoso wrote: > On 02/05/2018 01:20 PM, Gerd Hoffmann wrote: > >Hi, > > > > > > Why not use virtio-vsock to run the wayland protocol? I don't like > > > > the idea to duplicate something with very

Re: [PATCH v3 1/2] drm/virtio: Add window server support

2018-02-06 Thread Gerd Hoffmann
Hi, > > Hmm? I'm assuming the wayland client (in the guest) talks to the > > wayland proxy, using the wayland protocol, like it would talk to a > > wayland display server. Buffers must be passed from client to > > server/proxy somehow, probably using fd passing, so where is the > > problem? >

Re: [PATCH v3 1/2] drm/virtio: Add window server support

2018-02-12 Thread Gerd Hoffmann
Hi, > >(a) software rendering: client allocates shared memory buffer, renders > >into it, then passes a file handle for that shmem block together > >with some meta data (size, format, ...) to the wayland server. > > > >(b) gpu rendering: client opens a render node, alloc

Re: [PATCH v3 1/2] drm/virtio: Add window server support

2018-02-12 Thread Gerd Hoffmann
Hi, > can we reach agreement on whether vsock should be involved in this? I think the best approach would be to have guest proxy and host proxy use vsock for the wayland protocol. Use a wayland protocol extension to reference the buffers in stdvga / ivshmem / virtio-gpu. Only the two proxies

Re: [PATCH v3 1/2] drm/virtio: Add window server support

2018-02-12 Thread Gerd Hoffmann
On Mon, Feb 12, 2018 at 03:00:24PM +0100, Tomeu Vizoso wrote: > On 02/12/2018 12:52 PM, Gerd Hoffmann wrote: > >Hi, > > > > > can we reach agreement on whether vsock should be involved in this? > > > > I think the best approach would be to have guest pr

Re: [PATCH v3 1/2] drm/virtio: Add window server support

2018-02-12 Thread Gerd Hoffmann
> > I was more thinking about a struct containing enough info to allow the > > proxy on the host side find the buffer, something like: > > > > struct { > >enum type { stdvga, virtio-cpu, ... } > >pcislot device; > >union { > > int stdvga_pcibar_offset; > >

Re: [PATCH v3 1/2] drm/virtio: Add window server support

2018-02-16 Thread Gerd Hoffmann
> > Yes. > > Would it make sense for virtio-gpu to map buffers to the guest via PCI BARs? > So we can use a single drm driver for both 2d and 3d. Should be doable. I'm wondering two things though: (1) Will shmem actually help avoiding a copy? virtio-gpu with virgl will (even if the guest doesn

[PATCH 2/4] qxl: move qxl_send_monitors_config()

2018-02-16 Thread Gerd Hoffmann
Needed to avoid a forward declaration in a followup patch. Pure code move, no functional change. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 47 +++ 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/qxl

[PATCH 4/4] qxl: drop dummy functions

2018-02-16 Thread Gerd Hoffmann
These days drm core checks function pointers everywhere before calling them. So we can drop a bunch of dummy functions now. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 50 --- 1 file changed, 50 deletions(-) diff --git a/drivers/gpu

[PATCH 3/4] qxl: hook monitors_config updates into crtc, not encoder.

2018-02-16 Thread Gerd Hoffmann
callbacks. Remove monitors_config updates from all other places. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1544322 Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_cmd.c | 2 + drivers/gpu/drm/qxl/qxl_display.c | 156 -- 2 files changed, 66

[PATCH 1/4] qxl: remove qxl_io_log()

2018-02-16 Thread Gerd Hoffmann
qxl_io_log() sends messages over to the host (qemu) for logging. Remove the function and all callers, we can just use standard DRM_DEBUG calls (and if needed a serial console). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.h | 3 --- drivers/gpu/drm/qxl/qxl_cmd.c | 34

Re: [PATCH 0/7] drm/virtio: Checkpatch cleanup for virtio

2018-02-26 Thread Gerd Hoffmann
On Thu, Feb 22, 2018 at 08:59:33PM -0300, Rodrigo Siqueira wrote: > This patchset fixes warnings and errors found by checkpatch.pl in the > drm/virtio: Added to drm-qemu queue, will land in drm-misc soon. thanks, Gerd ___ Virtualization mailing list

Re: [PATCH 20/23] drm/virtio: Stop updating plane->fb

2018-03-22 Thread Gerd Hoffmann
> We want to get rid of plane->fb on atomic drivers. Stop setting it. > - primary->crtc = crtc; > - cursor->crtc = crtc; commit msg vs. patch content mismatch here ... cheers, Gerd ___ Virtualization mailing list Virtualization@lists.linux-f

[PATCH] drm/virtio: fix vq wait_event condition

2018-04-03 Thread Gerd Hoffmann
Wait until we have enough space in the virt queue to actually queue up our request. Avoids the guest spinning in case we have a non-zero amount of free entries but not enough for the request. Cc: sta...@vger.kernel.org Reported-by: Alain Magloire Signed-off-by: Gerd Hoffmann --- drivers/gpu

[PATCH 2/2] qxl: keep separate release_bo pointer

2018-04-17 Thread Gerd Hoffmann
qxl expects that list_first_entry(release->bos) returns the first element qxl added to the list. ttm_eu_reserve_buffers() may reorder the list though. Add a release_bo field to struct qxl_release and use that instead. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.h |

[PATCH 1/2] qxl: fix qxl_release_{map,unmap}

2018-04-17 Thread Gerd Hoffmann
s/PAGE_SIZE/PAGE_MASK/ Luckily release_offset is never larger than PAGE_SIZE, so the bug has no bad side effects and managed to stay unnoticed for years that way ... Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_ioctl.c | 4 ++-- drivers/gpu/drm/qxl/qxl_release.c | 6 +++--- 2

Re: drm: qxl: what's going on

2018-04-19 Thread Gerd Hoffmann
On Fri, Apr 20, 2018 at 02:26:11AM -0400, Chunyu Hu wrote: > Hello, > > I am seeing qxl driver is not working in my kvm machine with kernel 4.17, > (4.16 failed too). I'd like to consult your expert is there a fix for it > now? https://www.kraxel.org/cgit/linux/log/?h=drm-qxl-release cheers,

[PATCH v2 1/4] qxl: remove qxl_io_log()

2018-04-20 Thread Gerd Hoffmann
qxl_io_log() sends messages over to the host (qemu) for logging. Remove the function and all callers, we can just use standard DRM_DEBUG calls (and if needed a serial console). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.h | 3 --- drivers/gpu/drm/qxl/qxl_cmd.c | 34

[PATCH v2 3/4] qxl: hook monitors_config updates into crtc, not encoder.

2018-04-20 Thread Gerd Hoffmann
callbacks. Remove monitors_config updates from all other places. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1544322 Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_cmd.c | 2 + drivers/gpu/drm/qxl/qxl_display.c | 156 -- 2 files changed, 66

[PATCH v2 2/4] qxl: move qxl_send_monitors_config()

2018-04-20 Thread Gerd Hoffmann
Needed to avoid a forward declaration in a followup patch. Pure code move, no functional change. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 47 +++ 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/qxl

[PATCH v2 4/4] qxl: drop dummy functions

2018-04-20 Thread Gerd Hoffmann
These days drm core checks function pointers everywhere before calling them. So we can drop a bunch of dummy functions now. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 50 --- 1 file changed, 50 deletions(-) diff --git a/drivers/gpu

Re: [PATCH] drm/virtio: fix vq wait_event condition

2018-04-20 Thread Gerd Hoffmann
On Tue, Apr 03, 2018 at 11:59:04AM +0200, Gerd Hoffmann wrote: > Wait until we have enough space in the virt queue to actually queue up > our request. Avoids the guest spinning in case we have a non-zero > amount of free entries but not enough for the request. Ping airlied, can you plea

Re: [PATCH] gpu: drm: qxl: Adding new typedef vm_fault_t

2018-04-23 Thread Gerd Hoffmann
On Tue, Apr 17, 2018 at 07:08:44PM +0530, Souptick Joarder wrote: > Use new return type vm_fault_t for fault handler. For > now, this is just documenting that the function returns > a VM_FAULT value rather than an errno. Once all instances > are converted, vm_fault_t will become a distinct type. >

Re: [PATCH] gpu: drm: qxl: Adding new typedef vm_fault_t

2018-04-24 Thread Gerd Hoffmann
On Tue, Apr 24, 2018 at 02:11:51PM +0200, Daniel Vetter wrote: > On Mon, Apr 23, 2018 at 12:49:24PM +0200, Gerd Hoffmann wrote: > > On Tue, Apr 17, 2018 at 07:08:44PM +0530, Souptick Joarder wrote: > > > Use new return type vm_fault_t for fault handler. For > > > now, th

Re: [PATCH] gpu: drm: qxl: Adding new typedef vm_fault_t

2018-05-14 Thread Gerd Hoffmann
Hi, > > So my expectation that a backmerge happens anyway after -rc1/2 is in > > line with reality, it is just to be delayed this time. I'll stay > > tuned ;) > > Is this patch already merged in drm-misc-next tree ? Pushed now. cheers, Gerd ___

Re: [PATCH] drm/qxl: Call qxl_bo_unref outside atomic context

2018-06-04 Thread Gerd Hoffmann
On Fri, Jun 01, 2018 at 04:05:32PM -0400, Jeremy Cline wrote: > "qxl_bo_unref" may sleep, but calling "qxl_release_map" causes > "preempt_disable()" to be called and "preempt_enable()" isn't called > until "qxl_release_unmap" is used. Move the call to "qxl_bo_unref" out > from in between the two to

<    2   3   4   5   6   7   8   9   10   11   >