diff mbox series

[RFC,4/6] drm/sched: Teach scheduler about dma_fence_prempt type

Message ID 20241109172942.482630-5-matthew.brost@intel.com (mailing list archive)
State New, archived
Headers show
Series Common preempt fences and semantics | expand

Commit Message

Matthew Brost Nov. 9, 2024, 5:29 p.m. UTC
Update drm_sched_job_add_dependency to detect dma_fence_preempt and
correctly store it in the dedicated preemptive fence xarray ensuring
preempt fence semantics are followed.

Cc: Philipp Stanner <pstanner@redhat.com>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: Luben Tuikov <ltuikov89@gmail.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Simona Vetter <simona.vetter@ffwll.ch>
Cc: Christian Koenig <christian.koenig@amd.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
---
 drivers/gpu/drm/scheduler/sched_main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c
index eceb9b8c6f5f..607722364876 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -76,6 +76,7 @@ 
 #include <linux/sched.h>
 #include <linux/completion.h>
 #include <linux/dma-resv.h>
+#include <linux/dma-fence-preempt.h>
 #include <uapi/linux/sched/types.h>
 
 #include <drm/drm_print.h>
@@ -916,7 +917,8 @@  static int __drm_sched_job_add_dependency(struct drm_sched_job *job,
 int drm_sched_job_add_dependency(struct drm_sched_job *job,
 				 struct dma_fence *fence)
 {
-	return __drm_sched_job_add_dependency(job, fence, false);
+	return __drm_sched_job_add_dependency(job, fence,
+					      dma_fence_is_preempt(fence));
 }
 EXPORT_SYMBOL(drm_sched_job_add_dependency);