[Intel-xe] [RFC PATCH 10/10] drm/syncobj: Warn on long running dma-fences

Matthew Brost matthew.brost at intel.com
Tue Apr 4 00:22:11 UTC 2023


Long running dma-fences are not allowed to be exported, a drm_syncobj is
designed to be exported to the user, so add a warn if drm_syncobj
install long running dna-fences as this is not allowed.

Signed-off-by: Matthew Brost <matthew.brsot at intel.com>
---
 drivers/gpu/drm/drm_syncobj.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
index 0c2be8360525..7c304cd7d037 100644
--- a/drivers/gpu/drm/drm_syncobj.c
+++ b/drivers/gpu/drm/drm_syncobj.c
@@ -291,6 +291,7 @@ void drm_syncobj_add_point(struct drm_syncobj *syncobj,
 	struct syncobj_wait_entry *cur, *tmp;
 	struct dma_fence *prev;
 
+	WARN_ON_ONCE(dma_fence_is_lr(fence));
 	dma_fence_get(fence);
 
 	spin_lock(&syncobj->lock);
@@ -325,8 +326,10 @@ void drm_syncobj_replace_fence(struct drm_syncobj *syncobj,
 	struct dma_fence *old_fence;
 	struct syncobj_wait_entry *cur, *tmp;
 
-	if (fence)
+	if (fence) {
+		WARN_ON_ONCE(dma_fence_is_lr(fence));
 		dma_fence_get(fence);
+	}
 
 	spin_lock(&syncobj->lock);
 
-- 
2.34.1



More information about the Intel-xe mailing list