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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
Cc: Danilo Krummrich <dakr@xxxxxxxxxx>
Cc: Luben Tuikov <ltuikov89@xxxxxxxxx>
Cc: Dave Airlie <airlied@xxxxxxxxxx>
Cc: Simona Vetter <simona.vetter@xxxxxxxx>
Cc: Christian Koenig <christian.koenig@xxxxxxx>
Signed-off-by: Matthew Brost <matthew.brost@xxxxxxxxx>
---
 drivers/gpu/drm/scheduler/sched_main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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);
 
-- 
2.34.1




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux