Re: [PATCH v2 5/6] drm/virtio: drop fencing in virtio_gpu_resource_create_ioctl

2019-03-18 Thread Gerd Hoffmann
Hi, > virtio_gpu_execbuffer_ioctl > virtio_gpu_resource_create_ioctl with fence resource > virtio_gpu_wait_ioctl with that fence resource --> associated with a > GL wait on the host side After a long break (sidetracked with other stuff) I've finally sent v3 which should address this. cheers,

[PATCH] drm/virtio: do NOT reuse resource ids

2019-02-09 Thread Gerd Hoffmann
vely makes the linux kernel starting re-using IDs after releasing them, and apparently virglrenderer can't deal with that. Oops. This patch puts a temporary stopgap into place for the 5.0 release. Cc: David Airlie Signed-off-by: Gerd Hoffmann --- Notes: Hi Dave, I'll be offline next week, so ple

[PATCH v2] drm/qxl: use ttm_tt

2019-01-29 Thread Gerd Hoffmann
qxl device will not dma, so we don't need ttm_dma_tt. Go use ttm_tt instead, to avoid wasting resources (swiotlb bounce buffers for example). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_ttm.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers

[PATCH v2 6/6] drm/virtio: move virtio_gpu_cmd_create_resource call into virtio_gpu_object_create

2019-01-30 Thread Gerd Hoffmann
is not yet created, so the extra virtio_gpu_object_attach() calls done after virtio_gpu_cmd_create_resource() is not needed any more. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h| 2 ++ drivers/gpu/drm/virtio/virtgpu_gem.c| 12 +--- drivers/gpu/drm/virtio

[PATCH v2 1/6] drm/virtio: move virtio_gpu_object_{attach, detach} calls.

2019-01-30 Thread Gerd Hoffmann
and move_notify callbacks are not needed any more, so drop them. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_ttm.c | 92 ++-- 1 file changed, 24 insertions(+), 68 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_ttm.c b/drivers/gpu/drm

[PATCH v2 5/6] drm/virtio: drop fencing in virtio_gpu_resource_create_ioctl

2019-01-30 Thread Gerd Hoffmann
, where we have to make sure the host has seen the destroy and thus doesn't use it any more before releasing the pages backing the resource. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 51 +- 1 file changed, 1 insertion(+), 50 deletions

[PATCH v2 2/6] drm/virtio: use struct to pass params to virtio_gpu_object_create()

2019-01-30 Thread Gerd Hoffmann
parameter for virtio_gpu_alloc_object(), it is unused and always false. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h| 15 ++- drivers/gpu/drm/virtio/virtgpu_gem.c| 17 ++--- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 11 ++- drivers/gpu/

[PATCH v2 3/6] drm/virtio: params struct for virtio_gpu_cmd_create_resource()

2019-01-30 Thread Gerd Hoffmann
Add format, width and height fields to the virtio_gpu_object_params struct. With that in place we can use the parameter struct for virtio_gpu_cmd_create_resource() calls too. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 7 --- drivers/gpu/drm/virtio

Re: [PATCH 19/26] drm/qxl: Use drm_fb_helper_fill_info

2019-01-25 Thread Gerd Hoffmann
On Thu, Jan 24, 2019 at 05:58:24PM +0100, Daniel Vetter wrote: > This should not result in any changes. I'd love to merge https://patchwork.freedesktop.org/series/53951/ instead (which will -- among other things -- switch qxl over to the generic fbdev emulation and remove the code you are

Re: [PATCH v2 2/6] drm/virtio: use struct to pass params to virtio_gpu_object_create()

2019-02-01 Thread Gerd Hoffmann
> > - ret = virtio_gpu_gem_create(file_priv, dev, args->size, , > > + params.pinned = false, > > You have a comma here, but assigning to false isn't really necessary > since the struct is zeroed. Same goes for the same assignment further down. Hmm, yes, but it likewise isn't used, so I think

Re: [PATCH v2 4/6] drm/virtio: params struct for virtio_gpu_cmd_create_resource_3d()

2019-02-01 Thread Gerd Hoffmann
On Thu, Jan 31, 2019 at 11:47:38AM +0100, Noralf Trønnes wrote: > > > Den 30.01.2019 10.43, skrev Gerd Hoffmann: > > Add 3d resource parameters to virtio_gpu_object_params struct. With > > that in place we can use it for virtio_gpu_cmd_resource_create_3d() > >

Re: [PATCH v2 5/6] drm/virtio: drop fencing in virtio_gpu_resource_create_ioctl

2019-02-01 Thread Gerd Hoffmann
On Thu, Jan 31, 2019 at 11:04:31AM -0800, Gurchetan Singh wrote: > On Wed, Jan 30, 2019 at 1:43 AM Gerd Hoffmann wrote: > > > > There is no need to wait for completion here. > > > > The host will process commands in submit order, so commands can > > reference the

[PATCH] drm/bochs: fix bochs_gem_prime_mmap

2019-02-04 Thread Gerd Hoffmann
to the drm_gem_object vm_node so the offset math in drm_gem_prime_mmap() works correctly for us even though we use ttm to manage our objects. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_mm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bochs/bochs_mm.c b

[PATCH] drm/cirrus: add plane setup

2019-02-04 Thread Gerd Hoffmann
Commit "f4bd542bca drm/fb-helper: Scale back depth to supported maximum" uncovered a bug in the cirrus driver. It must create its own primary plane, using the correct format list, depending on the bpp module parameter, so it is consistent with mode_config->preferred_depth. Signed

Re: [PATCH 3/3] virtio-gpu api: VIRTIO_GPU_F_RESSOURCE_V2

2019-04-10 Thread Gerd Hoffmann
> > +/* VIRTIO_GPU_CMD_RESOURCE_CREATE_V2 */ > > +struct virtio_gpu_cmd_resource_create_v2 { > > + struct virtio_gpu_ctrl_hdr hdr; > > + __le32 resource_id; > > + __le32 format; > > + __le32 width; > > + __le32 height; > > + /* 3d only */ > > + __le32

[PATCH v2 1/3] drm: switch drm_fb_memcpy_dstclip to accept __iomem dst

2019-04-10 Thread Gerd Hoffmann
the memcpy loop into the drm_fb_memcpy_lines() helper isn't useful any more, so move the code back into the calling functins. Signed-off-by: Gerd Hoffmann --- include/drm/drm_format_helper.h | 3 +- drivers/gpu/drm/cirrus/cirrus.c | 2 +- drivers/gpu/drm/drm_format_helper.c | 45

[PATCH v2 2/3] drm: switch drm_fb_xrgb8888_to_rgb565_dstclip to accept __iomem dst

2019-04-10 Thread Gerd Hoffmann
(drm_fb_xrgb_to_rgb565_line) has been changed to process a single scanline. Signed-off-by: Gerd Hoffmann --- include/drm/drm_format_helper.h | 2 +- drivers/gpu/drm/cirrus/cirrus.c | 2 +- drivers/gpu/drm/drm_format_helper.c | 113 ++-- 3 files changed, 60

[PATCH v2 3/3] drm: switch drm_fb_xrgb8888_to_rgb888_dstclip to accept __iomem dst

2019-04-10 Thread Gerd Hoffmann
(drm_fb_xrgb_to_rgb888_line) has been changed to process a single scanline. Signed-off-by: Gerd Hoffmann --- include/drm/drm_format_helper.h | 2 +- drivers/gpu/drm/cirrus/cirrus.c | 2 +- drivers/gpu/drm/drm_format_helper.c | 57 + 3 files changed, 27

[PATCH 1/3] virtio-gpu api: comment feature flags

2019-04-10 Thread Gerd Hoffmann
Add comments to the existing feature flags, documenting which commands belong to them. Signed-off-by: Gerd Hoffmann --- include/uapi/linux/virtio_gpu.h | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/uapi/linux/virtio_gpu.h b/include/uapi/linux

[PATCH 2/3] virtio-gpu api: VIRTIO_GPU_F_MEMORY

2019-04-10 Thread Gerd Hoffmann
). Signed-off-by: Gerd Hoffmann --- include/uapi/linux/virtio_gpu.h | 38 + 1 file changed, 38 insertions(+) diff --git a/include/uapi/linux/virtio_gpu.h b/include/uapi/linux/virtio_gpu.h index 0c85914d9369..732bb16a39f8 100644 --- a/include/uapi/linux/virtio_gpu.h

[PATCH 3/3] virtio-gpu api: VIRTIO_GPU_F_RESSOURCE_V2

2019-04-10 Thread Gerd Hoffmann
Add new command VIRTIO_GPU_CMD_RESOURCE_CREATE_V2 to create resources. It adds (a) support planar resources and (b) returns stride and size of the resource planes. The later will be needed in case we support mapping host resources into the guest some day. Signed-off-by: Gerd Hoffmann

[PATCH] drm/bochs: use simple display pipe

2019-04-10 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs.h | 6 +- drivers/gpu/drm/bochs/bochs_kms.c | 178 +- 2 files changed, 53 insertions(+), 131 deletions(-) diff --git a/drivers/gpu/drm/bochs/bochs.h b/drivers/gpu/drm/bochs/bochs.h index a7f6723bebdd

Re: [PATCH] drm/qxl: drop prime import/export callbacks

2019-04-09 Thread Gerd Hoffmann
On Tue, Apr 09, 2019 at 02:01:33PM +1000, Dave Airlie wrote: > On Sat, 12 Jan 2019 at 07:13, Dave Airlie wrote: > > > > On Thu, 10 Jan 2019 at 18:17, Gerd Hoffmann wrote: > > > > > > Also set prime_handle_to_fd and prime_fd_to_handle to NULL, > > > so dr

Re: [PATCH] drm/qxl: drop prime import/export callbacks

2019-04-09 Thread Gerd Hoffmann
Hi, > > Should we add something like DRM_PRIME_CAP_SAME_DEVICE? > > Yeah I expect we need some sort of same device only capability, so > that dri3 userspace can work. > > If we just fail importing in these cases what happens? userspace just > gets confused, I know we used to print a backtrace

Re: [PATCH 3/3] virtio-gpu api: VIRTIO_GPU_F_RESSOURCE_V2

2019-04-11 Thread Gerd Hoffmann
On Thu, Apr 11, 2019 at 06:36:15PM -0700, Gurchetan Singh wrote: > On Wed, Apr 10, 2019 at 10:03 PM Gerd Hoffmann wrote: > > > > > > +/* VIRTIO_GPU_CMD_RESOURCE_CREATE_V2 */ > > > > +struct virtio_gpu_cmd_resource_create_v2 { > > > > + struct vi

Re: [PATCH 3/3] virtio-gpu api: VIRTIO_GPU_F_RESSOURCE_V2

2019-04-17 Thread Gerd Hoffmann
On Fri, Apr 12, 2019 at 04:34:20PM -0700, Chia-I Wu wrote: > Hi, > > I am still new to virgl, and missed the last round of discussion about > resource_create_v2. > > From the discussion below, semantically resource_create_v2 creates a host > resource object _without_ any storage; memory_create

Re: [PATCH v5 00/20] Share TTM code among DRM framebuffer drivers

2019-05-15 Thread Gerd Hoffmann
On Wed, May 15, 2019 at 09:05:54AM +0200, Thomas Zimmermann wrote: > Hi, > > most of this patch set still needs reviews. > > If it's too large for merging or reviewing at once, I could move the > driver changes into separate patch sets. The vbox driver's changes have > been accepted by Hans

Re: [PATCH 0/2] Add BO reservation to GEM VRAM pin/unpin/push_to_system

2019-05-17 Thread Gerd Hoffmann
Hi, > It turns out that the bochs and vbox drivers automatically reserved and > unreserved the BO from within their pin and unpin functions. The other > drivers; ast, hibmc and mgag200; performed reservation explicitly. With the > GEM VRAM conversion, automatic BO reservation within pin and

[PATCH] drm/virtio: add plane check

2019-05-27 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

Re: [PATCH 4/4] drm/virtio: Add memory barriers for capset cache.

2019-06-06 Thread Gerd Hoffmann
On Wed, Jun 05, 2019 at 04:44:23PM -0700, davidri...@chromium.org wrote: > From: David Riley > > After data is copied to the cache entry, atomic_set is used indicate > that the data is the entry is valid without appropriate memory barriers. > Similarly the read side was missing the same memory

Re: PROBLEM: VirtIO DRM driver crashes when setting specific 16.16 fixed-point property values

2019-05-27 Thread Gerd Hoffmann
On Fri, May 24, 2019 at 02:46:50PM -0400, Tyler Slabinski wrote: > VirtIO DRM driver crashes when setting specific 16.16 fixed-point > property values > > When running a virtual machine with a VirtIO GPU, it's possible to > crash the entire VM by setting the value of a 16.16 fixed-point >

[PATCH 3/4] drm/virtio: simplify cursor updates

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

[PATCH 1/4] drm/virtio: pass gem reservation object to ttm init

2019-06-17 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 --- drivers/gpu/drm/virtio/virtgpu_object.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm

[PATCH 4/4] drm/virtio: remove virtio_gpu_object_wait

2019-06-17 Thread Gerd Hoffmann
No users left. Signed-off-by: Gerd Hoffmann --- 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/virtgpu_drv.h index

[PATCH 2/4] drm/virtio: switch virtio_gpu_wait_ioctl() to gem helper.

2019-06-17 Thread Gerd Hoffmann
Use drm_gem_reservation_object_wait() in virtio_gpu_wait_ioctl(). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 18 -- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio

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

2019-06-18 Thread Gerd Hoffmann
Call reservation_object_* directly instead of using ttm_bo_{reserve,unreserve}. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio

[PATCH v2 10/12] drm/virtio: switch from ttm to gem shmem helpers

2019-06-18 Thread Gerd Hoffmann
the fencing was sorted the switch was surprisingly easy and for the most part just removing the ttm code. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h| 52 +--- drivers/gpu/drm/virtio/virtgpu_drv.c| 20 +- drivers/gpu/drm/virtio/virtgpu_gem.c| 16 +- drivers/gpu/drm

[PATCH v2 08/12] drm/virtio: rework virtio_gpu_object_create fencing

2019-06-18 Thread Gerd Hoffmann
Use gem reservation helpers and direct reservation_object_* calls instead of ttm. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_object.c | 28 +++-- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_object.c b

[PATCH v2 12/12] drm/virtio: remove virtio_gpu_alloc_object

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

[PATCH v2 11/12] drm/virtio: rework virtio_gpu_object_create fencing even more.

2019-06-18 Thread Gerd Hoffmann
add the fence to the bo's reservation object beforehand. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_object.c | 27 + 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_object.c b/drivers/gpu/drm/virtio

[PATCH v2 04/12] drm/virtio: remove virtio_gpu_object_wait

2019-06-18 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 v2 09/12] drm/virtio: drop virtio_gpu_object_list_validate/virtio_gpu_unref_list

2019-06-18 Thread Gerd Hoffmann
No users left. Signed-off-by: Gerd Hoffmann --- 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/virtio/virtgpu_drv.h

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

2019-06-18 Thread Gerd Hoffmann
Use drm_gem_reservation_object_wait() in virtio_gpu_wait_ioctl(). This also makes the ioctl run lockless. Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel Vetter --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 24 ++-- 1 file changed, 10 insertions(+), 14 deletions(-) diff

[PATCH v2 03/12] drm/virtio: simplify cursor updates

2019-06-18 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 v2 05/12] drm/virtio: drop no_wait argument from virtio_gpu_object_reserve

