[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

Re: [PATCH 3/3] drm/i915: switch to drm_fb_helper_remove_conflicting_pci_framebuffers

2019-08-23 Thread Gerd Hoffmann
On Fri, Aug 23, 2019 at 10:30:35AM +0200, Daniel Vetter wrote: > On Fri, Aug 23, 2019 at 10:14 AM Gerd Hoffmann wrote: > > > > Whole series or just the i915 patch? > > Ok I just checked and this all landed in 5.1 already, I thought it was > more recent. I think that&#x

Re: [PATCH 3/3] drm/i915: switch to drm_fb_helper_remove_conflicting_pci_framebuffers

2019-08-23 Thread Gerd Hoffmann
On Thu, Aug 22, 2019 at 03:13:14PM +0200, Daniel Vetter wrote: > On Thu, Aug 22, 2019 at 11:06:45AM +0200, Gerd Hoffmann wrote: > > No need for a home-grown version, the generic helper should work just > > fine. It also handles vgacon removal these days, see commit > >

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

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

[PATCH v2] drm/virtio: add plane check

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

[PATCH 2/3] udmabuf: check that __pad is zero

2019-08-22 Thread Gerd Hoffmann
Reported-by: Yann Droneaud Signed-off-by: Gerd Hoffmann --- drivers/dma-buf/udmabuf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c index 9635897458a0..6c3ec8fcef01 100644 --- a/drivers/dma-buf/udmabuf.c +++ b/drivers/dma-buf

[PATCH 3/3] udmabuf: check that flags has no unsupported bits set

2019-08-22 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Reported-by: Yann Droneaud --- drivers/dma-buf/udmabuf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c index 6c3ec8fcef01..ca1364102b18 100644 --- a/drivers/dma-buf/udmabuf.c +++ b/drivers/dma-buf

[PATCH 1/3] udmabuf: add documentation

2019-08-22 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- include/uapi/linux/udmabuf.h | 52 ++-- Documentation/driver-api/dma-buf.rst | 8 + 2 files changed, 57 insertions(+), 3 deletions(-) diff --git a/include/uapi/linux/udmabuf.h b/include/uapi/linux/udmabuf.h index 46b6532ed855

[PATCH 0/3] udmabuf: misc tweaks.

2019-08-22 Thread Gerd Hoffmann
Just noticed a bunch of udmabuf tweaks (add documentation & sanity checks) are still lingering in a local branch. Resending. Gerd Hoffmann (3): udmabuf: add documentation udmabuf: check that __pad is zero udmabuf: check that flags has no unsupported bits set include/uapi/linux/udmab

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

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

[PATCH 3/3] drm/i915: switch to drm_fb_helper_remove_conflicting_pci_framebuffers

2019-08-22 Thread Gerd Hoffmann
No need for a home-grown version, the generic helper should work just fine. It also handles vgacon removal these days, see commit 1c74ca7a1a9a ("drm/fb-helper: call vga_remove_vgacon automatically."), so that can be removed too. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/i915/

[PATCH 0/3] drm, fbdev: complete remove_conflicting_pci_framebuffers cleanup.

2019-08-22 Thread Gerd Hoffmann
Gerd Hoffmann (3): fbdev: drop res_id parameter from remove_conflicting_pci_framebuffers drm: drop resource_id parameter from drm_fb_helper_remove_conflicting_pci_framebuffers drm/i915: switch to drm_fb_helper_remove_conflicting_pci_framebuffers include/drm/drm_fb_helper.h

[PATCH 1/3] fbdev: drop res_id parameter from remove_conflicting_pci_framebuffers

2019-08-22 Thread Gerd Hoffmann
nup: Drop the res_id parameter, drop the sanity checks. Also downgrade the logging from "info" level to "debug" level and update documentation. Signed-off-by: Gerd Hoffmann --- include/drm/drm_fb_helper.h | 2 +- include/linux/fb.h | 2 +- drivers

Re: [PATCH v2] drm/qxl: get vga ioports

2019-08-21 Thread Gerd Hoffmann
On Mon, Aug 05, 2019 at 12:54:01PM +0200, Gerd Hoffmann wrote: > qxl has two modes: "native" (used by the drm driver) and "vga" (vga > compatibility mode, typically used for boot display and firmware > framebuffers). > > Accessing any vga ioport will switch the

[PATCH v4 0/4] drm/bochs: some cleanups.

2019-08-21 Thread Gerd Hoffmann
Gerd Hoffmann (4): drm/bochs: pass framebuffer to bochs_hw_setbase drm/bochs: drop yres_virtual from struct bochs_device drm/bochs: drop stride and bpp from struct bochs_device drm/bochs: move bochs_hw_setformat() call drivers/gpu/drm/bochs/bochs.h | 10 +++- drivers/gpu/drm

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

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

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

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

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

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

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

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

[PATCH v5] drm/virtio: use virtio_max_dma_size

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

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

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

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

2019-08-14 Thread Gerd Hoffmann
hat when necessary the GEM > object can be initialized in between. I think that's slightly more > flexible and easier to understand than a boolean flag. Yes, that should work too. Acked-by: Gerd Hoffmann cheers, Gerd ___ dri-devel mailing list

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

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

[PATCH v4] drm/virtio: use virtio_max_dma_size

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

[PATCH v3] drm/virtio: use virtio_max_dma_size

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

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

2019-08-13 Thread Gerd Hoffmann
Gerd Hoffmann (2): drm/virtio: cleanup queue functions drm/virtio: notify virtqueues without holding spinlock drivers/gpu/drm/virtio/virtgpu_vq.c | 54 ++--- 1 file changed, 27 insertions(+), 27 deletions(-) -- 2.18.1

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

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

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

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

[PATCH v2] drm/virtio: use virtio_max_dma_size

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

Re: 1c74ca7a1a9a ("drm/fb-helper: call vga_remove_vgacon automatically.")

2019-08-09 Thread Gerd Hoffmann
On Fri, Aug 09, 2019 at 09:47:00AM +0200, Borislav Petkov wrote: > Hi, > > On Fri, Aug 09, 2019 at 09:21:33AM +0200, Gerd Hoffmann wrote: > > On Thu, Aug 08, 2019 at 07:45:42PM +0200, Borislav Petkov wrote: > > > Hi, > > > > > > for some unfathomable t

Re: 1c74ca7a1a9a ("drm/fb-helper: call vga_remove_vgacon automatically.")

2019-08-09 Thread Gerd Hoffmann
On Thu, Aug 08, 2019 at 07:45:42PM +0200, Borislav Petkov wrote: > Hi, > > for some unfathomable to me reason, the commit in $Subject breaks > booting of the 32-bit partition of one of my test boxes. The box doesn't > finish booting (normally it boots in text mode, there is no X server > setup on

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

2019-08-08 Thread Gerd Hoffmann
On Thu, Aug 08, 2019 at 08:39:11AM -0600, Rob Herring wrote: > On Thu, Aug 8, 2019 at 7:44 AM Gerd Hoffmann wrote: > > > > > > > > Gerd Hoffmann (17): > > drm/ttm: turn ttm_bo_device.vma_manager into a pointer > > drm/ttm: add gem_ttm_bo_device_init()

[PATCH] drm/virtio: use virtio_max_dma_size

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

[PATCH v4 12/17] drm: drop DRM_VRAM_MM_FILE_OPERATIONS

2019-08-08 Thread Gerd Hoffmann
Not needed any more because we don't have vram specific functions any more. DEFINE_DRM_GEM_FOPS() can be used instead. Signed-off-by: Gerd Hoffmann --- include/drm/drm_vram_mm_helper.h| 17 - drivers/gpu/drm/ast/ast_drv.c | 5 + dr

[PATCH v4 07/17] drm/shmem: drop DEFINE_DRM_GEM_SHMEM_FOPS

2019-08-08 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 v4 10/17] drm/vram: switch vram helper to drm_gem_object_funcs->mmap codepath

