Commit 1774baa6 authored by Roy Sun's avatar Roy Sun Committed by Christian König

drm/scheduler: Change scheduled fence track v2

Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

v2 (chk): drop the flag check and improve the comment
Signed-off-by: default avatarDavid M Nieto <david.nieto@amd.com>
Signed-off-by: default avatarRoy Sun <Roy.Sun@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210426062701.39732-1-Roy.Sun@amd.com
parent 8f8bb68e
...@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched) ...@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
static struct drm_sched_job * static struct drm_sched_job *
drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched) drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
{ {
struct drm_sched_job *job; struct drm_sched_job *job, *next;
/* /*
* Don't destroy jobs while the timeout worker is running OR thread * Don't destroy jobs while the timeout worker is running OR thread
...@@ -690,6 +690,13 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched) ...@@ -690,6 +690,13 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
if (job && dma_fence_is_signaled(&job->s_fence->finished)) { if (job && dma_fence_is_signaled(&job->s_fence->finished)) {
/* remove job from pending_list */ /* remove job from pending_list */
list_del_init(&job->list); list_del_init(&job->list);
/* make the scheduled timestamp more accurate */
next = list_first_entry_or_null(&sched->pending_list,
typeof(*next), list);
if (next)
next->s_fence->scheduled.timestamp =
job->s_fence->finished.timestamp;
} else { } else {
job = NULL; job = NULL;
/* queue timeout for next job */ /* queue timeout for next job */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment