Skip to content

Commit ac4eb83

Browse files
drm/sched: select new rq even if there is only one v3
This is necessary when changing priorities of an entity. v2: test the sched_list instead of num_sched. v3: set the sched_list to NULL when there is only one entry Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Sonny Jiang <sonny.jiang@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210305125155.2312-1-christian.koenig@amd.com
1 parent a9cdf68 commit ac4eb83

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/gpu/drm/scheduler/sched_entity.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ void drm_sched_entity_select_rq(struct drm_sched_entity *entity)
453453
struct drm_gpu_scheduler *sched;
454454
struct drm_sched_rq *rq;
455455

456-
if (spsc_queue_count(&entity->job_queue) || entity->num_sched_list <= 1)
456+
if (spsc_queue_count(&entity->job_queue) || !entity->sched_list)
457457
return;
458458

459459
fence = READ_ONCE(entity->last_scheduled);
@@ -467,8 +467,10 @@ void drm_sched_entity_select_rq(struct drm_sched_entity *entity)
467467
drm_sched_rq_remove_entity(entity->rq, entity);
468468
entity->rq = rq;
469469
}
470-
471470
spin_unlock(&entity->rq_lock);
471+
472+
if (entity->num_sched_list == 1)
473+
entity->sched_list = NULL;
472474
}
473475

474476
/**

0 commit comments

Comments
 (0)