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 1/2] drm/fb-helper: Synchronize dirty worker with vblank

2019-09-10 Thread Gerd Hoffmann
On Mon, Sep 09, 2019 at 04:06:32PM +0200, Thomas Zimmermann wrote: > Before updating the display from the console's shadow buffer, the dirty > worker now waits for vblank. This allows several screen updates to pile > up and acts as a rate limiter. > > Signed-off-by: Thomas Zimmermann > --- > dri

Re: [PATCH 2/2] drm/mgag200: Add vblank support

2019-09-10 Thread Gerd Hoffmann
On Mon, Sep 09, 2019 at 04:06:33PM +0200, Thomas Zimmermann wrote: > Support for vblank requires VSYNC to signal an interrupt, which is broken > on Matrox chipsets. The workaround that is used here and in other free > Matrox drivers is to program to the value of and > enable the VLINE interrupt.

Re: [PATCH 0/4] Merge VRAM MM and GEM VRAM source files

2019-09-10 Thread Gerd Hoffmann
VRAM memory manager to GEM VRAM implementation > drm/vram: Have VRAM MM call GEM VRAM functions directly > drm/vram: Unexport internal functions of VRAM MM > drm/vram: Unconditonally set BO call-back functions Looks all sane. Acked-by: Gerd Hoffmann cheers, Gerd

Re: [PATCH v4 05/17] drm: add mmap() to drm_gem_object_funcs

2019-09-09 Thread Gerd Hoffmann
Hi, > > + vma->vm_flags |= VM_IO | VM_PFNMAP | VM_DONTEXPAND | > > VM_DONTDUMP; > > + vma->vm_page_prot = > > pgprot_writecombine(vm_get_page_prot(vma->vm_flags)); > > + vma->vm_page_prot = pgprot_decrypted(vma->vm_page_prot); > > + } > > Totall

Re: [PATCH v4 0/4] Implement lazy unmapping for GEM VRAM buffers

2019-09-09 Thread Gerd Hoffmann
/dri-devel/2019-September/234308.html > > Thomas Zimmermann (4): > drm/vram: Add kmap ref-counting to GEM VRAM objects > drm/vram: Acquire lock only once per call to vmap()/vunmap() > drm/vram: Add infrastructure for move_notify() > drm/vram: Implement lazy unmapping for G

Re: [PATCH 8/8] drm/ttm: remove embedded vma_offset_manager

2019-09-09 Thread Gerd Hoffmann
On Mon, Sep 09, 2019 at 07:02:33AM +, Koenig, Christian wrote: > Am 05.09.19 um 09:05 schrieb Gerd Hoffmann: > > No users left. Drivers either setup vma_offset_manager themself > > (vmwgfx) or pass the gem vma_offset_manager to ttm_bo_device_init > > (all other drivers).

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 v4 05/17] drm: add mmap() to drm_gem_object_funcs

2019-09-06 Thread Gerd Hoffmann
I think with that > we'd have a really solid case to add this ->mmap hook. Looks easy on a quick glance. So something like the patch below (quick sketch, not tested yet other than compiling it)? cheers, Gerd From c13b30d776fb593a03473fa3bc93baf470cba728 Mon Sep 17 00:00:00 2001 From:

Re: [PATCH v3 3/3] drm/vram: Implement lazy unmapping for GEM VRAM buffers

