Re: [PATCH 1/2] drm: allow limiting the scatter list size.

2020-08-18 Thread Gerd Hoffmann
Hi, > > > I'm missing an explanation why this should be useful (it certainly is). > > virtio-gpu needs this to work properly with SEV (see patch 2/2 of this > > series). > > Yeah, that's the problem patch 2/2 never showed up here :) The list should have everything. Your inbox probably has 1/2

Re: [PATCH 1/2] drm: allow limiting the scatter list size.

2020-08-18 Thread Gerd Hoffmann
On Tue, Aug 18, 2020 at 09:57:59AM +0200, Christian König wrote: > Am 18.08.20 um 09:48 schrieb Gerd Hoffmann: > > Add max_segment argument to drm_prime_pages_to_sg(). When set pass it > > through to the __sg_alloc_table_from_pages() call, otherwise use > > SCATTERLIST_MAX_S

[PATCH 1/2] drm: allow limiting the scatter list size.

2020-08-18 Thread Gerd Hoffmann
Add max_segment argument to drm_prime_pages_to_sg(). When set pass it through to the __sg_alloc_table_from_pages() call, otherwise use SCATTERLIST_MAX_SEGMENT. Also add max_segment field to gem objects and pass it to drm_prime_pages_to_sg() calls in drivers and helpers. Signed-off-by: Gerd

[PATCH 2/2] drm/virtio: set max_segment

2020-08-18 Thread Gerd Hoffmann
When initializing gem objects call virtio_max_dma_size() to figure the scatter list limit. Needed to make virtio-gpu work properly with SEV. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_object.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/virtio

[PATCH 2/2] drm/virtio: drop virtio_gpu_output->enabled

2020-08-18 Thread Gerd Hoffmann
Not needed, already tracked by drm_crtc_state->active. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 1 - drivers/gpu/drm/virtio/virtgpu_display.c | 4 drivers/gpu/drm/virtio/virtgpu_plane.c | 2 +- 3 files changed, 1 insertion(+), 6 deletions(-) diff --

[PATCH 1/2] drm/virtio: fix unblank

2020-08-18 Thread Gerd Hoffmann
c_needs_modeset() (Daniel). Cc: 1882...@bugs.launchpad.net Fixes: 3954ff10e06e ("drm/virtio: skip set_scanout if framebuffer didn't change") Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 1 + drivers/gpu/drm/virtio/virtgpu_display.c | 11 +

Re: [PATCH v6 0/3] Support virtio cross-device resources

2020-08-17 Thread Gerd Hoffmann
On Tue, Aug 18, 2020 at 10:37:41AM +0900, David Stevens wrote: > This patchset implements the current proposal for virtio cross-device > resource sharing [1]. It will be used to import virtio resources into > the virtio-video driver currently under discussion [2]. The patch > under consideration to

Re: [virtio-dev] Re: [PATCH v5 0/3] Support virtio cross-device resources

2020-08-17 Thread Gerd Hoffmann
On Mon, Aug 17, 2020 at 12:50:08PM +0200, Gerd Hoffmann wrote: > On Tue, Jun 23, 2020 at 10:31:28AM +0900, David Stevens wrote: > > Unless there are any remaining objections to these patches, what are > > the next steps towards getting these merged? Sorry, I'm not familiar &

Re: [PATCH] drm/qxl: Replace deprecated function in qxl_display

2020-08-17 Thread Gerd Hoffmann
On Sun, May 24, 2020 at 11:26:23AM +0900, Sidong Yang wrote: > Hi, Dave. > > This is resended e-mail for your advice. > > I'm a newbie interested in linux kernel and qxl module. > Please check this patch and give me advice for me. > Also I'll be glad if there is any task that you bothered. > Than

Re: [virtio-dev] Re: [PATCH v5 0/3] Support virtio cross-device resources

2020-08-17 Thread Gerd Hoffmann
On Tue, Jun 23, 2020 at 10:31:28AM +0900, David Stevens wrote: > Unless there are any remaining objections to these patches, what are > the next steps towards getting these merged? Sorry, I'm not familiar > with the workflow for contributing patches to Linux. Sorry, just have been busy and not pay