2019-08-08 Thread Gerd Hoffmann
... using the new drm_gem_ttm_mmap() helper function. Signed-off-by: Gerd Hoffmann --- include/drm/drm_vram_mm_helper.h | 9 + drivers/gpu/drm/drm_gem_vram_helper.c | 4 +++- drivers/gpu/drm/drm_vram_mm_helper.c | 27 --- 3 files changed, 4 insertions

[PATCH v4 11/17] drm/vram: drop verify_access

2019-08-08 Thread Gerd Hoffmann
Not needed any more. Signed-off-by: Gerd Hoffmann --- include/drm/drm_gem_vram_helper.h | 3 --- include/drm/drm_vram_mm_helper.h | 3 --- drivers/gpu/drm/drm_gem_vram_helper.c | 1 - drivers/gpu/drm/drm_vram_mm_helper.c | 11 --- 4 files changed, 18 deletions(-) diff

[PATCH v4 13/17] drm/qxl: use drm_gem_object_funcs

2019-08-08 Thread Gerd Hoffmann
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/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c index 12cf85a06bed..38467478c7b2

[PATCH v4 01/17] drm/ttm: turn ttm_bo_device.vma_manager into a pointer

2019-08-08 Thread Gerd Hoffmann
. Signed-off-by: Gerd Hoffmann --- include/drm/ttm/ttm_bo_driver.h | 11 +-- drivers/gpu/drm/ttm/ttm_bo.c| 29 + drivers/gpu/drm/ttm/ttm_bo_vm.c | 6 +++--- 3 files changed, 33 insertions(+), 13 deletions(-) diff --git a/include/drm/ttm/ttm_bo_driver.h b

[PATCH v4 17/17] drm/qxl: use DEFINE_DRM_GEM_FOPS()

2019-08-08 Thread Gerd Hoffmann
We have no qxl-specific fops any more. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c index 2fb1641c817e..4853082ba924 100644 --- a/drivers

[PATCH v4 16/17] drm/qxl: drop verify_access

2019-08-08 Thread Gerd Hoffmann
Not needed any more. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_ttm.c | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c index dbaed0e67c21..d1d8fe6e1e93 100644 --- a/drivers/gpu/drm/qxl/qxl_ttm.c +++ b/drivers

[PATCH v4 08/17] drm/ttm: factor out ttm_bo_mmap_vma_setup

2019-08-08 Thread Gerd Hoffmann
Factor out ttm vma setup to a new function. Signed-off-by: Gerd Hoffmann --- include/drm/ttm/ttm_bo_api.h| 8 ++ drivers/gpu/drm/ttm/ttm_bo_vm.c | 47 ++--- 2 files changed, 33 insertions(+), 22 deletions(-) diff --git a/include/drm/ttm/ttm_bo_api.h b

[PATCH v4 06/17] drm/shmem: switch shmem helper to drm_gem_object_funcs->mmap

2019-08-08 Thread Gerd Hoffmann
Switch gem shmem helper from gem_driver->fops->mmap to drm_gem_object_funcs->mmap. Signed-off-by: Gerd Hoffmann --- include/drm/drm_gem_shmem_helper.h | 4 ++-- drivers/gpu/drm/drm_gem_shmem_helper.c | 18 +++--- drivers/gpu/drm/panfrost/panfrost_gem.c | 1 + driver

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

2019-08-08 Thread Gerd Hoffmann
drm_gem_object_funcs->vm_ops alone can't handle everything mmap() needs. Add a new callback for it. Signed-off-by: Gerd Hoffmann --- include/drm/drm_gem.h | 9 + drivers/gpu/drm/drm_gem.c | 6 ++ 2 files changed, 15 insertions(+) diff --git a/include/drm/drm_gem.h b

[PATCH v4 14/17] drm/qxl: drop qxl_ttm_fault

2019-08-08 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 v4 15/17] drm/qxl: switch qxl to drm_gem_object_funcs->mmap codepath

2019-08-08 Thread Gerd Hoffmann
... using the use drm_gem_ttm_mmap() helper function. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.h| 1 - drivers/gpu/drm/qxl/qxl_drv.c| 2 +- drivers/gpu/drm/qxl/qxl_object.c | 1 + drivers/gpu/drm/qxl/qxl_ttm.c| 16 4 files changed, 2

[PATCH v4 03/17] drm/vram: switch vram helpers to the new gem_ttm_bo_device_init()

