Commit 8c23056b authored by Nirmoy Das's avatar Nirmoy Das Committed by Alex Deucher

drm/scheduler: do not keep a copy of sched list

entity should not keep copy and maintain sched list for
itself.
Signed-off-by: default avatarNirmoy Das <nirmoy.das@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent f880799d
...@@ -56,8 +56,6 @@ int drm_sched_entity_init(struct drm_sched_entity *entity, ...@@ -56,8 +56,6 @@ int drm_sched_entity_init(struct drm_sched_entity *entity,
unsigned int num_sched_list, unsigned int num_sched_list,
atomic_t *guilty) atomic_t *guilty)
{ {
int i;
if (!(entity && sched_list && (num_sched_list == 0 || sched_list[0]))) if (!(entity && sched_list && (num_sched_list == 0 || sched_list[0])))
return -EINVAL; return -EINVAL;
...@@ -67,22 +65,14 @@ int drm_sched_entity_init(struct drm_sched_entity *entity, ...@@ -67,22 +65,14 @@ int drm_sched_entity_init(struct drm_sched_entity *entity,
entity->guilty = guilty; entity->guilty = guilty;
entity->num_sched_list = num_sched_list; entity->num_sched_list = num_sched_list;
entity->priority = priority; entity->priority = priority;
entity->sched_list = kcalloc(num_sched_list, entity->sched_list = num_sched_list > 1 ? sched_list : NULL;
sizeof(struct drm_gpu_scheduler *), GFP_KERNEL); entity->last_scheduled = NULL;
if(!entity->sched_list) if(num_sched_list)
return -ENOMEM; entity->rq = &sched_list[0]->sched_rq[entity->priority];
init_completion(&entity->entity_idle); init_completion(&entity->entity_idle);
for (i = 0; i < num_sched_list; i++)
entity->sched_list[i] = sched_list[i];
if (num_sched_list)
entity->rq = &entity->sched_list[0]->sched_rq[entity->priority];
entity->last_scheduled = NULL;
spin_lock_init(&entity->rq_lock); spin_lock_init(&entity->rq_lock);
spsc_queue_init(&entity->job_queue); spsc_queue_init(&entity->job_queue);
...@@ -312,7 +302,6 @@ void drm_sched_entity_fini(struct drm_sched_entity *entity) ...@@ -312,7 +302,6 @@ void drm_sched_entity_fini(struct drm_sched_entity *entity)
dma_fence_put(entity->last_scheduled); dma_fence_put(entity->last_scheduled);
entity->last_scheduled = NULL; entity->last_scheduled = NULL;
kfree(entity->sched_list);
} }
EXPORT_SYMBOL(drm_sched_entity_fini); EXPORT_SYMBOL(drm_sched_entity_fini);
......
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