Re: [PATCH] drm/qxl: fix NULL dereference in qxl_add_mode

2024-03-01 Thread Gerd Hoffmann
On Fri, Mar 01, 2024 at 11:55:11AM +0300, Aleksandr Burakov wrote: > Return value of a function 'drm_cvt_mode' is dereferenced without > checking for NULL but drm_mode_create() in drm_cvt_mode() may > return NULL value in case of memory allocation error. > > Found by Linux Verification Center

Re: [PATCH] qxl: Fix uninitialised struct field head.surface_id

2021-03-05 Thread Gerd Hoffmann
On Thu, Mar 04, 2021 at 09:49:28AM +, Colin King wrote: > From: Colin Ian King > > The surface_id struct field in head is not being initialized and > static analysis warns that this is being passed through to > dev->monitors_config->heads[i] on an assignment. Clear up this > warning by

Re: drm/ttm: ttm_bo_release called without lock

2021-03-04 Thread Gerd Hoffmann
On Thu, Mar 04, 2021 at 08:42:55AM +0100, Thomas Zimmermann wrote: > (cc'ing Gerd) > > This might be related to the recent clean-up patches for the BO handling in > qxl. Yes, it is. Fixed in drm-misc-next, cherry-picked into drm-misc-fixes, hopefully lands in -rc2. take care, Gerd

Re: [RFC PATCH] drm/vkms: Add support for virtual hardware mode

2021-02-25 Thread Gerd Hoffmann
On Thu, Feb 25, 2021 at 11:32:08AM +0100, Daniel Vetter wrote: > On Thu, Feb 25, 2021 at 11:25:20AM +0100, Gerd Hoffmann wrote: > > On Thu, Feb 25, 2021 at 10:09:42AM +0100, Daniel Vetter wrote: > > > On Wed, Feb 24, 2021 at 11:55 AM Sumera Priyadarsini > > > wrote: &g

Re: [RFC PATCH] drm/vkms: Add support for virtual hardware mode

2021-02-25 Thread Gerd Hoffmann
On Thu, Feb 25, 2021 at 10:09:42AM +0100, Daniel Vetter wrote: > On Wed, Feb 24, 2021 at 11:55 AM Sumera Priyadarsini > wrote: > > > > Add a virtual hardware or vblank-less mode as a module to enable > > VKMS to emulate virtual graphic drivers. This mode can be enabled > > by setting

Re: [PATCH v2 10/11] drm/qxl: rework cursor plane

2021-02-18 Thread Gerd Hoffmann
Hi, > > Well. I suspect I could easily spend a month cleaning up and party > > redesign the qxl driver (specifically qxl_draw.c + qxl_image.c). > > > > I'm not sure I'll find the time to actually do that anytime soon. > > I have plenty of other stuff on my TODO list, and given that the > >

Re: [PATCH v2 10/11] drm/qxl: rework cursor plane

2021-02-18 Thread Gerd Hoffmann
Hi, > I'm still trying to wrap my head around the qxl cursor code. > > Getting vmap out of the commit tail is good, but I feel like this isn't > going in the right direction overall. > > In ast, these helper functions were only good when converting the drvier to > atomic modesetting. So I

[PATCH v2 09/11] drm/qxl: move shadow handling to new qxl_prepare_shadow()

2021-02-17 Thread Gerd Hoffmann
Pure code motion, no functional change. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 61 +-- 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index

[PATCH v2 06/11] drm/qxl: add qxl_bo_vmap/qxl_bo_vunmap

2021-02-17 Thread Gerd Hoffmann
Add vmap/vunmap variants which reserve (and pin) the bo. They can be used in case the caller doesn't hold a reservation for the bo. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_object.h | 2 ++ drivers/gpu/drm/qxl/qxl_object.c | 36 2 files changed

[PATCH v2 10/11] drm/qxl: rework cursor plane

2021-02-17 Thread Gerd Hoffmann
Add helper functions to create and move the cursor. Create the cursor_bo in prepare_fb callback, in the atomic_commit callback we only send the update command to the host. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 248 -- 1 file changed

[PATCH v2 07/11] drm/qxl: fix prime vmap

2021-02-17 Thread Gerd Hoffmann
Use the correct vmap variant. We don't have a reservation here, so we can't use the _locked version. Signed-off-by: Gerd Hoffmann Acked-by: Thomas Zimmermann --- drivers/gpu/drm/qxl/qxl_prime.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/qxl

[PATCH v2 08/11] drm/qxl: fix monitors object vmap

2021-02-17 Thread Gerd Hoffmann
Use the correct vmap variant. We don't hold a reservation here, so we can't use the _locked variant. We can drop the pin because qxl_bo_vmap will do that for us. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions

[PATCH v2 11/11] drm/qxl: add lock asserts to qxl_bo_vmap_locked + qxl_bo_vunmap_locked

2021-02-17 Thread Gerd Hoffmann
Try avoid re-introducing locking bugs. Signed-off-by: Gerd Hoffmann Acked-by: Thomas Zimmermann --- drivers/gpu/drm/qxl/qxl_object.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_object.c b/drivers/gpu/drm/qxl/qxl_object.c index 82c3bf195ad6..6e26d70f2f07

[PATCH v2 03/11] drm/qxl: use ttm bo priorities

2021-02-17 Thread Gerd Hoffmann
() picks something which can't be evicted and throws an error after waiting a while without success. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_object.h | 1 + drivers/gpu/drm/qxl/qxl_cmd.c | 2 +- drivers/gpu/drm/qxl/qxl_display.c | 4 ++-- drivers/gpu/drm/qxl/qxl_gem.c | 2

[PATCH v2 05/11] drm/qxl: rename qxl_bo_kmap -> qxl_bo_vmap_locked

2021-02-17 Thread Gerd Hoffmann
Append _locked to Make clear that these functions should be called with reserved bo's only. While being at it also rename kmap -> vmap. No functional change. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_object.h | 4 ++-- drivers/gpu/drm/qxl/qxl_display.c |

[PATCH v2 04/11] drm/qxl: fix lockdep issue in qxl_alloc_release_reserved

2021-02-17 Thread Gerd Hoffmann
Call qxl_bo_unpin (which does a reservation) without holding the release_mutex lock. Fixes lockdep (correctly) warning on a possible deadlock. Fixes: 65ffea3c6e73 ("drm/qxl: unpin release objects") Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_release.c | 13 ++-

[PATCH v2 01/11] drm/qxl: properly handle device init failures

2021-02-17 Thread Gerd Hoffmann
Specifically do not try release resources which where not allocated in the first place. Cc: Tong Zhang Tested-by: Tong Zhang Signed-off-by: Gerd Hoffmann Acked-by: Thomas Zimmermann --- drivers/gpu/drm/qxl/qxl_display.c | 3 +++ drivers/gpu/drm/qxl/qxl_kms.c | 4 2 files changed, 7

[PATCH v2 02/11] drm/qxl: more fence wait rework

2021-02-17 Thread Gerd Hoffmann
Move qxl_io_notify_oom() call into wait condition. That way the driver will call it again if one call wasn't enough. Also allows to remove the extra dma_fence_is_signaled() check and the goto. Fixes: 5a838e5d5825 ("drm/qxl: simplify qxl_fence_wait") Signed-off-by: Gerd Hoffmann --- d

Re: [PATCH 09/10] drm/qxl: map/unmap framebuffers in prepare_fb+cleanup_fb callbacks.

2021-02-17 Thread Gerd Hoffmann
On Tue, Feb 16, 2021 at 02:46:21PM +0100, Thomas Zimmermann wrote: > > > Am 16.02.21 um 14:27 schrieb Thomas Zimmermann: > > Hi > > > > this is a shadow-buffered plane. Did you consider using the new helpers > > for shadow-buffered planes? They will map the user BO for you and > > provide the

[PATCH 08/10] drm/qxl: fix monitors object kmap

2021-02-16 Thread Gerd Hoffmann
Use the correct kmap variant. We don't hold a reservation here, so we can't use the _locked variant. We can drop the pin because qxl_bo_kmap will do that for us. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions

[PATCH 09/10] drm/qxl: map/unmap framebuffers in prepare_fb+cleanup_fb callbacks.

2021-02-16 Thread Gerd Hoffmann
We don't have to map in atomic_update callback then, making locking a bit less complicated. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm

[PATCH 05/10] drm/qxl: rename qxl_bo_kmap -> qxl_bo_kmap_locked

2021-02-16 Thread Gerd Hoffmann
Make clear that these functions should be called with reserved bo's only. No functional change. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_object.h | 4 ++-- drivers/gpu/drm/qxl/qxl_display.c | 14 +++--- drivers/gpu/drm/qxl/qxl_draw.c| 8 drivers/gpu/drm

[PATCH 06/10] drm/qxl: add qxl_bo_kmap/qxl_bo_kunmap

2021-02-16 Thread Gerd Hoffmann
Add kmap/kunmap variants which reserve (and pin) the bo. They can be used in case the caller doesn't hold a reservation for the bo. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_object.h | 2 ++ drivers/gpu/drm/qxl/qxl_object.c | 36 2 files changed

[PATCH 04/10] drm/qxl: fix lockdep issue in qxl_alloc_release_reserved

2021-02-16 Thread Gerd Hoffmann
Call qxl_bo_unpin (which does a reservation) without holding the release_mutex lock. Fixes lockdep (correctly) warning on a possible deadlock. Fixes: 65ffea3c6e73 ("drm/qxl: unpin release objects") Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_release.c | 13 ++-

[PATCH 10/10] drm/qxl: add lock asserts to qxl_bo_kmap_locked + qxl_bo_kunmap_locked

2021-02-16 Thread Gerd Hoffmann
Try avoid re-introducing locking bugs. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_object.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_object.c b/drivers/gpu/drm/qxl/qxl_object.c index 22748b9566af..90d5e5b7f927 100644 --- a/drivers/gpu/drm/qxl

[PATCH 01/10] drm/qxl: properly handle device init failures

2021-02-16 Thread Gerd Hoffmann
Specifically do not try release resources which where not allocated in the first place. Cc: Tong Zhang Tested-by: Tong Zhang Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 3 +++ drivers/gpu/drm/qxl/qxl_kms.c | 4 2 files changed, 7 insertions(+) diff --git

[PATCH 07/10] drm/qxl: fix prime kmap

2021-02-16 Thread Gerd Hoffmann
Use the correct kmap variant. We don't have a reservation here, so we can't use the _locked version. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_prime.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_prime.c b/drivers/gpu/drm/qxl

[PATCH 03/10] drm/qxl: use ttm bo priorities

2021-02-16 Thread Gerd Hoffmann
() picks something which can't be evicted and throws an error after waiting a while without success. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_object.h | 1 + drivers/gpu/drm/qxl/qxl_cmd.c | 2 +- drivers/gpu/drm/qxl/qxl_display.c | 4 ++-- drivers/gpu/drm/qxl/qxl_gem.c | 2

[PATCH 02/10] drm/qxl: more fence wait rework

2021-02-16 Thread Gerd Hoffmann
Move qxl_io_notify_oom() call into wait condition. That way the driver will call it again if one call wasn't enough. Also allows to remove the extra dma_fence_is_signaled() check and the goto. Fixes: 5a838e5d5825 ("drm/qxl: simplify qxl_fence_wait") Signed-off-by: Gerd Hoffmann --- d

Re: [PATCH] drm/qxl: properly handle device init failures

2021-02-09 Thread Gerd Hoffmann
On Mon, Feb 08, 2021 at 12:07:01PM -0500, Tong Zhang wrote: > Does this patch fix an issue raised previously? Or should they be used > together? > https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg2466541.html > > IMHO using this patch alone won’t fix the issue This patch on top of

[PATCH] drm/qxl: properly handle device init failures

2021-02-08 Thread Gerd Hoffmann
Specifically do not try release resources which where not allocated in the first place. Cc: Tong Zhang Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 3 +++ drivers/gpu/drm/qxl/qxl_kms.c | 4 2 files changed, 7 insertions(+) diff --git a/drivers/gpu/drm/qxl

Re: [PATCH v2] drm/qxl: do not run release if qxl failed to init

2021-02-04 Thread Gerd Hoffmann
On Thu, Feb 04, 2021 at 11:30:50AM -0500, Tong Zhang wrote: > if qxl_device_init() fail, drm device will not be registered, > in this case, do not run qxl_drm_release() How do you trigger this? take care, Gerd

Re: [PATCH v6 01/10] [hack] silence ttm fini WARNING

2021-02-04 Thread Gerd Hoffmann
On Thu, Feb 04, 2021 at 03:58:33PM +0100, Christian König wrote: > ? > > What's the background here? > > Christian. > > Am 04.02.21 um 15:57 schrieb Gerd Hoffmann: > > kobject: '(null)' ((ptrval)): is not initialized, yet kobject_put() > > is being cal

[PATCH v6 08/10] drm/qxl: properly free qxl releases

2021-02-04 Thread Gerd Hoffmann
Reorganize qxl_device_fini() a bit. Add missing unpin() calls. Count releases. Add wait queue for releases. That way qxl_device_fini() can easily wait until everything is ready for proper shutdown. Signed-off-by: Gerd Hoffmann Acked-by: Thomas Zimmermann --- drivers/gpu/drm/qxl/qxl_drv.h

[PATCH v6 10/10] drm/qxl: allocate dumb buffers in ram

2021-02-04 Thread Gerd Hoffmann
dumb buffers are shadowed anyway, so there is no need to store them in device memory. Use QXL_GEM_DOMAIN_CPU (TTM_PL_SYSTEM) instead. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_dumb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/qxl

[PATCH v6 09/10] drm/qxl: simplify qxl_fence_wait

2021-02-04 Thread Gerd Hoffmann
Now that we have the new release_event wait queue we can just use that in qxl_fence_wait() and simplify the code alot. Signed-off-by: Gerd Hoffmann Acked-by: Thomas Zimmermann --- drivers/gpu/drm/qxl/qxl_release.c | 44 +++ 1 file changed, 4 insertions(+), 40

[PATCH v6 07/10] drm/qxl: handle shadow in primary destroy

2021-02-04 Thread Gerd Hoffmann
qxl_primary_atomic_disable must check whenever the framebuffer bo has a shadow surface and in case it has check the shadow primary status. Signed-off-by: Gerd Hoffmann Acked-by: Thomas Zimmermann --- drivers/gpu/drm/qxl/qxl_display.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

[PATCH v6 03/10] drm/qxl: use drmm_mode_config_init

2021-02-04 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel Vetter Acked-by: Thomas Zimmermann --- drivers/gpu/drm/qxl/qxl_display.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 012bce0cdb65

[PATCH v6 06/10] drm/qxl: properly pin/unpin shadow

2021-02-04 Thread Gerd Hoffmann
Suggested-by: Thomas Zimmermann Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 60331e31861a..d25fd3acc891 100644 --- a/drivers/gpu/drm/qxl

[PATCH v6 02/10] Revert "drm/qxl: do not run release if qxl failed to init"

2021-02-04 Thread Gerd Hoffmann
This reverts commit b91907a6241193465ca92e357adf16822242296d. Patch is broken, it effectively makes qxl_drm_release() a nop because on normal driver shutdown qxl_drm_release() is called *after* drm_dev_unregister(). Cc: Tong Zhang Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.c

[PATCH v6 01/10] [hack] silence ttm fini WARNING

2021-02-04 Thread Gerd Hoffmann
kobject: '(null)' ((ptrval)): is not initialized, yet kobject_put() is being called. WARNING: CPU: 0 PID: 209 at lib/kobject.c:750 kobject_put+0x3a/0x60 [ ... ] Call Trace: ttm_device_fini+0x133/0x1b0 [ttm] qxl_ttm_fini+0x2f/0x40 [qxl] --- drivers/gpu/drm/ttm/ttm_device.c | 2 +- 1

[PATCH v6 05/10] drm/qxl: release shadow on shutdown

2021-02-04 Thread Gerd Hoffmann
In case we have a shadow surface on shutdown release it so it doesn't leak. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 38d6b596094d

[PATCH v6 04/10] drm/qxl: unpin release objects

2021-02-04 Thread Gerd Hoffmann
Balances the qxl_create_bo(..., pinned=true, ...); call in qxl_release_bo_alloc(). Signed-off-by: Gerd Hoffmann Acked-by: Thomas Zimmermann --- drivers/gpu/drm/qxl/qxl_release.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/qxl/qxl_release.c b/drivers/gpu/drm/qxl

Re: [PATCH V2] virtio_input: Prevent EV_MSC/MSC_TIMESTAMP loop storm for MT.

2021-02-03 Thread Gerd Hoffmann
ach new frame becomes larger and larger. > + * Disable EV_MSC/MSC_TIMESTAMP forwarding for MT. > + */ > + if (vi->idev->mt && type == EV_MSC && code == MSC_TIMESTAMP) > + return 0; > + Reviewed-by: Gerd Hoffmann take care, Gerd

Re: [PATCH RESEND v3] virtio-input: add multi-touch support

2021-02-03 Thread Gerd Hoffmann
1 file changed, 10 insertions(+), 1 deletion(-) Have no test hardware, the logic looks sane though. Reviewed-by: Gerd Hoffmann take care, Gerd

[PATCH v5 3/6] drm/qxl: release shadow on shutdown

2021-02-03 Thread Gerd Hoffmann
In case we have a shadow surface on shutdown release it so it doesn't leak. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 38d6b596094d

[PATCH v5 5/6] drm/qxl: properly free qxl releases

2021-02-03 Thread Gerd Hoffmann
Reorganize qxl_device_fini() a bit. Add missing unpin() calls. Count releases. Add wait queue for releases. That way qxl_device_fini() can easily wait until everything is ready for proper shutdown. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.h | 2 ++ drivers/gpu/drm

[PATCH v5 4/6] drm/qxl: handle shadow in primary destroy

2021-02-03 Thread Gerd Hoffmann
qxl_primary_atomic_disable must check whenever the framebuffer bo has a shadow surface and in case it has check the shadow primary status. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_display.c

[PATCH v5 1/6] drm/qxl: use drmm_mode_config_init

2021-02-03 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel Vetter Acked-by: Thomas Zimmermann --- drivers/gpu/drm/qxl/qxl_display.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 012bce0cdb65

[PATCH v5 6/6] drm/qxl: simplify qxl_fence_wait

2021-02-03 Thread Gerd Hoffmann
Now that we have the new release_event wait queue we can just use that in qxl_fence_wait() and simplify the code alot. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_release.c | 42 +++ 1 file changed, 4 insertions(+), 38 deletions(-) diff --git a/drivers

[PATCH v5 2/6] drm/qxl: unpin release objects

2021-02-03 Thread Gerd Hoffmann
Balances the qxl_create_bo(..., pinned=true, ...); call in qxl_release_bo_alloc(). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_release.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/qxl/qxl_release.c b/drivers/gpu/drm/qxl/qxl_release.c index c52412724c26

Re: [PATCH v4 5/5] drm/qxl: properly free qxl releases

2021-02-03 Thread Gerd Hoffmann
> > + /* > > +* Ask host to release resources (+fill release ring), > > +* then wait for the release actually happening. > > +*/ > > + qxl_io_notify_oom(qdev); > > + for (try = 0; try < 20 && atomic_read(>release_count) > 0; try++) > > + msleep(20); > > A bit icky, why

[PATCH v4 3/5] drm/qxl: release shadow on shutdown

2021-01-26 Thread Gerd Hoffmann
In case we have a shadow surface on shutdown release it so it doesn't leak. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 38d6b596094d

[PATCH v4 5/5] drm/qxl: properly free qxl releases

2021-01-26 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.h | 1 + drivers/gpu/drm/qxl/qxl_kms.c | 22 -- drivers/gpu/drm/qxl/qxl_release.c | 2 ++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_drv.h b/drivers/gpu/drm/qxl

[PATCH v4 1/5] drm/qxl: use drmm_mode_config_init

2021-01-26 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel Vetter Acked-by: Thomas Zimmermann --- drivers/gpu/drm/qxl/qxl_display.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 012bce0cdb65

[PATCH v4 4/5] drm/qxl: handle shadow in primary destroy

2021-01-26 Thread Gerd Hoffmann
qxl_primary_atomic_disable must check whenever the framebuffer bo has a shadow surface and in case it has check the shadow primary status. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_display.c

[PATCH v4 2/5] drm/qxl: unpin release objects

2021-01-26 Thread Gerd Hoffmann
Balances the qxl_create_bo(..., pinned=true, ...); call in qxl_release_bo_alloc(). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_release.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/qxl/qxl_release.c b/drivers/gpu/drm/qxl/qxl_release.c index c52412724c26

Re: [PATCH v3 2/4] drm/qxl: unpin release objects

2021-01-25 Thread Gerd Hoffmann
t; to 0 kinda defeats the warning. Figured the unpin is at the completely wrong place while trying to reproduce the lockdep splat ... take care, Gerd >From 43befab4a935114e8620af62781666fa81288255 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 25 Jan 2021 13:10:50 +0100 Subject: [PATCH

Re: [PATCH v3 2/4] drm/qxl: unpin release objects

2021-01-22 Thread Gerd Hoffmann
On Fri, Jan 22, 2021 at 09:13:42AM +0100, Thomas Zimmermann wrote: > Hi > > Am 20.01.21 um 12:12 schrieb Gerd Hoffmann: > > Balances the qxl_create_bo(..., pinned=true, ...); > > call in qxl_release_bo_alloc(). > > > > Signed-off-by: Gerd Hoffmann > > ---

Re: [PATCH v2] drm/virtio: Track total GPU memory for virtio driver

2021-01-21 Thread Gerd Hoffmann
On Wed, Jan 20, 2021 at 10:52:11AM -0800, Yiwei Zhang wrote: > On Wed, Jan 20, 2021 at 5:33 AM Gerd Hoffmann wrote: > > > > Hi, > > > > > > > > > + select TRACE_GPU_MEM > > > > > > > > > +#ifdef CONFIG_TRACE_GPU_MEM >

Re: [PATCH v2] drm/virtio: Track total GPU memory for virtio driver

2021-01-20 Thread Gerd Hoffmann
Hi, > > > > > + select TRACE_GPU_MEM > > > > > +#ifdef CONFIG_TRACE_GPU_MEM That doesn't make sense btw. > > > > > +#ifdef CONFIG_TRACE_GPU_MEM > > > > > +static inline void virtio_gpu_trace_total_mem(struct > > > > > virtio_gpu_device *vgdev, > > > > > +

[PATCH v3 1/4] drm/qxl: use drmm_mode_config_init

2021-01-20 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel Vetter --- drivers/gpu/drm/qxl/qxl_display.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 012bce0cdb65..38d6b596094d 100644 --- a/drivers/gpu

[PATCH v3 3/4] drm/qxl: release shadow on shutdown

2021-01-20 Thread Gerd Hoffmann
In case we have a shadow surface on shutdown release it so it doesn't leak. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 38d6b596094d

[PATCH v3 2/4] drm/qxl: unpin release objects

2021-01-20 Thread Gerd Hoffmann
Balances the qxl_create_bo(..., pinned=true, ...); call in qxl_release_bo_alloc(). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_release.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/qxl/qxl_release.c b/drivers/gpu/drm/qxl/qxl_release.c index 0fcfc952d5e9

[PATCH v3 4/4] drm/qxl: handle shadow in primary destroy

2021-01-20 Thread Gerd Hoffmann
qxl_primary_atomic_disable must check whenever the framebuffer bo has a shadow surface and in case it has check the shadow primary status. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_display.c

Re: [PATCH] drivers: gpu: drm: virtio: fix dependency of DRM_VIRTIO_GPU on VIRTIO

2020-12-22 Thread Gerd Hoffmann
On Fri, Dec 04, 2020 at 02:12:21PM +0100, Enrico Weigelt, metux IT consult wrote: > VIRTIO itself has no dependencies and therefore can easily be just > select'ed, instead of depending on it. The current depends on causes > any others trying to select VIRTIO to fail like this: > >

Re: [PATCH -next] drm/virtio: Make virtgpu_dmabuf_ops with static keyword

2020-11-15 Thread Gerd Hoffmann
On Sat, Nov 14, 2020 at 03:16:13PM +0800, Zou Wei wrote: > Fix the following sparse warning: > > ./virtgpu_prime.c:46:33: warning: symbol 'virtgpu_dmabuf_ops' was not > declared. Should it be static? Pushed to drm-misc-next. thanks, Gerd

Re: [PATCH] drm/qxl: replace idr_init() by idr_init_base()

2020-11-06 Thread Gerd Hoffmann
On Fri, Nov 06, 2020 at 12:20:16AM +0530, Deepak R Varma wrote: > idr_init() uses base 0 which is an invalid identifier for this driver. > The idr_alloc for this driver uses 1 as start value for ID range. The > new function idr_init_base allows IDR to set the ID lookup from base 1. > This avoids

Re: [PATCH] drm/virtio: use kvmalloc for large allocations

2020-11-05 Thread Gerd Hoffmann
On Thu, Nov 05, 2020 at 04:00:54PM +0900, Sergey Senozhatsky wrote: > Hi, > > On (20/11/05 07:52), Gerd Hoffmann wrote: > > > - *ents = kmalloc_array(*nents, sizeof(struct virtio_gpu_mem_entry), > > > - GFP_KERNEL); > >

Re: [PATCH] drm/virtio: use kvmalloc for large allocations

2020-11-04 Thread Gerd Hoffmann
Hi, > - *ents = kmalloc_array(*nents, sizeof(struct virtio_gpu_mem_entry), > - GFP_KERNEL); > + *ents = kvmalloc_array(*nents, > +sizeof(struct virtio_gpu_mem_entry), > +GFP_KERNEL); Shouldn't that be

Re: [PATCH v3 25/32] drm: kernel-doc: add description for a new function parameter

2020-10-27 Thread Gerd Hoffmann
he new parameter. > > Fixes: 707d561f77b5 ("drm: allow limiting the scatter list size.") > Signed-off-by: Mauro Carvalho Chehab Acked-by: Gerd Hoffmann > --- > drivers/gpu/drm/drm_prime.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpu/drm/

[PATCH v2 4/4] drm/qxl: use qxl pin function

2020-09-29 Thread Gerd Hoffmann
Otherwise ttm throws a WARN because we try to pin without a reservation. Fixes: 9d36d4320462 ("drm/qxl: switch over to the new pin interface") Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drive

[PATCH v2 2/4] drm/qxl: release shadow on shutdown

2020-09-29 Thread Gerd Hoffmann
In case we have a shadow surface on shutdown release it so it doesn't leak. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 5bef8f121e54

[PATCH v2 1/4] drm/qxl: use drmm_mode_config_init

2020-09-29 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel Vetter --- drivers/gpu/drm/qxl/qxl_display.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 65de1f69af58..5bef8f121e54 100644 --- a/drivers/gpu

[PATCH v2 3/4] drm/qxl: handle shadow in primary destroy

2020-09-29 Thread Gerd Hoffmann
qxl_primary_atomic_disable must check whenever the framebuffer bo has a shadow surface and in case it has check the shadow primary status. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_display.c

Re: [PATCH -next] drm/qxl: simplify the return expression of qxl_plane_prepare_fb()

2020-09-29 Thread Gerd Hoffmann
On Mon, Sep 21, 2020 at 09:10:22PM +0800, Qinglang Miao wrote: > Simplify the return expression. Pushed to drm-misc-next. thanks, Gerd

Re: [PATCH v2 0/3] KVM: x86: KVM_MEM_PCI_HOLE memory

2020-09-18 Thread Gerd Hoffmann
Hi, > > We could probably wire up ecam (arm/virt style) for pcie support, once > > the acpi support for mictovm finally landed (we need acpi for that > > because otherwise the kernel wouldn't find the pcie bus). > > > > Question is whenever there is a good reason to do so. Why would someone >

Re: [PATCH v2 0/3] KVM: x86: KVM_MEM_PCI_HOLE memory

2020-09-18 Thread Gerd Hoffmann
Hi, > I see a similar ~8k PCI hole reads with a -kernel boot w/ OVMF. All but 60 > of those are from pcibios_fixup_peer_bridges(), and all are from the kernel. pcibios_fixup_peer_bridges() looks at pcibios_last_bus, and that in turn seems to be set according to the mmconfig size (in

Re: [PATCH] drm/virtio: drop quirks handling

2020-09-08 Thread Gerd Hoffmann
On Tue, Sep 08, 2020 at 10:57:21AM +0200, Daniel Vetter wrote: > On Tue, Sep 08, 2020 at 08:47:41AM +0200, Gerd Hoffmann wrote: > > These days dma ops can be overridden per device, and the virtio core > > "can be overridden" or "are"? Didn't happen yet, so scra

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

2020-09-08 Thread Gerd Hoffmann
> > > The comments I've found suggest very much not ... Or is that all very > > > old stuff only that no one cares about anymore? > > > > I think these days it is possible to override dma_ops per device, which > > in turn allows virtio to deal with the quirks without the rest of the > > kernel

[PATCH 3/3] drm/qxl: handle shadow in primary destroy

2020-09-08 Thread Gerd Hoffmann
qxl_primary_atomic_disable must check whenever the framebuffer bo has a shadow surface and in case it has check the shadow primary status. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_display.c

[PATCH 1/3] drm/qxl: use drmm_mode_config_init

2020-09-08 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index fa79688013b7..4be04eaf7f37 100644 --- a/drivers/gpu/drm/qxl/qxl_display.c +++ b

[PATCH 2/3] drm/qxl: release shadow on shutdown

2020-09-08 Thread Gerd Hoffmann
In case we have a shadow surface on shutdown release it so it doesn't leak. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 4be04eaf7f37

[PATCH 2/3] drm/virtio: return virtio_gpu_queue errors

2020-09-08 Thread Gerd Hoffmann
In case queuing virtio commands fails (can happen when the device got unplugged) pass up the error. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_vq.c | 36 +++-- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/virtio

[PATCH 3/3] drm/virtio: add virtio_gpu_cmd_unref_resource error handling

2020-09-08 Thread Gerd Hoffmann
shutdown. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_vq.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c index b1884e6e242c..4d2325bf4aed 100644 --- a/drivers/gpu/drm/virtio

[PATCH 1/3] drm/virtio: use drmm_mode_config_init

2020-09-08 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 2 +- drivers/gpu/drm/virtio/virtgpu_display.c | 11 +++ drivers/gpu/drm/virtio/virtgpu_kms.c | 6 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h

[PATCH] drm/virtio: drop quirks handling

2020-09-08 Thread Gerd Hoffmann
. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_object.c | 19 ++- drivers/gpu/drm/virtio/virtgpu_vq.c | 16 ++-- 2 files changed, 12 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_object.c b/drivers/gpu/drm/virtio

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

2020-09-07 Thread Gerd Hoffmann
On Mon, Sep 07, 2020 at 03:53:02PM +0200, Daniel Vetter wrote: > On Mon, Sep 7, 2020 at 1:24 PM Gerd Hoffmann wrote: > > > > Add drm_device argument to drm_prime_pages_to_sg(), so we can > > call dma_max_mapping_size() to figure the segment size limit > > and call into

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

2020-09-07 Thread Gerd Hoffmann
segment size limits so far ... v2: place max_segment in drm driver not gem object. v3: move max_segment next to the other gem fields. v4: just use dma_max_mapping_size(). Signed-off-by: Gerd Hoffmann --- include/drm/drm_prime.h | 3 ++- drivers/gpu/drm/amd/amdgpu

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

2020-09-07 Thread Gerd Hoffmann
> > + /** > > +* @max_segment: > > +* > > +* Max size for scatter list segments. When unset the default > > +* (SCATTERLIST_MAX_SEGMENT) is used. > > +*/ > > + size_t max_segment; > > Is there no better place for this then "at the bottom"? drm_device is a > huge

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

2020-09-07 Thread Gerd Hoffmann
in drm driver not gem object. v3: move max_segment next to the other gem fields. Signed-off-by: Gerd Hoffmann --- include/drm/drm_device.h| 8 include/drm/drm_prime.h | 3 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c | 3 ++- drivers/gpu/drm

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

2020-09-07 Thread Gerd Hoffmann
When initializing call virtio_max_dma_size() to figure the scatter list limit. Needed to make virtio-gpu work properly with SEV. v2: place max_segment in drm driver not gem object. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_kms.c | 1 + 1 file changed, 1 insertion

Re: [PATCH v2 0/3] KVM: x86: KVM_MEM_PCI_HOLE memory

2020-09-04 Thread Gerd Hoffmann
Hi, > Unless I'm mistaken, microvm doesn't even support PCI, does it? Correct, no pci support right now. We could probably wire up ecam (arm/virt style) for pcie support, once the acpi support for mictovm finally landed (we need acpi for that because otherwise the kernel wouldn't find the

Re: [PATCH v2 0/3] KVM: x86: KVM_MEM_PCI_HOLE memory

2020-09-04 Thread Gerd Hoffmann
Hi, > attached. Though those should be far less than 8000+, and those should also > be > pio rather than mmio. Well, seabios 1.14 (qemu 5.1) added mmio support (to speed up boot a little bit, mmio is one and pio is two vmexits). Depends on q35 obviously, and a few pio accesses remain b/c

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

2020-08-28 Thread Gerd Hoffmann
On Mon, Aug 24, 2020 at 09:24:40AM +0200, Jiri Slaby wrote: > On 18. 08. 20, 9:25, Gerd Hoffmann wrote: > > When going through a disable/enable cycle without changing the > > framebuffer the optimization added by commit 3954ff10e06e ("drm/virtio: > > skip set_scanout if

Re: [PATCH] drm: virtio: fix kconfig dependency warning

2020-08-28 Thread Gerd Hoffmann
Hi, > config DRM_VIRTIO_GPU > tristate "Virtio GPU driver" > - depends on DRM && VIRTIO && MMU > + depends on DRM && VIRTIO_MENU && MMU Shouldn't this depend on both VIRTIO and VIRTIO_MENU, simliar to the other virtio drivers? take care, Gerd

Re: [PATCH v3 30/38] virtio_input: convert to LE accessors

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

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

2020-08-18 Thread Gerd Hoffmann
When initializing call virtio_max_dma_size() to figure the scatter list limit. Needed to make virtio-gpu work properly with SEV. v2: place max_segment in drm driver not gem object. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_kms.c | 1 + 1 file changed, 1 insertion

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

2020-08-18 Thread Gerd Hoffmann
in drm driver not gem object. Signed-off-by: Gerd Hoffmann --- include/drm/drm_device.h| 8 include/drm/drm_prime.h | 3 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c | 3 ++- drivers/gpu/drm/drm_gem_shmem_helper.c | 3 ++- drivers/gpu/drm

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   3   4   5   6   7   8   9   10   >