mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-13 14:24:11 +08:00
drm/sched: Add a helper to queue TDR immediately
Add a helper whereby a driver can invoke TDR immediately. v2: - Drop timeout args, rename function, use mod delayed work (Luben) v3: - s/XE/Xe (Luben) - present tense in commit message (Luben) - Adjust comment for drm_sched_tdr_queue_imm (Luben) v4: - Adjust commit message (Luben) Cc: Luben Tuikov <luben.tuikov@amd.com> Signed-off-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Luben Tuikov <luben.tuikov@amd.com> Link: https://lore.kernel.org/r/20231031032439.1558703-6-matthew.brost@intel.com Signed-off-by: Luben Tuikov <ltuikov89@gmail.com>
This commit is contained in:
parent
7a36dcfa16
commit
3c6c7ca450
@ -338,7 +338,7 @@ static void drm_sched_start_timeout(struct drm_gpu_scheduler *sched)
|
||||
|
||||
if (sched->timeout != MAX_SCHEDULE_TIMEOUT &&
|
||||
!list_empty(&sched->pending_list))
|
||||
queue_delayed_work(sched->timeout_wq, &sched->work_tdr, sched->timeout);
|
||||
mod_delayed_work(sched->timeout_wq, &sched->work_tdr, sched->timeout);
|
||||
}
|
||||
|
||||
static void drm_sched_start_timeout_unlocked(struct drm_gpu_scheduler *sched)
|
||||
@ -348,6 +348,22 @@ static void drm_sched_start_timeout_unlocked(struct drm_gpu_scheduler *sched)
|
||||
spin_unlock(&sched->job_list_lock);
|
||||
}
|
||||
|
||||
/**
|
||||
* drm_sched_tdr_queue_imm: - immediately start job timeout handler
|
||||
*
|
||||
* @sched: scheduler for which the timeout handling should be started.
|
||||
*
|
||||
* Start timeout handling immediately for the named scheduler.
|
||||
*/
|
||||
void drm_sched_tdr_queue_imm(struct drm_gpu_scheduler *sched)
|
||||
{
|
||||
spin_lock(&sched->job_list_lock);
|
||||
sched->timeout = 0;
|
||||
drm_sched_start_timeout(sched);
|
||||
spin_unlock(&sched->job_list_lock);
|
||||
}
|
||||
EXPORT_SYMBOL(drm_sched_tdr_queue_imm);
|
||||
|
||||
/**
|
||||
* drm_sched_fault - immediately start timeout handler
|
||||
*
|
||||
|
@ -557,6 +557,7 @@ 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_tdr_queue_imm(struct drm_gpu_scheduler *sched);
|
||||
void drm_sched_job_cleanup(struct drm_sched_job *job);
|
||||
void drm_sched_wakeup_if_can_queue(struct drm_gpu_scheduler *sched);
|
||||
bool drm_sched_wqueue_ready(struct drm_gpu_scheduler *sched);
|
||||
|
Loading…
Reference in New Issue
Block a user