2019-08-08 Thread Gerd Hoffmann
This allows to drop drm_gem_vram_mmap_offset() and drm_gem_vram_driver_dumb_mmap_offset(), the default gem function works just fine. Signed-off-by: Gerd Hoffmann --- include/drm/drm_gem_vram_helper.h | 6 +-- drivers/gpu/drm/drm_gem_vram_helper.c | 48

[PATCH v4 09/17] drm/ttm: add drm_gem_ttm_mmap()

2019-08-08 Thread Gerd Hoffmann
Add helper function to mmap ttm bo's via drm_gem_object_funcs->mmap(). Note that with this code path access verification is done by drm_gem_mmap() and ttm_bo_driver.verify_access() is not used. Signed-off-by: Gerd Hoffmann --- include/drm/drm_gem_ttm_helper.h | 2 ++ drivers

[PATCH v4 02/17] drm/ttm: add gem_ttm_bo_device_init()

2019-08-08 Thread Gerd Hoffmann
manager used by gem, to make sure gem and ttm have the same view on vma offsets. With that in place gem+ttm drivers don't need their private drm_driver.dumb_map_offset implementation any more. v3: - complete rewrite Signed-off-by: Gerd Hoffmann --- include/drm/drm_gem_ttm_helper.h

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

2019-08-08 Thread Gerd Hoffmann
Gerd Hoffmann (17): drm/ttm: turn ttm_bo_device.vma_manager into a pointer drm/ttm: add gem_ttm_bo_device_init() drm/vram: switch vram helpers to the new gem_ttm_bo_device_init() drm/qxl: switch qxl to the new gem_ttm_bo_device_init() drm: add mmap() to drm_gem_object_funcs drm/shmem

[PATCH v4 04/17] drm/qxl: switch qxl to the new gem_ttm_bo_device_init()

2019-08-08 Thread Gerd Hoffmann
This allows to drop qxl_mode_dumb_mmap() and qxl_bo_mmap_offset(), the default gem function works just fine. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.h| 4 +--- drivers/gpu/drm/qxl/qxl_object.h | 5 - drivers/gpu/drm/qxl/qxl_drv.c| 1 - drivers/gpu/drm/qxl

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

2019-08-08 Thread Gerd Hoffmann
Hi, > > > That would also make the verify_access callback completely superfluous > > > and looks like a good step into the right direction of de-midlayering. > > > > Hmm, right, noticed that too while working on another patch series. > > Guess I'll try to merge those two and see where I end up

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

Re: [PATCH v3 1/8] scsi: core: fix the dma_max_mapping_size call

2019-08-08 Thread Gerd Hoffmann
On Thu, Aug 08, 2019 at 11:36:55AM +0200, Gerd Hoffmann wrote: > From: Christoph Hellwig > > We should only call dma_max_mapping_size for devices that have a DMA mask > set, otherwise we can run into a NULL pointer dereference that will crash > the system. > > Also we need

[PATCH v3 6/8] drm/ttm: add drm_gem_ttm_bo_driver_verify_access()

2019-08-08 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- include/drm/drm_gem_ttm_helper.h | 2 ++ drivers/gpu/drm/drm_gem_ttm_helper.c | 22 ++ 2 files changed, 24 insertions(+) diff --git a/include/drm/drm_gem_ttm_helper.h b/include/drm/drm_gem_ttm_helper.h index 43c9db3583cc..78e4d8930fec

[PATCH v3 0/8] drm: add gem ttm helpers

2019-08-08 Thread Gerd Hoffmann
Christoph Hellwig (1): scsi: core: fix the dma_max_mapping_size call Gerd Hoffmann (7): ttm: turn ttm_bo_device.vma_manager into a pointer drm/ttm: add gem_ttm_bo_device_init() drm/vram: switch vram helpers to the new gem_ttm_bo_device_init() drm/qxl: switch qxl to the new

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

2019-08-08 Thread Gerd Hoffmann
. Signed-off-by: Gerd Hoffmann --- include/drm/ttm/ttm_bo_driver.h | 11 +-- drivers/gpu/drm/ttm/ttm_bo.c| 29 + drivers/gpu/drm/ttm/ttm_bo_vm.c | 6 +++--- 3 files changed, 33 insertions(+), 13 deletions(-) diff --git a/include/drm/ttm/ttm_bo_driver.h b

[PATCH v3 1/8] scsi: core: fix the dma_max_mapping_size call

2019-08-08 Thread Gerd Hoffmann
From: Christoph Hellwig We should only call dma_max_mapping_size for devices that have a DMA mask set, otherwise we can run into a NULL pointer dereference that will crash the system. Also we need to do right shift to get the sectors from the size in bytes, not a left shift. Fixes: bdd17bdef7d8

[PATCH v3 3/8] drm/ttm: add gem_ttm_bo_device_init()

2019-08-08 Thread Gerd Hoffmann
manager used by gem, to make sure gem and ttm have the same view on vma offsets. With that in place gem+ttm drivers don't need their private drm_driver.dumb_map_offset implementation any more. v3: - complete rewrite Signed-off-by: Gerd Hoffmann --- include/drm/drm_gem_ttm_helper.h

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

2019-08-08 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_ttm.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c index 3a24145dd516..bcf48b062a85 100644 --- a/drivers/gpu/drm/qxl/qxl_ttm.c +++ b/drivers/gpu

[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 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 5/8] drm/qxl: switch qxl to the new gem_ttm_bo_device_init()

2019-08-08 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.h| 4 +--- drivers/gpu/drm/qxl/qxl_object.h | 5 - drivers/gpu/drm/qxl/qxl_drv.c| 1 - drivers/gpu/drm/qxl/qxl_dumb.c | 17 - drivers/gpu/drm/qxl/qxl_ioctl.c | 5 +++-- drivers/gpu/drm/qxl/qxl_ttm.c

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

2019-08-07 Thread Gerd Hoffmann
Hi, > > > > I don't think so. drm_gem_dumb_map_offset() calls > > > > drm_gem_create_mmap_offset(), which I think is not correct for ttm > > > > objects because ttm_bo_init() handles vma_node initialization. > Ok I looked again, and your ttm version seems to exactly match > drm_gem_dumb_map_of

[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 v2 0/3] drm: add gem ttm helpers

2019-08-07 Thread Gerd Hoffmann
Gerd Hoffmann (3): drm: add gem ttm helpers drm/vram: switch vram helpers to use the new ttm helpers. drm/qxl: switch qxl to use the new ttm helpers. drivers/gpu/drm/qxl/qxl_drv.h | 4 +- drivers/gpu/drm/qxl/qxl_object.h | 5 -- include/drm

[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 3/3] drm/qxl: switch qxl to use the new ttm helpers.

2019-08-07 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.h| 4 +--- drivers/gpu/drm/qxl/qxl_object.h | 5 - drivers/gpu/drm/qxl/qxl_drv.c| 2 +- drivers/gpu/drm/qxl/qxl_dumb.c | 17 - drivers/gpu/drm/qxl/qxl_ioctl.c | 5 +++-- drivers/gpu/drm/qxl/Kconfig

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

2019-08-07 Thread Gerd Hoffmann
Hi, > > > Same for this, you're just upcasting to ttm_bo and then downcasting to > > > gem_bo again ... I think just a series to roll out the existing gem > > > helpers everywhere should work? > > > > I don't think so. drm_gem_dumb_map_offset() calls > > drm_gem_create_mmap_offset(), which I th

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

