@@ -1005,10 +1005,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;
@@ -1064,6 +1069,10 @@ static int drm_sched_main(void *param)
wake_up(&sched->job_scheduled);
}
+
+ if (fence_signalling)
+ dma_fence_end_signalling(fence_cookie);
+
return 0;
}
@@ -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,