Commit b37aced3 authored by Nirmoy Das's avatar Nirmoy Das Committed by Alex Deucher

drm/scheduler: implement a function to modify sched list

Implement drm_sched_entity_modify_sched() which modifies existing
sched_list with a different one. This is going to be helpful when
userspace changes priority of a ctx/entity then the driver can switch
to the corresponding HW scheduler list for that priority.
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 33abcb1f
...@@ -83,6 +83,24 @@ int drm_sched_entity_init(struct drm_sched_entity *entity, ...@@ -83,6 +83,24 @@ int drm_sched_entity_init(struct drm_sched_entity *entity,
} }
EXPORT_SYMBOL(drm_sched_entity_init); EXPORT_SYMBOL(drm_sched_entity_init);
/**
* drm_sched_entity_modify_sched - Modify sched of an entity
* @entity: scheduler entity to init
* @sched_list: the list of new drm scheds which will replace
* existing entity->sched_list
* @num_sched_list: number of drm sched in sched_list
*/
void drm_sched_entity_modify_sched(struct drm_sched_entity *entity,
struct drm_gpu_scheduler **sched_list,
unsigned int num_sched_list)
{
WARN_ON(!num_sched_list || !sched_list);
entity->sched_list = sched_list;
entity->num_sched_list = num_sched_list;
}
EXPORT_SYMBOL(drm_sched_entity_modify_sched);
/** /**
* drm_sched_entity_is_idle - Check if entity is idle * drm_sched_entity_is_idle - Check if entity is idle
* *
......
...@@ -297,6 +297,10 @@ void drm_sched_fini(struct drm_gpu_scheduler *sched); ...@@ -297,6 +297,10 @@ void drm_sched_fini(struct drm_gpu_scheduler *sched);
int drm_sched_job_init(struct drm_sched_job *job, int drm_sched_job_init(struct drm_sched_job *job,
struct drm_sched_entity *entity, struct drm_sched_entity *entity,
void *owner); void *owner);
void drm_sched_entity_modify_sched(struct drm_sched_entity *entity,
struct drm_gpu_scheduler **sched_list,
unsigned int num_sched_list);
void drm_sched_job_cleanup(struct drm_sched_job *job); void drm_sched_job_cleanup(struct drm_sched_job *job);
void drm_sched_wakeup(struct drm_gpu_scheduler *sched); void drm_sched_wakeup(struct drm_gpu_scheduler *sched);
void drm_sched_stop(struct drm_gpu_scheduler *sched, struct drm_sched_job *bad); void drm_sched_stop(struct drm_gpu_scheduler *sched, struct drm_sched_job *bad);
......
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