[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241022161825.228278-1-olvaffe@gmail.com>
Date: Tue, 22 Oct 2024 09:18:24 -0700
From: Chia-I Wu <olvaffe@...il.com>
To: boris.brezillon@...labora.com,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>,
Chunming Zhou <david1.zhou@....com>,
Christian König <christian.koenig@....com>,
Lionel Landwerlin <lionel.g.landwerlin@...el.com>,
dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Cc: faith.ekstrand@...labora.com
Subject: [PATCH v2] drm/syncobj: ensure progress for syncobj queries
Userspace might poll a syncobj with the query ioctl. Call
dma_fence_enable_sw_signaling to ensure dma_fence_is_signaled returns
true in finite time.
Fixes: 27b575a9aa2f ("drm/syncobj: add timeline payload query ioctl v6")
Signed-off-by: Chia-I Wu <olvaffe@...il.com>
---
v2: add Signed-off-by and Fixes tags
---
drivers/gpu/drm/drm_syncobj.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
index 4fcfc0b9b386c..58c5593c897a2 100644
--- a/drivers/gpu/drm/drm_syncobj.c
+++ b/drivers/gpu/drm/drm_syncobj.c
@@ -1689,6 +1689,9 @@ int drm_syncobj_query_ioctl(struct drm_device *dev, void *data,
DRM_SYNCOBJ_QUERY_FLAGS_LAST_SUBMITTED) {
point = fence->seqno;
} else {
+ /* ensure forward progress */
+ dma_fence_enable_sw_signaling(fence);
+
dma_fence_chain_for_each(iter, fence) {
if (iter->context != fence->context) {
dma_fence_put(iter);
--
2.47.0.105.g07ac214952-goog
Powered by blists - more mailing lists