2019-06-18 Thread Gerd Hoffmann
All callers pass no_wait = false. Signed-off-by: Gerd Hoffmann --- 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(-) diff --git a/drivers/gpu/drm

[PATCH v2 07/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing

2019-06-18 Thread Gerd Hoffmann
Use gem reservation helpers and direct reservation_object_* calls instead of ttm. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 36 -- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b

[PATCH v2 01/12] drm/virtio: pass gem reservation object to ttm init

2019-06-18 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

Re: [PATCH 3/4] drm/virtio: simplify cursor updates

2019-06-18 Thread Gerd Hoffmann
> Even nicer would be to add the fence using > drm_atomic_set_fence_for_plane() in the prepare_fb hook. Assuming this > isn't necessary for correctness (but then I kinda have questions about > races and stuff). I'll have a look. Maybe this way I can drop struct virtio_gpu_framebuffer (where the

Re: [PATCH v2 4/4] drm/virtio: Add memory barriers for capset cache.

2019-06-13 Thread Gerd Hoffmann
On Mon, Jun 10, 2019 at 02:18:10PM -0700, davidri...@chromium.org wrote: > From: David Riley > > After data is copied to the cache entry, atomic_set is used indicate > that the data is the entry is valid without appropriate memory barriers. > Similarly the read side was missing the corresponding

Re: [PATCH 12/13] drm/virtio: drop DRM_AUTH usage from the driver

2019-06-13 Thread Gerd Hoffmann
he driver POV there is no distinction between primary and render > > nodes, thus we can drop the token. > > > > Cc: Gerd Hoffmann > > Cc: virtualization@lists.linux-foundation.org > > Cc: David Airlie > > Cc: Daniel Vetter > > Signed-off-by: Emil Velikov A

Re: [PATCH v3 08/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing

2019-06-20 Thread Gerd Hoffmann
Hi, > Also, I strongly recommend you do a very basic igt to exercise this, i.e. > allocate some buffers, submit them in a dummby op, then close the entire > drmfd. The old version should at least have tripped over kasan, maybe even > oopses somewhere. Hmm, I suspect I have to extend igt for

[PATCH v4 07/12] drm/virtio: add virtio_gpu_object_array & helpers

2019-06-20 Thread Gerd Hoffmann
Some helper functions to manage an array of gem objects. v4: make them virtio-private instead of generic helpers. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 10 ++ drivers/gpu/drm/virtio/virtgpu_gem.c | 50 2 files changed, 60

[PATCH v4 04/12] drm/virtio: remove virtio_gpu_object_wait

2019-06-20 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 v4 11/12] drm/virtio: switch from ttm to gem shmem helpers

2019-06-20 Thread Gerd Hoffmann
the 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 v4 10/12] drm/virtio: drop virtio_gpu_object_list_validate/virtio_gpu_unref_list

2019-06-20 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 v4 01/12] drm/virtio: pass gem reservation object to ttm init

2019-06-20 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 v4 02/12] drm/virtio: switch virtio_gpu_wait_ioctl() to gem helper.

2019-06-20 Thread Gerd Hoffmann
Use drm_gem_reservation_object_wait() in virtio_gpu_wait_ioctl(). This also makes the ioctl run lockless. v2: use reservation_object_test_signaled_rcu for VIRTGPU_WAIT_NOWAIT. Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel Vetter --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 24

[PATCH v4 05/12] drm/virtio: drop no_wait argument from virtio_gpu_object_reserve

2019-06-20 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 v4 03/12] drm/virtio: simplify cursor updates

2019-06-20 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 v4 06/12] drm/virtio: remove ttm calls from in virtio_gpu_object_{reserve, unreserve}

2019-06-20 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 v4 12/12] drm/virtio: remove virtio_gpu_alloc_object

2019-06-20 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 3/3] drm: drop DEFINE_DRM_GEM_SHMEM_FOPS

2019-06-20 Thread Gerd Hoffmann
DEFINE_DRM_GEM_SHMEM_FOPS is identical to DEFINE_DRM_GEM_FOPS now, drop it. Signed-off-by: Gerd Hoffmann --- include/drm/drm_gem_shmem_helper.h | 26 - drivers/gpu/drm/cirrus/cirrus.c | 2 +- drivers/gpu/drm/panfrost/panfrost_drv.c | 2 +- drivers/gpu/drm

[PATCH 5/6] drm/ttm: use gem vma_node

2019-06-20 Thread Gerd Hoffmann
Drop vma_node from ttm_buffer_object, use the gem struct (base.vma_node) instead. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 2 +- drivers/gpu/drm/qxl/qxl_object.h | 2 +- drivers/gpu/drm/radeon/radeon_object.h | 2 +- drivers/gpu/drm/virtio

[PATCH 3/6] drm/qxl: use embedded gem object

2019-06-20 Thread Gerd Hoffmann
Drop drm_gem_object from qxl_bo, use the ttm_buffer_object.base instead. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.h | 6 +++--- drivers/gpu/drm/qxl/qxl_object.h | 4 ++-- drivers/gpu/drm/qxl/qxl_cmd.c | 4 ++-- drivers/gpu/drm/qxl/qxl_debugfs.c | 2 +- drivers

[PATCH v4 08/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing

2019-06-20 Thread Gerd Hoffmann
don't. Signed-off-by: Gerd Hoffmann Acked-by: Daniel Vetter --- drivers/gpu/drm/virtio/virtgpu_drv.h | 5 ++- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 62 +++--- drivers/gpu/drm/virtio/virtgpu_vq.c| 16 --- 3 files changed, 40 insertions(+), 43 deletions(-) diff --git

[PATCH v4 09/12] drm/virtio: rework virtio_gpu_object_create fencing

2019-06-20 Thread Gerd Hoffmann
simply fence our object before submitting the virtio command and be done with it. Signed-off-by: Gerd Hoffmann Acked-by: Daniel Vetter --- drivers/gpu/drm/virtio/virtgpu_drv.h| 6 ++- drivers/gpu/drm/virtio/virtgpu_object.c | 54 + drivers/gpu/drm/virtio/virtgpu_vq.c

[PATCH v3 08/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing

2019-06-19 Thread Gerd Hoffmann
don't. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 6 ++- drivers/gpu/drm/drm_gem_array_helper.c | 2 + drivers/gpu/drm/virtio/virtgpu_ioctl.c | 62 +++--- drivers/gpu/drm/virtio/virtgpu_vq.c| 16 --- 4 files changed, 43 insertions(+), 43

[PATCH v3 09/12] drm/virtio: rework virtio_gpu_object_create fencing

2019-06-19 Thread Gerd Hoffmann
simply fence our object before submitting the virtio command and be done with it. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h| 6 ++- drivers/gpu/drm/virtio/virtgpu_object.c | 54 + drivers/gpu/drm/virtio/virtgpu_vq.c | 8 +++- 3 files

[PATCH v3 10/12] drm/virtio: drop virtio_gpu_object_list_validate/virtio_gpu_unref_list

2019-06-19 Thread Gerd Hoffmann
No users left. Signed-off-by: Gerd Hoffmann --- 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/virtio/virtgpu_drv.h

[PATCH v3 03/12] drm/virtio: switch virtio_gpu_wait_ioctl() to gem helper.

2019-06-19 Thread Gerd Hoffmann
Use drm_gem_reservation_object_wait() in virtio_gpu_wait_ioctl(). This also makes the ioctl run lockless. v2: use reservation_object_test_signaled_rcu for VIRTGPU_WAIT_NOWAIT. Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel Vetter --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 24

[PATCH v3 07/12] drm/virtio: remove ttm calls from in virtio_gpu_object_{reserve, unreserve}

2019-06-19 Thread Gerd Hoffmann
Call reservation_object_* directly instead of using ttm_bo_{reserve,unreserve}. 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 --git a/drivers/gpu/drm

[PATCH v3 05/12] drm/virtio: remove virtio_gpu_object_wait

2019-06-19 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 v3 11/12] drm/virtio: switch from ttm to gem shmem helpers

2019-06-19 Thread Gerd Hoffmann
the fencing was sorted the switch was surprisingly easy and for the most part just removing the ttm code. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h| 52 +--- drivers/gpu/drm/virtio/virtgpu_drv.c| 20 +- drivers/gpu/drm/virtio/virtgpu_gem.c| 16 +- drivers/gpu/drm

[PATCH v3 02/12] drm/virtio: pass gem reservation object to ttm init

2019-06-19 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 v3 04/12] drm/virtio: simplify cursor updates

2019-06-19 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 v3 12/12] drm/virtio: remove virtio_gpu_alloc_object

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

[PATCH v3 06/12] drm/virtio: drop no_wait argument from virtio_gpu_object_reserve

2019-06-19 Thread Gerd Hoffmann
All callers pass no_wait = false. Signed-off-by: Gerd Hoffmann --- 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(-) diff --git a/drivers/gpu/drm

[PATCH v2 08/18] drm/ttm: use gem vma_node

2019-06-21 Thread Gerd Hoffmann
Drop vma_node from ttm_buffer_object, use the gem struct (base.vma_node) instead. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 2 +- drivers/gpu/drm/qxl/qxl_object.h | 2 +- drivers/gpu/drm/radeon/radeon_object.h | 2 +- drivers/gpu/drm/virtio

[PATCH v2 03/18] drm/qxl: use embedded gem object

2019-06-21 Thread Gerd Hoffmann
Drop drm_gem_object from qxl_bo, use the ttm_buffer_object.base instead. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.h | 6 +++--- drivers/gpu/drm/qxl/qxl_object.h | 4 ++-- drivers/gpu/drm/qxl/qxl_cmd.c | 4 ++-- drivers/gpu/drm/qxl/qxl_debugfs.c | 2 +- drivers

[PATCH v2 17/18] drm/virtio: switch driver from bo->resv to bo->base.resv

2019-06-21 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 4 ++-- drivers/gpu/drm/virtio/virtgpu_plane.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c index ac60be9b5c19

[PATCH v2 16/18] drm/qxl: switch driver from bo->resv to bo->base.resv