2019-09-06 Thread Gerd Hoffmann
On Fri, Sep 06, 2019 at 12:37:47PM +0200, Thomas Zimmermann wrote: > Hi > > Am 06.09.19 um 11:39 schrieb Gerd Hoffmann: > >> +void drm_gem_vram_bo_driver_move_notify(struct ttm_buffer_object *bo, > >> + bool evict, > >> +

Re: [PATCH v3 3/3] drm/vram: Implement lazy unmapping for GEM VRAM buffers

2019-09-06 Thread Gerd Hoffmann
> +void drm_gem_vram_bo_driver_move_notify(struct ttm_buffer_object *bo, > + bool evict, > + struct ttm_mem_reg *new_mem) > +{ [ ... ] > + if (!kmap->virtual) > + return; > + ttm_bo_kunmap(kmap); > + kma

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: [PATCH v2 0/3] ast, mgag200: Map console BO while it's being displayed

2019-09-05 Thread Gerd Hoffmann
On Thu, Sep 05, 2019 at 10:19:40AM +0200, Thomas Zimmermann wrote: > Hi > > Am 05.09.19 um 09:56 schrieb Daniel Vetter: > > On Thu, Sep 5, 2019 at 9:01 AM Gerd Hoffmann wrote: > >> > >> Hi, > >> > >>> - imo we should fix this by using t

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

[PATCH 2/8] drm/nouveau: 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/nouveau/nouveau_ttm.c | 2 +- 1 file changed, 1

[PATCH 3/8] drm/vram: 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/drm_vram_mm_helper.c | 2 +- 1 file changed, 1

[PATCH 4/8] drm/radeon: 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/radeon/radeon_ttm.c | 2 +- 1 file changed, 1

[PATCH 0/8] drm/ttm: remove embedded vma_manager from ttm_bo_device

2019-09-05 Thread Gerd Hoffmann
Gerd Hoffmann (8): drm/ttm: turn ttm_bo_device.vma_manager into a pointer drm/nouveau: switch to gem vma offset manager drm/vram: switch to gem vma offset manager drm/radeon: switch to gem vma offset manager drm/amdgpu: switch to gem vma offset manager drm/qxl: switch to gem vma

[PATCH 7/8] drm/vmwgfx: switch to own vma manager

2019-09-05 Thread Gerd Hoffmann
Add struct drm_vma_offset_manager to vma_private, initialize it and pass it to ttm_bo_device_init(). With this in place the last user of ttm's embedded vma offset manager is gone and we can remove it (in a separate patch). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/vmwgfx/vmwgfx_

[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

[PATCH 5/8] drm/amdgpu: 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/amd/amdgpu/amdgpu_ttm.c | 2 +- 1 file changed, 1

[PATCH 8/8] drm/ttm: remove embedded vma_offset_manager

2019-09-05 Thread Gerd Hoffmann
No users left. Drivers either setup vma_offset_manager themself (vmwgfx) or pass the gem vma_offset_manager to ttm_bo_device_init (all other drivers). Signed-off-by: Gerd Hoffmann --- include/drm/ttm/ttm_bo_driver.h | 4 +--- drivers/gpu/drm/ttm/ttm_bo.c| 9 ++--- 2 files changed, 3

[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

Re: [PATCH v2 0/3] ast, mgag200: Map console BO while it's being displayed

2019-09-05 Thread Gerd Hoffmann
Hi, > - imo we should fix this by using the io_mapping stuff, that avoids > the overhead of repeated pat checks for map/unmap. Another idea: IIRC ttm has a move_notify callback. So we could simply keep mappings active even when the refcount goes down to zero. Then do the actual unmap either

Re: [PATCH v2 2/3] drm/ast: Map fbdev framebuffer while it's being displayed

2019-09-04 Thread Gerd Hoffmann
artman > Cc: Thomas Gleixner > Cc: Sam Ravnborg > Cc: Gerd Hoffmann > Cc: Oleksandr Andrushchenko > Cc: CK Hu > Cc: Daniel Vetter > Cc: Alex Deucher > Cc: "Christian König" > Cc: YueHaibing > Cc: Sam Bobroff > Cc: Huang Rui > Cc: "Y.C. Ch

Re: [PATCH v2 1/3] drm/vram: Add kmap ref-counting to GEM VRAM objects

2019-09-04 Thread Gerd Hoffmann
s Zimmermann > Cc: Davidlohr Bueso Reviewed-by: Gerd Hoffmann ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

[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 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 2/7] drm/ttm: add drm gem ttm helpers, starting with drm_gem_ttm_print_info()

2019-09-03 Thread Gerd Hoffmann
debug output. Signed-off-by: Gerd Hoffmann Acked-by: Thomas Zimmermann Reviewed-by: Daniel Vetter --- include/drm/drm_gem_ttm_helper.h | 19 ++ drivers/gpu/drm/drm_gem_ttm_helper.c | 56 Documentation/gpu/drm-mm.rst | 12 ++ drivers/gpu/drm

[PATCH v3 0/7] drm: add some ttm/vram info to debugfs

2019-09-03 Thread Gerd Hoffmann
Gerd Hoffmann (7): drm: add drm_print_bits drm/ttm: add drm gem ttm helpers, starting with drm_gem_ttm_print_info() drm/vram: use drm_gem_ttm_print_info drm/vram: add vram-mm debugfs file drm/qxl: use drm_gem_object_funcs callbacks drm/qxl: use drm_gem_ttm_print_info drm/vram

[PATCH v3 3/7] drm/vram: use drm_gem_ttm_print_info

2019-09-03 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Acked-by: Thomas Zimmermann Reviewed-by: Daniel Vetter --- 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

[PATCH v3 1/7] drm: add drm_print_bits

2019-09-03 Thread Gerd Hoffmann
New helper to print named bits of some value (think flags fields). Signed-off-by: Gerd Hoffmann --- include/drm/drm_print.h | 3 +++ drivers/gpu/drm/drm_print.c | 33 + 2 files changed, 36 insertions(+) diff --git a/include/drm/drm_print.h b/include/drm

[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 v3 4/7] drm/vram: add vram-mm debugfs file

2019-09-03 Thread Gerd Hoffmann
0x0900-0x0c00: 768: used 0x0c00-0x4000: 13312: free total: 16384, used 3072 free 13312 Signed-off-by: Gerd Hoffmann Acked-by: Thomas Zimmermann --- include/drm/drm_gem_vram_helper.h| 1 + include/drm/drm_vram_mm_helper.h | 1

[PATCH v2 4/6] drm/vram: add vram-mm debugfs file

2019-09-03 Thread Gerd Hoffmann
0x0900-0x0c00: 768: used 0x0c00-0x4000: 13312: free total: 16384, used 3072 free 13312 Signed-off-by: Gerd Hoffmann Acked-by: Thomas Zimmermann --- include/drm/drm_gem_vram_helper.h| 1 + include/drm/drm_vram_mm_helper.h | 1

[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 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 1/6] drm: add drm_print_bits

2019-09-03 Thread Gerd Hoffmann
New helper to print named bits of some value (think flags fields). Signed-off-by: Gerd Hoffmann --- include/drm/drm_print.h | 3 +++ drivers/gpu/drm/drm_print.c | 36 2 files changed, 39 insertions(+) diff --git a/include/drm/drm_print.h b/include/drm

[PATCH v2 2/6] drm/ttm: add drm gem ttm helpers, starting with drm_gem_ttm_print_info()

2019-09-03 Thread Gerd Hoffmann
to the debug output. Signed-off-by: Gerd Hoffmann Acked-by: Thomas Zimmermann --- include/drm/drm_gem_ttm_helper.h | 19 ++ drivers/gpu/drm/drm_gem_ttm_helper.c | 53 Documentation/gpu/drm-mm.rst | 12 +++ drivers/gpu/drm/Kconfig

[PATCH v2 0/6] drm: add some ttm/vram info to debugfs

2019-09-03 Thread Gerd Hoffmann
Gerd Hoffmann (6): drm: add drm_print_bits drm/ttm: add drm gem ttm helpers, starting with drm_gem_ttm_print_info() drm/vram: use drm_gem_ttm_print_info drm/vram: add vram-mm debugfs file drm/qxl: use drm_gem_object_funcs callbacks drm/qxl: use drm_gem_ttm_print_info drivers

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

Re: [PATCH 3/5] drm/vram: add vram-mm debugfs file

2019-09-02 Thread Gerd Hoffmann
Hi, > > +++ b/include/drm/drm_gem_vram_helper.h > > @@ -123,6 +123,7 @@ int drm_gem_vram_driver_dumb_mmap_offset(struct > > drm_file *file, > > * &struct drm_driver with default functions. > > */ > > #define DRM_GEM_VRAM_DRIVER \ > > + .debugfs_init = drm_vram_mm_debugfs_init

Re: [PATCH 2/5] drm/vram: use drm_gem_ttm_print_info

2019-09-02 Thread Gerd Hoffmann
Hi, > > @@ -169,6 +169,7 @@ config DRM_VRAM_HELPER > > tristate > > depends on DRM > > select DRM_TTM > > + select DRM_TTM_HELPER > > I thought that VRAM helpers already depend on TTM helpers. No, they don't. Patch #1 adds them ;) cheers, Gerd ___

Re: [PATCH 1/5] drm/ttm: add drm_gem_ttm_print_info()

2019-09-02 Thread Gerd Hoffmann
Hi, > > + [ TTM_PL_SYSTEM ] = "system", > > + [ TTM_PL_TT ] = "tt", > > + [ TTM_PL_VRAM ] = "vram", > > + [ TTM_PL_PRIV ] = "priv", > > + > > This 'gap' in the array seems to be a problem for drivers that use these > bits. Could the print logic be

[PATCH 1/5] drm/ttm: add drm_gem_ttm_print_info()

2019-09-02 Thread Gerd Hoffmann
to the debug output. Signed-off-by: Gerd Hoffmann --- include/drm/drm_gem_ttm_helper.h | 19 drivers/gpu/drm/drm_gem_ttm_helper.c | 67 Documentation/gpu/drm-mm.rst | 12 + drivers/gpu/drm/Kconfig | 7 +++ drivers/gpu/drm

[PATCH 2/5] drm/vram: use drm_gem_ttm_print_info

2019-09-02 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- include/drm/drm_gem_vram_helper.h | 1 + drivers/gpu/drm/drm_gem_vram_helper.c | 3 ++- drivers/gpu/drm/Kconfig | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/drm/drm_gem_vram_helper.h b/include/drm

[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

[PATCH 0/5] drm: add some ttm/vram info to debugfs

2019-09-02 Thread Gerd Hoffmann
Gerd Hoffmann (5): drm/ttm: add drm_gem_ttm_print_info() drm/vram: use drm_gem_ttm_print_info drm/vram: add vram-mm debugfs file drm/qxl: use drm_gem_object_funcs callbacks drm/qxl: use drm_gem_ttm_print_info drivers/gpu/drm/qxl/qxl_drv.h | 1 + include/drm

[PATCH 3/5] drm/vram: add vram-mm debugfs file

2019-09-02 Thread Gerd Hoffmann
0x0900-0x0c00: 768: used 0x0c00-0x4000: 13312: free total: 16384, used 3072 free 13312 Signed-off-by: Gerd Hoffmann --- include/drm/drm_gem_vram_helper.h| 1 + include/drm/drm_vram_mm_helper.h | 1 + drivers/gpu/drm

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

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

[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 v9 00/18] drm/virtio: switch from ttm to gem shmem helpers.

2019-08-29 Thread Gerd Hoffmann
On Thu, Aug 29, 2019 at 04:44:49PM -0700, Chia-I Wu wrote: > The series is > > Reviewed-by: Chia-I Wu Thanks. > However I ran into a deadlock with one GPU-heavy app. When I exits > Unigine Valley benchmark with ctrl-c, the entire driver locks up > probably 8 out of 10 times on my machine. W

[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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 00/18] drm/virtio: switch from ttm to gem shmem helpers.

2019-08-29 Thread Gerd Hoffmann
es to the series. v5: - fence bugfixes. - minor optimizations. v4: - make gem array helpers private to virtio. - misc minor fixes. v3: - add gem array helpers. - rework fencing. please review. thanks, Gerd Gerd Hoffmann (18): drm/virtio: pass gem reservation object to ttm init drm/v

Re: linux-next: build failure after merge of the drm-misc tree

2019-08-28 Thread Gerd Hoffmann
> I applied the following fix patch: > > From: Stephen Rothwell > Date: Wed, 28 Aug 2019 18:37:40 +1000 > Subject: [PATCH] drm/virtio: module_param_named() requires linux/moduleparam.h > > Signed-off-by: Stephen Rothwell > --- > drivers/gpu/drm/virtio/virtgpu_object.c | 2 ++ > 1 file changed,

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

Re: [PATCH v4 00/17] drm: add gem ttm helpers, rework mmap workflow.

2019-08-26 Thread Gerd Hoffmann
Hi, > Also this patch series also adjust vram helpers, and I think it has a > slightly different goal: Just aligning mmap paths a bit more between > ttm and not-ttm based drivers. Not just ttm/not-ttm. gem_driver->fops->mmap is the only fops callback where we can't use a generic gem callback t

Re: [PATCH v4 00/17] drm: add gem ttm helpers, rework mmap workflow.

2019-08-26 Thread Gerd Hoffmann
On Mon, Aug 26, 2019 at 10:47:07AM +0200, Thomas Zimmermann wrote: > Hi, > > I would have liked to get some context on the purpose of GEM TTM > helpers. Is is just share-able code? Yes. Shareable code for drivers which use both ttm and gem (all except vmgfx). > From my understanding VRAM helper

[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 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 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 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 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 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 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 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 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 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 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 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 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 00/18] drm/virtio: switch from ttm to gem shmem helpers.

2019-08-23 Thread Gerd Hoffmann
lpers private to virtio. - misc minor fixes. v3: - add gem array helpers. - rework fencing. please review. thanks, Gerd Gerd Hoffmann (18): drm/virtio: pass gem reservation object to ttm init drm/virtio: switch virtio_gpu_wait_ioctl() to gem helper. drm/virtio: simplify cursor updates

[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

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