[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230822180208.95556-11-robdclark@gmail.com>
Date: Tue, 22 Aug 2023 11:01:57 -0700
From: Rob Clark <robdclark@...il.com>
To: dri-devel@...ts.freedesktop.org
Cc: linux-arm-msm@...r.kernel.org, freedreno@...ts.freedesktop.org,
Rob Clark <robdclark@...omium.org>,
Luben Tuikov <luben.tuikov@....com>,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>,
linux-kernel@...r.kernel.org (open list)
Subject: [PATCH v5 10/11] drm/sched: Add (optional) fence signaling annotation
From: Rob Clark <robdclark@...omium.org>
Based on
https://lore.kernel.org/dri-devel/20200604081224.863494-10-daniel.vetter@ffwll.ch/
but made to be optional.
Signed-off-by: Rob Clark <robdclark@...omium.org>
Reviewed-by: Luben Tuikov <luben.tuikov@....com>
---
drivers/gpu/drm/scheduler/sched_main.c | 9 +++++++++
include/drm/gpu_scheduler.h | 2 ++
2 files changed, 11 insertions(+)
diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c
index 23afd70e41ea..6dda18639ac9 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -1018,10 +1018,15 @@ static bool drm_sched_blocked(struct drm_gpu_scheduler *sched)
static int drm_sched_main(void *param)
{
struct drm_gpu_scheduler *sched = (struct drm_gpu_scheduler *)param;
+ const bool fence_signalling = sched->fence_signalling;
+ bool fence_cookie;
int r;
sched_set_fifo_low(current);
+ if (fence_signalling)
+ fence_cookie = dma_fence_begin_signalling();
+
while (!kthread_should_stop()) {
struct drm_sched_entity *entity = NULL;
struct drm_sched_fence *s_fence;
@@ -1077,6 +1082,10 @@ static int drm_sched_main(void *param)
wake_up(&sched->job_scheduled);
}
+
+ if (fence_signalling)
+ dma_fence_end_signalling(fence_cookie);
+
return 0;
}
diff --git a/include/drm/gpu_scheduler.h b/include/drm/gpu_scheduler.h
index e95b4837e5a3..58d958ad31a1 100644
--- a/include/drm/gpu_scheduler.h
+++ b/include/drm/gpu_scheduler.h
@@ -493,6 +493,7 @@ struct drm_sched_backend_ops {
* @ready: marks if the underlying HW is ready to work
* @free_guilty: A hit to time out handler to free the guilty job.
* @dev: system &struct device
+ * @fence_signalling: Opt in to fence signalling annotations
*
* One scheduler is implemented for each hardware ring.
*/
@@ -517,6 +518,7 @@ struct drm_gpu_scheduler {
bool ready;
bool free_guilty;
struct device *dev;
+ bool fence_signalling;
};
int drm_sched_init(struct drm_gpu_scheduler *sched,
--
2.41.0
Powered by blists - more mailing lists