Re: [PATCH][next] drm/virtio: Use struct_size() helper in kmalloc()

2020-08-17 Thread Gerd Hoffmann
On Wed, Jun 17, 2020 at 04:57:07PM -0500, Gustavo A. R. Silva wrote: > Make use of the struct_size() helper instead of an open-coded version > in order to avoid any potential type mistakes. > > This code was detected with the help of Coccinelle and, audited and > fixed manually. > > Signed-off-by

Re: [PATCH] drm/virtio: fix unblank

2020-08-17 Thread Gerd Hoffmann
On Mon, Aug 17, 2020 at 11:03:42AM +0200, Gerd Hoffmann wrote: > Hi, > > > > --- a/drivers/gpu/drm/virtio/virtgpu_display.c > > > +++ b/drivers/gpu/drm/virtio/virtgpu_display.c > > > @@ -100,6 +100,7 @@ static void virtio_gpu_crtc_atomic_enable(struct >

Re: [PATCH] drm/virtgpu: remove redundant assignments to width and height

2020-08-17 Thread Gerd Hoffmann
On Wed, Jul 01, 2020 at 02:41:54PM +0100, Colin King wrote: > From: Colin Ian King > > Variables width and height are being assigned values that are never > read. The assignments are redundant and can be removed. > > Addresses-Coverity: ("Unused value") > Signed-off-by: Colin Ian King Pused to

Re: [PATCH] drm/virtio: fix unblank

2020-08-17 Thread Gerd Hoffmann
Hi, > > --- a/drivers/gpu/drm/virtio/virtgpu_display.c > > +++ b/drivers/gpu/drm/virtio/virtgpu_display.c > > @@ -100,6 +100,7 @@ static void virtio_gpu_crtc_atomic_enable(struct > > drm_crtc *crtc, > > struct virtio_gpu_output *output = drm_crtc_to_virtio_gpu_output(crtc); > > > > ou

Re: [PATCH] drm/virtio: fix memory leak in virtio_gpu_cleanup_object()

2020-08-07 Thread Gerd Hoffmann
On Wed, Jul 22, 2020 at 01:18:51PM +0800, Xin He wrote: > Before setting shmem->pages to NULL, kfree() should > be called. > sg_free_table(shmem->pages); > + kfree(shmem->pages); > shmem->pages = NULL; Pushed to drm-misc-fixes. than

Re: [PATCH v3] drm/virtio: fix missing dma_fence_put() in virtio_gpu_execbuffer_ioctl()

2020-08-07 Thread Gerd Hoffmann
On Tue, Jul 21, 2020 at 06:16:47PM +0800, Xin He wrote: > From: Qi Liu > > We should put the reference count of the fence after calling > virtio_gpu_cmd_submit(). So add the missing dma_fence_put(). > virtio_gpu_cmd_submit(vgdev, buf, exbuf->size, > vfpriv->ctx_

Re: [PATCH v3 10/38] virtio_gpu: correct tags for config space fields

2020-08-07 Thread Gerd Hoffmann
On Wed, Aug 05, 2020 at 09:43:42AM -0400, Michael S. Tsirkin wrote: > Since gpu is a modern-only device, > tag config space fields as having little endian-ness. > > Signed-off-by: Michael S. Tsirkin > Reviewed-by: Cornelia Huck Reviewed-by: Gerd Hoffmann

Re: [PATCH v3 34/38] drm/virtio: convert to LE accessors

2020-08-07 Thread Gerd Hoffmann
On Wed, Aug 05, 2020 at 09:44:48AM -0400, Michael S. Tsirkin wrote: > Virtgpu is modern-only. Use LE accessors for config space. > > Signed-off-by: Michael S. Tsirkin Reviewed-by: Gerd Hoffmann

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

2020-08-07 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 --

[PATCH] drm/virtio: fix unblank

2020-08-07 Thread Gerd Hoffmann
chpad.net Fixes: 3954ff10e06e ("drm/virtio: skip set_scanout if framebuffer didn't change") Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 1 + drivers/gpu/drm/virtio/virtgpu_display.c | 1 + drivers/gpu/drm/virtio/virtgpu_plane.c | 4 +++- 3 files change

Re: [PATCH v2 11/24] virtio_input: correct tags for config space fields

2020-08-03 Thread Gerd Hoffmann
+ __le32 res; > }; > > struct virtio_input_devids { > - __u16 bustype; > - __u16 vendor; > - __u16 product; > - __u16 version; > + __le16 bustype; > + __le16 vendor; > + __le16 product; > + __le16 version; > }; > > struct virtio_input_config { > -- > MST Reviewed-by: Gerd Hoffmann

[PATCH] drm/virtio: fix unblank

2020-06-12 Thread Gerd Hoffmann
uffer didn't change") Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 1 + drivers/gpu/drm/virtio/virtgpu_display.c | 1 + drivers/gpu/drm/virtio/virtgpu_plane.c | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/virtio/v

Re: [PATCH v4 0/3] Support virtio cross-device resources

2020-05-28 Thread Gerd Hoffmann
On Tue, May 26, 2020 at 07:58:08PM +0900, David Stevens wrote: > This patchset implements the current proposal for virtio cross-device > resource sharing [1]. It will be used to import virtio resources into > the virtio-video driver currently under discussion [2]. The patch > under consideration to

Re: [PATCH v5 30/38] dmabuf: fix common struct sg_table related issues

2020-05-15 Thread Gerd Hoffmann
ection direction) > { > - dma_unmap_sg(dev, sg->sgl, sg->nents, direction); > + dma_unmap_sgtable(dev, sg, direction, 0); > sg_free_table(sg); > kfree(sg); > } Easy straightforward conversation. Acked-by: Gerd Hoffmann take care, Gerd

Re: [PATCH v5 25/38] drm: virtio: fix common struct sg_table related issues

2020-05-15 Thread Gerd Hoffmann
le. This, almost always, hides references to the > nents and orig_nents entries, making the code robust, easier to follow > and copy/paste safe. Looks all sane. Acked-by: Gerd Hoffmann take care, Gerd

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

2020-05-14 Thread Gerd Hoffmann
Hi, > - for the runtime upcasting the usual approach is to check the ->ops > pointer. Which means that would need to be the same for all virtio > dma_bufs, which might get a bit awkward. But I'd really prefer we not > add allocator specific stuff like this to dma-buf. This is exactly the proble

Re: [PATCH 1/1] drm/qxl: add mutex_lock/mutex_unlock to ensure the order in which resources are rele

2020-04-29 Thread Gerd Hoffmann
Hi, > > The only way I see for this to happen is that the guest is preempted > > between qxl_push_{cursor,command}_ring_release() and > > qxl_release_fence_buffer_objects() calls. The host can complete the qxl > > command then, signal the guest, and the IRQ handler calls > > qxl_release_free_li

[PATCH v2 3/3] drm/virtio: factor out virtio_gpu_update_dumb_bo

2019-10-22 Thread Gerd Hoffmann
No functional change. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_plane.c | 36 +++--- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c index 0b5a760bc293

[PATCH v2 1/3] drm/virtio: fix byteorder handling in virtio_gpu_cmd_transfer_{from,to}_host_3d functions

2019-10-22 Thread Gerd Hoffmann
Be consistent with the rest of the code base. No functional change. v2: - fix sparse warnings for virtio_gpu_cmd_transfer_to_host_2d call. - move convert_to_hw_box helper function. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 5 +++-- drivers/gpu/drm/virtio

[PATCH 1/5] drm/qxl: drop qxl_ttm_fault

2019-10-17 Thread Gerd Hoffmann
Not sure what this hook is supposed to do. vmf->vma->vm_private_data should never be NULL, so the extra check in qxl_ttm_fault should have no effect. Drop it. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_ttm.c | 27 +-- 1 file changed, 1 insertion(

[PATCH v2] drm: tweak drm_print_bits()

2019-09-22 Thread Gerd Hoffmann
There is little reason for the from/to logic, printing a subset of the bits can be done by simply shifting/masking value if needed. Also use for_each_set_bit(). Suggested-by: Jani Nikula Signed-off-by: Gerd Hoffmann Reviewed-by: Jani Nikula --- include/drm/drm_print.h | 5

[PATCH v3 04/11] drm/shmem: drop VM_IO

2019-09-19 Thread Gerd Hoffmann
VM_IO is wrong here, shmem uses normal ram not io memory. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/drm_gem_shmem_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index

[PATCH v3 07/11] drm/ttm: rename ttm_fbdev_mmap

2019-09-19 Thread Gerd Hoffmann
Rename ttm_fbdev_mmap to ttm_bo_mmap_obj. Move the vm_pgoff sanity check to amdgpu_bo_fbdev_mmap (only ttm_fbdev_mmap user in tree). The ttm_bo_mmap_obj function can now be used to map any buffer object. This allows to implement &drm_gem_object_funcs.mmap in gem ttm helpers. Signed-off-by:

linux-kernel@vger.kernel.org

2019-09-19 Thread Gerd Hoffmann
Wire up the new drm_gem_ttm_mmap() helper function, use generic drm_gem_mmap for &fops.mmap and delete dead drm_vram_mm_file_operations_mmap(). Signed-off-by: Gerd Hoffmann Reviewed-by: Thomas Zimmermann --- include/drm/drm_gem_vram_helper.h | 9 +-- drivers/gpu

[PATCH v3 06/11] drm/ttm: factor out ttm_bo_mmap_vma_setup

2019-09-19 Thread Gerd Hoffmann
Factor out ttm vma setup to a new function. Reduces code duplication a bit. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/ttm/ttm_bo_vm.c | 46 + 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo_vm.c b/drivers/gpu/drm

[PATCH v2 04/11] drm/shmem: drop VM_IO

2019-09-17 Thread Gerd Hoffmann
VM_IO is wrong here, shmem uses normal ram not io memory. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/drm_gem_shmem_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index

[PATCH v2 07/11] drm/ttm: drop VM_DONTDUMP

2019-09-17 Thread Gerd Hoffmann
Not obvious why this is needed. According to Deniel Vetter this is most likely a historic artefact dating back to the days where drm drivers exposed hardware registers as mmap'able gem objects, to avoid dumping touching those registers. Signed-off-by: Gerd Hoffmann --- drivers/gpu/dr

[PATCH v2 08/11] drm/ttm: add drm_gem_ttm_mmap()

2019-09-17 Thread Gerd Hoffmann
Add helper function to mmap ttm bo's using &drm_gem_object_funcs.mmap(). Note that with this code path access verification is done by drm_gem_mmap() (which calls drm_vma_node_is_allowed(()). The &ttm_bo_driver.verify_access() callback is is not used. Signed-off-by: Gerd Hoffmann

[PATCH v2 10/11] drm/vram: drop verify_access

2019-09-17 Thread Gerd Hoffmann
Not needed any more. Signed-off-by: Gerd Hoffmann Reviewed-by: Thomas Zimmermann --- drivers/gpu/drm/drm_gem_vram_helper.c | 22 -- 1 file changed, 22 deletions(-) diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c index

Re: [PATCH 4/8] drm/ttm: factor out ttm_bo_mmap_vma_setup

2019-09-17 Thread Gerd Hoffmann
On Fri, Sep 13, 2019 at 02:56:09PM +0200, Thomas Zimmermann wrote: > Hi > > Am 13.09.19 um 14:29 schrieb Gerd Hoffmann: > > Factor out ttm vma setup to a new function. Reduces > > code duplication a bit and allows to implement > > &drm_gem_object_funcs.mmap in g

Re: [PATCH 3/8] drm/shmem: drop DEFINE_DRM_GEM_SHMEM_FOPS

2019-09-17 Thread Gerd Hoffmann
On Mon, Sep 16, 2019 at 05:07:14PM -0500, Rob Herring wrote: > On Fri, Sep 13, 2019 at 7:29 AM Gerd Hoffmann wrote: > > > > Version? Pretty sure this is not v1. Yep, was posted as part of a longer series before. Splitted the long series into multiple smaller ones by cherry-picki

linux-kernel@vger.kernel.org

2019-09-13 Thread Gerd Hoffmann
Switch gem shmem helper to the new mmap() workflow, from &gem_driver.fops.mmap to &drm_gem_object_funcs.mmap. Signed-off-by: Gerd Hoffmann --- include/drm/drm_gem_shmem_helper.h | 6 ++ drivers/gpu/drm/drm_gem_shmem_helper.c | 26 - drivers/gpu/drm/

linux-kernel@vger.kernel.org

2019-09-13 Thread Gerd Hoffmann
Wire up the new drm_gem_ttm_mmap() helper function, use generic drm_gem_mmap for &fops.mmap and delete dead drm_vram_mm_file_operations_mmap(). Signed-off-by: Gerd Hoffmann --- include/drm/drm_gem_vram_helper.h | 9 +-- drivers/gpu/drm/drm_gem_vram_helper.c

[PATCH 8/8] drm/vram: drop DRM_VRAM_MM_FILE_OPERATIONS

2019-09-13 Thread Gerd Hoffmann
Not needed any more because we don't have vram specific fops any more. DEFINE_DRM_GEM_FOPS() can be used instead. Signed-off-by: Gerd Hoffmann --- include/drm/drm_gem_vram_helper.h | 18 include/drm/drm_vram_mm_helper.h | 82 +++ drivers/gp

[PATCH 7/8] drm/vram: drop verify_access

2019-09-13 Thread Gerd Hoffmann
Not needed any more. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/drm_gem_vram_helper.c | 22 -- 1 file changed, 22 deletions(-) diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c index e100b97ea6e3..42ee80414273 100644 --- a

[PATCH 5/8] drm/ttm: add drm_gem_ttm_mmap()

2019-09-13 Thread Gerd Hoffmann
Add helper function to mmap ttm bo's using &drm_gem_object_funcs.mmap(). Note that with this code path access verification is done by drm_gem_mmap() (which calls drm_vma_node_is_allowed(()). The &ttm_bo_driver.verify_access() callback is is not used. Signed-off-by: Gerd Hoffmann

Re: [PATCH v3 1/2] drm/virtio: Rewrite virtio_gpu_queue_ctrl_buffer using fenced version.

2019-09-10 Thread Gerd Hoffmann
On Tue, Sep 10, 2019 at 01:06:50PM -0700, David Riley wrote: > Factor function in preparation to generating scatterlist prior to locking. Patches are looking good now, but they don't apply. What tree was used to create them? Latest virtio-gpu driver bits are in drm-misc-next (see https://cgit.fr

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)

[PATCH v2 3/6] drm/vram: use drm_gem_ttm_print_info

2019-09-03 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Acked-by: Thomas Zimmermann --- drivers/gpu/drm/drm_gem_vram_helper.c | 4 +++- drivers/gpu/drm/Kconfig | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c

[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 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 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

[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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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

[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 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 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 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 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 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

Re: [PATCH v3 2/8] ttm: turn ttm_bo_device.vma_manager into a pointer

2019-08-08 Thread Gerd Hoffmann
On Thu, Aug 08, 2019 at 09:48:49AM +, Koenig, Christian wrote: > Am 08.08.19 um 11:36 schrieb Gerd Hoffmann: > > Rename the embedded struct vma_offset_manager, it is named _vma_manager > > now. ttm_bo_device.vma_manager is a pointer now, pointing to the > > embedded ttm_b

[PATCH v3 7/8] gem/vram: use drm_gem_ttm_bo_driver_verify_access()

2019-08-08 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- include/drm/drm_gem_vram_helper.h | 3 --- drivers/gpu/drm/drm_gem_vram_helper.c | 22 +- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/include/drm/drm_gem_vram_helper.h b/include/drm/drm_gem_vram_helper.h index

[PATCH v3 4/8] drm/vram: switch vram helpers to the new gem_ttm_bo_device_init()

2019-08-08 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- include/drm/drm_gem_vram_helper.h | 6 +-- drivers/gpu/drm/drm_gem_vram_helper.c | 48 --- drivers/gpu/drm/drm_vram_mm_helper.c | 6 +-- .../gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 1 - drivers/gpu/drm/Kconfig

[PATCH v2 2/3] drm/vram: switch vram helpers to use the new ttm helpers.

2019-08-07 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- include/drm/drm_gem_vram_helper.h | 7 +-- drivers/gpu/drm/drm_gem_vram_helper.c | 48 --- .../gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 2 +- drivers/gpu/drm/Kconfig | 1 + 4 files changed, 4

[PATCH v2 1/3] drm: add gem ttm helpers

2019-08-07 Thread Gerd Hoffmann
. Signed-off-by: Gerd Hoffmann --- include/drm/drm_gem_ttm_helper.h | 27 + drivers/gpu/drm/drm_gem_ttm_helper.c | 45 Documentation/gpu/drm-mm.rst | 12 drivers/gpu/drm/Kconfig | 7 + drivers/gpu/drm/Makefile

[PATCH v6 02/17] drm/vram: use embedded gem object

2019-08-05 Thread Gerd Hoffmann
Drop drm_gem_object from drm_gem_vram_object, use the ttm_buffer_object.base instead. Signed-off-by: Gerd Hoffmann Reviewed-by: Christian König Acked-by: Thomas Zimmermann --- include/drm/drm_gem_vram_helper.h | 3 +-- drivers/gpu/drm/ast/ast_main.c | 2 +- drivers

[PATCH v6 17/17] drm/ttm: drop ttm_buffer_object->resv

2019-08-05 Thread Gerd Hoffmann
All users moved to ttm_buffer_object->base.resv Signed-off-by: Gerd Hoffmann Reviewed-by: Christian König --- include/drm/ttm/ttm_bo_api.h | 1 - drivers/gpu/drm/ttm/ttm_bo.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h in

[PATCH v6 06/17] drm/nouveau: use embedded gem object

2019-08-05 Thread Gerd Hoffmann
Drop drm_gem_object from nouveau_bo, use the ttm_buffer_object.base instead. Build tested only. Signed-off-by: Gerd Hoffmann Acked-by: Christian König --- drivers/gpu/drm/nouveau/nouveau_bo.h | 5 - drivers/gpu/drm/nouveau/nouveau_gem.h | 2 +- drivers/gpu/drm/nouveau

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

2019-08-02 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 v7 14/18] drm/virtio: switch from ttm to gem shmem helpers

2019-08-02 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 v7 06/18] drm/virtio: remove ttm calls from in virtio_gpu_object_{reserve,unreserve}

2019-08-02 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

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

2019-07-04 Thread Gerd Hoffmann
> > + for (i = 0; i < nents; i++) { > > + objs->nents = i; > This line can be moved into the if-block just below. > > + objs->objs[i] = drm_gem_object_lookup(drm_file, handles[i]); > > + if (!objs->objs[i]) { > > + virtio_gpu_arr

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

2019-07-04 Thread Gerd Hoffmann
Hi, > > - r = ttm_bo_reserve(&bo->tbo, true, false, NULL); > > + r = reservation_object_lock_interruptible(bo->gem_base.resv, NULL); > Can you elaborate a bit about how TTM keeps the BOs alive in, for > example, virtio_gpu_transfer_from_host_ioctl? In that function, only > three TTM

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

2019-07-02 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 v6 11/18] drm/virtio: switch from ttm to gem shmem helpers

2019-07-02 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 v6 02/18] drm/virtio: switch virtio_gpu_wait_ioctl() to gem helper.

2019-07-02 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 v6 13/18] drm/virtio: drop virtio_gpu_object_{ref,unref}

2019-07-02 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 577a8103670e..78dc5a19a358 100644 --- a/drivers/gpu/drm

[PATCH v6 12/18] drm/virtio: remove virtio_gpu_alloc_object

2019-07-02 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 v6 16/18] drm/virtio: rework virtio_gpu_cmd_context_{attach,detach}_resource

2019-07-02 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 | 10 ++ 3 files changed, 19 insertions(+), 19

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

2019-07-02 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

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