2019-06-21 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_debugfs.c | 2 +- drivers/gpu/drm/qxl/qxl_release.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_debugfs.c b/drivers/gpu/drm/qxl/qxl_debugfs.c index 013b938986c7..f30460782f05 100644

Re: [PATCH 37/59] drm/virtio: Drop drm_gem_prime_export/import

2019-06-17 Thread Gerd Hoffmann
On Fri, Jun 14, 2019 at 10:35:53PM +0200, Daniel Vetter wrote: > They're the default. > > Aside: Would be really nice to switch the others over to > drm_gem_object_funcs. > > Signed-off-by: Daniel Vetter > Cc: David Airlie > Cc: Gerd Hoffmann > Cc: virtualization

Re: [PATCH 25/59] drm/qxl: Drop drm_gem_prime_export/import

2019-06-17 Thread Gerd Hoffmann
On Fri, Jun 14, 2019 at 10:35:41PM +0200, Daniel Vetter wrote: > They're the default. > > Aside: Would be really nice to switch the others over to > drm_gem_object_funcs. > > Signed-off-by: Daniel Vetter > Cc: Dave Airlie > Cc: Gerd Hoffmann > Cc: virtualization

Re: [EXTERNAL] Re: [PATCH 1/1] drm/bochs: Fix connector leak during driver unload

2019-06-16 Thread Gerd Hoffmann
On Mon, Jun 17, 2019 at 11:20:34AM +1000, Sam Bobroff wrote: > On Tue, May 21, 2019 at 10:10:29AM +0200, Gerd Hoffmann wrote: > > Hi, > > > > The bug is in the driver, so ... > > > > > Bisecting the issue for commits to drivers/gpu/drm/bochs/ points to: &g

[PATCH] drm/cirrus: remove leftover files

2019-05-22 Thread Gerd Hoffmann
cirrus_drv.h and cirrus_ttm.c are unused since commit ab3e023b1b4c ("drm/cirrus: rewrite and modernize driver"), apparently I ran "rm" instead of "git rm" on them so they are still in present the tree. Signed-off-by: Gerd Hoffmann --- drivers/gpu

[PATCH] drm/qxl: drop WARN_ONCE()

2019-05-24 Thread Gerd Hoffmann
There is no good reason to flood the kernel log with a WARN stacktrace just because someone tried to mmap a prime buffer. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_prime.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/qxl/qxl_prime.c b/drivers/gpu/drm/qxl

Re: [PATCH] drm/cirrus: remove leftover files

2019-05-23 Thread Gerd Hoffmann
On Wed, May 22, 2019 at 05:06:34PM +0200, Sam Ravnborg wrote: > On Wed, May 22, 2019 at 12:33:07PM +0200, Gerd Hoffmann wrote: > > cirrus_drv.h and cirrus_ttm.c are unused since commit ab3e023b1b4c > > ("drm/cirrus: rewrite and modernize driver"), apparently I ran &q

Re: [PATCH 2/4] drm/virtio: remove irrelevant DRM_UNLOCKED flag

2019-05-23 Thread Gerd Hoffmann
On Wed, May 22, 2019 at 04:47:00PM +0100, Emil Velikov wrote: > From: Emil Velikov > > DRM_UNLOCKED doesn't do anything for non-legacy drivers. Remove it. Patch applied to drm-misc-next. thanks, Gerd ___ Virtualization mailing list

Re: [PATCH 1/2] drm: Add drm_gem_vram_{pin/unpin}_reserved() and convert mgag200

2019-05-21 Thread Gerd Hoffmann
Hi, > I think would be good to have a lockdep_assert_held here for the ww_mutex. > > Also general thing: _reserved is kinda ttm lingo, for dma-buf reservations > we call the structure tracking the fences+lock the "reservation", but the > naming scheme used is _lock/_unlock. > > I think would

Re: [PATCH 1/1] drm/bochs: Fix connector leak during driver unload

2019-05-21 Thread Gerd Hoffmann
Hi, The bug is in the driver, so ... > Bisecting the issue for commits to drivers/gpu/drm/bochs/ points to: > 6579c39594ae ("drm/bochs: atomic: switch planes to atomic, wire up helpers.") > ... but the issue also seems to be due to a change in the generic drm code ... this one is the culprit

Re: [Spice-devel] [PATCH] Revert "drm/qxl: drop prime import/export callbacks"

