public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/syncobj: ensure progress for syncobj queries
@ 2024-10-22 16:18 Chia-I Wu
  2024-10-22 16:53 ` Christian König
  0 siblings, 1 reply; 7+ messages in thread
From: Chia-I Wu @ 2024-10-22 16:18 UTC (permalink / raw)
  To: boris.brezillon, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter, Chunming Zhou,
	Christian König, Lionel Landwerlin, dri-devel, linux-kernel
  Cc: faith.ekstrand

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@gmail.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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-11-06 13:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-22 16:18 [PATCH v2] drm/syncobj: ensure progress for syncobj queries Chia-I Wu
2024-10-22 16:53 ` Christian König
2024-10-22 17:24   ` Chia-I Wu
2024-11-04 21:32     ` Chia-I Wu
     [not found]       ` <301110a2-c004-4385-9231-b9354904b5e0@amd.com>
2024-11-05 17:56         ` Chia-I Wu
2024-11-06  8:14           ` Boris Brezillon
     [not found]             ` <048c2dca-48fd-4627-ba0c-bc9daa17ac29@amd.com>
2024-11-06 13:12               ` Boris Brezillon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox