]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/sched: add DRM_SCHED_FENCE_DONT_PIPELINE flag
authorChristian König <christian.koenig@amd.com>
Fri, 7 Oct 2022 07:51:13 +0000 (09:51 +0200)
committerChristian König <christian.koenig@amd.com>
Wed, 19 Oct 2022 10:42:51 +0000 (12:42 +0200)
Setting this flag on a scheduler fence prevents pipelining of jobs
depending on this fence. In other words we always insert a full CPU
round trip before dependent jobs are pushed to the pipeline.

Signed-off-by: Christian König <christian.koenig@amd.com>
Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2113#note_1579296
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Luben Tuikov <luben.tuikov@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221014081553.114899-1-christian.koenig@amd.com
drivers/gpu/drm/scheduler/sched_entity.c
include/drm/gpu_scheduler.h

index 6b25b2f4f5a308185f5ca1777d47671e7f8dc864..6137537aaea4df7db983da2bbcf9700bc49ca2f1 100644 (file)
@@ -385,7 +385,8 @@ static bool drm_sched_entity_add_dependency_cb(struct drm_sched_entity *entity)
        }
 
        s_fence = to_drm_sched_fence(fence);
-       if (s_fence && s_fence->sched == sched) {
+       if (s_fence && s_fence->sched == sched &&
+           !test_bit(DRM_SCHED_FENCE_DONT_PIPELINE, &fence->flags)) {
 
                /*
                 * Fence is from the same scheduler, only need to wait for
index addb135eeea6227459e5247dfe382f6df239a12e..289a33e80639788d0e95b114d0aff0258a35d9db 100644 (file)
 
 #define MAX_WAIT_SCHED_ENTITY_Q_EMPTY msecs_to_jiffies(1000)
 
+/**
+ * DRM_SCHED_FENCE_DONT_PIPELINE - Prefent dependency pipelining
+ *
+ * Setting this flag on a scheduler fence prevents pipelining of jobs depending
+ * on this fence. In other words we always insert a full CPU round trip before
+ * dependen jobs are pushed to the hw queue.
+ */
+#define DRM_SCHED_FENCE_DONT_PIPELINE  DMA_FENCE_FLAG_USER_BITS
+
 struct drm_gem_object;
 
 struct drm_gpu_scheduler;