2019-04-29 Thread Gerd Hoffmann
On Fri, Apr 26, 2019 at 04:21:37PM +0200, Daniel Vetter wrote: > On Fri, Apr 26, 2019 at 7:33 AM Gerd Hoffmann wrote: > > > > This reverts commit f4c34b1e2a37d5676180901fa6ff188bcb6371f8. > > > > Simliar to commit a0cecc23cfcb Revert "drm/virtio: drop prime > &

Re: Xorg hangs in kernelspace with qxl

2019-05-01 Thread Gerd Hoffmann
On Wed, May 01, 2019 at 12:47:48AM +0300, Jaak Ristioja wrote: > Hello! > > I'm experiencing the following task hangs at least 2-3 times a day when > using a Kubuntu desktop in KVM via a SPICE client. This has occurred > with the stock kernels in Kubuntu since Kubuntu 18.04. This makes the VM >

Re: [Spice-devel] [PATCH] Revert "drm/qxl: drop prime import/export callbacks"

2019-04-29 Thread Gerd Hoffmann
Hi, > > More useful would be some way to signal this self-reimport capability > > to userspace somehow. See DRM_PRIME_CAP_LOCAL patch. > > Userspace is supposed to test whether import/export works for a > specific combo, not blindly assume it does and then keel over. I think > we need to fix

Re: [PATCH] drm/virtio: Remove redundant return type

2019-05-06 Thread Gerd Hoffmann
On Fri, May 03, 2019 at 06:38:04PM +0200, Robert Foss wrote: > virtio_gpu_fence_emit() always returns 0, since it > has no error paths. > > Consequently no calls for virtio_gpu_fence_emit() > use the return value, and it can be removed. > > Signed-off-by: Robert Foss > Suggested-by: Emil

Re: [PATCH v4 00/19] Share TTM code among DRM framebuffer drivers

2019-05-06 Thread Gerd Hoffmann
> GEM VRAM could implement PRIME helpers, which would allow for using > the generic fbcon. bochs_gem_prime_*() functions with this series applied look like you can just rename them & move over to vram helpers. It's not a full prime implementation, specifically actual export/import isn't there.

Re: [PATCH v4 01/19] drm: Add |struct drm_gem_vram_object| and helpers

2019-05-06 Thread Gerd Hoffmann
Hi, > This misses the call to drm_gem_vram_placement(), where > drm_gem_vram_push_to_system() enforces placement in system memory. Ah, missed that detail. > We > could build a common implementation out of both interfaces, but that > would obfuscate the code IMHO. I'd just leave it as it is.

Re: [PATCH v2] drm/virtio: Remove redundant return type

2019-05-06 Thread Gerd Hoffmann
On Mon, May 06, 2019 at 11:10:34AM +0200, Robert Foss wrote: > virtio_gpu_fence_emit() always returns 0, since it > has no error paths. > > Consequently no calls for virtio_gpu_fence_emit() > use the return value, and it can be removed. > > Signed-off-by: Robert Foss > Suggested-by: Emil

Re: [PATCH v4 01/19] drm: Add |struct drm_gem_vram_object| and helpers

2019-05-06 Thread Gerd Hoffmann
> +/** > + * drm_gem_vram_unpin() - Unpins a GEM VRAM object > + * @gbo: the GEM VRAM object > + * > + * Returns: > + * 0 on success, or > + * a negative error code otherwise. > + */ > +int drm_gem_vram_unpin(struct drm_gem_vram_object *gbo) > +{ > + int i, ret; > + struct

Re: [PATCH v4 12/19] drm/bochs: Convert bochs driver to VRAM MM

2019-05-06 Thread Gerd Hoffmann
Hi, > static const struct file_operations bochs_fops = { > .owner = THIS_MODULE, > - .open = drm_open, > - .release= drm_release, > - .unlocked_ioctl = drm_ioctl, > - .compat_ioctl = drm_compat_ioctl, > - .poll = drm_poll, > -

Re: [PATCH v4 00/19] Share TTM code among DRM framebuffer drivers

2019-05-06 Thread Gerd Hoffmann
On Mon, May 06, 2019 at 10:26:30AM +0200, Thomas Zimmermann wrote: > Several simple framebuffer drivers copy most of the TTM code from each > other. The implementation is always the same; except for the name of > some data structures. > > As recently discussed, this patch set provides generic

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