2019-08-07 Thread Gerd Hoffmann
> > +/** > > + * drm_gem_ttm_mmap_offset() - Returns a GEM ttm object's mmap offset > > + * @gbo: the GEM ttm object > > + * > > + * See drm_vma_node_offset_addr() for more information. > > + * > > + * Returns: > > + * The buffer object's offset for userspace mappings on success, or > > + * 0 if

[PATCH 0/3] drm: add gem ttm helpers

2019-08-06 Thread Gerd Hoffmann
Gerd Hoffmann (3): drm: add gem ttm helpers drm/vram: switch vram helpers to use the new ttm helpers. drm/qxl: switch qxl to use the new ttm helpers. drivers/gpu/drm/qxl/qxl_drv.h | 4 +- drivers/gpu/drm/qxl/qxl_object.h | 5 -- include/drm

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

2019-08-06 Thread Gerd Hoffmann
Now with ttm_buffer_object being a subclass of drm_gem_object we can easily lookup ttm_buffer_object for a given drm_gem_object, which in turm allows to create common helper functions. This patch starts off with dump mmap helpers. Signed-off-by: Gerd Hoffmann --- include/drm

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

2019-08-06 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 3/3] drm/qxl: switch qxl to use the new ttm helpers.

2019-08-06 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.h| 4 +--- drivers/gpu/drm/qxl/qxl_object.h | 5 - drivers/gpu/drm/qxl/qxl_drv.c| 2 +- drivers/gpu/drm/qxl/qxl_dumb.c | 17 - drivers/gpu/drm/qxl/qxl_ioctl.c | 5 +++-- drivers/gpu/drm/qxl/Kconfig

Re: [PATCH] drm/qxl: Use dev_get_drvdata where possible

2019-08-06 Thread Gerd Hoffmann
On Tue, Jul 23, 2019 at 06:40:00PM +0800, Chuhong Yuan wrote: > Instead of using to_pci_dev + pci_get_drvdata, > use dev_get_drvdata to make code simpler. > > Signed-off-by: Chuhong Yuan Queued for drm-misc-next (the bochs patch too). thanks, Gerd

[PATCH v6 08/17] drm/ttm: use gem vma_node

2019-08-05 Thread Gerd Hoffmann
Drop vma_node from ttm_buffer_object, use the gem struct (base.vma_node) instead. Signed-off-by: Gerd Hoffmann Reviewed-by: Christian König --- 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

[PATCH v6 13/17] drm/amdgpu: switch driver from bo->resv to bo->base.resv

2019-08-05 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Reviewed-by: Christian König --- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 8 ++--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c| 6 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c | 2 +- drivers

[PATCH v6 11/17] drm/radeon: switch driver from bo->resv to bo->base.resv

2019-08-05 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Reviewed-by: Christian König --- drivers/gpu/drm/radeon/radeon_benchmark.c | 4 ++-- drivers/gpu/drm/radeon/radeon_cs.c| 2 +- drivers/gpu/drm/radeon/radeon_display.c | 2 +- drivers/gpu/drm/radeon/radeon_gem.c | 6 +++--- drivers/gpu/drm/radeon

[PATCH v6 15/17] drm/qxl: switch driver from bo->resv to bo->base.resv

2019-08-05 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Acked-by: Christian König --- 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

[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 12/17] drm/vmwgfx: switch driver from bo->resv to bo->base.resv

2019-08-05 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Acked-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_blit.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 8 drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | 6 +++--- 4 files changed, 11

[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 10/17] drm/ttm: switch ttm core from bo->resv to bo->base.resv

2019-08-05 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Reviewed-by: Christian König --- include/drm/ttm/ttm_bo_driver.h| 12 ++-- drivers/gpu/drm/ttm/ttm_bo.c | 98 +- drivers/gpu/drm/ttm/ttm_bo_util.c | 16 ++--- drivers/gpu/drm/ttm/ttm_bo_vm.c| 6 +- drivers/gpu

[PATCH v6 09/17] drm/ttm: set both resv and base.resv pointers

2019-08-05 Thread Gerd Hoffmann
Initialize both ttm_buffer_object->resv and ttm_buffer_object->base.resv pointers. This allows to move users from the former to the latter. When all users are moved we can drop ttm_buffer_object->resv. Signed-off-by: Gerd Hoffmann Reviewed-by: Christian König --- drivers/gpu/drm/ttm

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

2019-08-05 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Acked-by: Christian König --- 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

[PATCH v6 04/17] drm/radeon: use embedded gem object

2019-08-05 Thread Gerd Hoffmann
Drop drm_gem_object from radeon_bo, use the ttm_buffer_object.base instead. Build tested only. Signed-off-by: Gerd Hoffmann Reviewed-by: Christian König --- drivers/gpu/drm/radeon/radeon.h | 3 +-- drivers/gpu/drm/radeon/radeon_cs.c | 2 +- drivers/gpu/drm/radeon

[PATCH v6 05/17] drm/amdgpu: use embedded gem object

2019-08-05 Thread Gerd Hoffmann
Drop drm_gem_object from amdgpu_bo, use the ttm_buffer_object.base instead. Build tested only. Signed-off-by: Gerd Hoffmann Reviewed-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 1 - drivers/gpu/drm/amd/amdgpu

[PATCH v6 14/17] drm/nouveau: switch driver from bo->resv to bo->base.resv

2019-08-05 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Reviewed-by: Christian König --- drivers/gpu/drm/nouveau/dispnv50/wndw.c | 2 +- drivers/gpu/drm/nouveau/nouveau_bo.c| 5 ++--- drivers/gpu/drm/nouveau/nouveau_fence.c | 2 +- drivers/gpu/drm/nouveau/nouveau_gem.c | 2 +- 4 files changed, 5 insertions(+), 6

[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 v6 00/17] drm/ttm: make ttm bo a gem bo subclass

2019-08-05 Thread Gerd Hoffmann
-next, adapt to vram helper changes. v3: - comment updates - rebased on daniels resv series (https://patchwork.freedesktop.org/series/62735/) v2: - build fixes. - also drop ttm_buffer_object->resv Gerd Hoffmann (17): drm/ttm: add gem base object drm/vram: use embedded gem object drm/

[PATCH v6 07/17] drm/ttm: use gem reservation object

2019-08-05 Thread Gerd Hoffmann
Drop ttm_resv from ttm_buffer_object, use the gem reservation object (base._resv) instead. 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 | 39 ++- drivers/gpu/drm/ttm

[PATCH v6 03/17] drm/qxl: use embedded gem object

2019-08-05 Thread Gerd Hoffmann
Drop drm_gem_object from qxl_bo, use the ttm_buffer_object.base instead. Signed-off-by: Gerd Hoffmann Acked-by: Christian König --- 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

[PATCH v6 01/17] drm/ttm: add gem base object

2019-08-05 Thread Gerd Hoffmann
Add drm_gem_object struct to ttm_buffer_object, so ttm objects are a gdm object superclass. Add a function to check whenever a given bo actually uses the embedded drm_gem_object. Signed-off-by: Gerd Hoffmann Reviewed-by: Christian König --- include/drm/ttm/ttm_bo_api.h | 23

Re: [PATCH v5 11/18] [fixup] ttm

2019-08-05 Thread Gerd Hoffmann
On Mon, Aug 05, 2019 at 02:43:03PM +0200, Gerd Hoffmann wrote: > --- > drivers/gpu/drm/ttm/ttm_bo.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c > index b3d628b3f038..73d407494586 100644 &

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

2019-08-05 Thread Gerd Hoffmann
Drop vma_node from ttm_buffer_object, use the gem struct (base.vma_node) instead. Signed-off-by: Gerd Hoffmann Reviewed-by: Christian König --- 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

[PATCH v5 04/18] drm/radeon: use embedded gem object

2019-08-05 Thread Gerd Hoffmann
Drop drm_gem_object from radeon_bo, use the ttm_buffer_object.base instead. Build tested only. Signed-off-by: Gerd Hoffmann Reviewed-by: Christian König --- drivers/gpu/drm/radeon/radeon.h | 3 +-- drivers/gpu/drm/radeon/radeon_cs.c | 2 +- drivers/gpu/drm/radeon

[PATCH v5 05/18] drm/amdgpu: use embedded gem object

2019-08-05 Thread Gerd Hoffmann
Drop drm_gem_object from amdgpu_bo, use the ttm_buffer_object.base instead. Build tested only. Signed-off-by: Gerd Hoffmann Reviewed-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 1 - drivers/gpu/drm/amd/amdgpu

[PATCH v5 14/18] drm/amdgpu: switch driver from bo->resv to bo->base.resv

2019-08-05 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Reviewed-by: Christian König --- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 8 ++--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c| 6 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c | 2 +- drivers

[PATCH v5 15/18] drm/nouveau: switch driver from bo->resv to bo->base.resv

2019-08-05 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Reviewed-by: Christian König --- drivers/gpu/drm/nouveau/dispnv50/wndw.c | 2 +- drivers/gpu/drm/nouveau/nouveau_bo.c| 5 ++--- drivers/gpu/drm/nouveau/nouveau_fence.c | 2 +- drivers/gpu/drm/nouveau/nouveau_gem.c | 2 +- 4 files changed, 5 insertions(+), 6

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

2019-08-05 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Acked-by: Christian König --- 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

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