Commit 88079006 authored by Christian König's avatar Christian König Committed by Alex Deucher

drm/amdgpu: wake up scheduler only when neccessary

Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Reviewed-by: default avatarJammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: default avatarChunming Zhou <david1.zhou@amd.com>
parent 062c7fb3
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
#include <drm/drmP.h> #include <drm/drmP.h>
#include "gpu_scheduler.h" #include "gpu_scheduler.h"
static void amd_sched_wakeup(struct amd_gpu_scheduler *sched);
/* Initialize a given run queue struct */ /* Initialize a given run queue struct */
static void amd_sched_rq_init(struct amd_sched_rq *rq) static void amd_sched_rq_init(struct amd_sched_rq *rq)
{ {
...@@ -209,7 +211,7 @@ static bool amd_sched_entity_in(struct amd_sched_job *job) ...@@ -209,7 +211,7 @@ static bool amd_sched_entity_in(struct amd_sched_job *job)
/* first job wakes up scheduler */ /* first job wakes up scheduler */
if (first) if (first)
wake_up_interruptible(&job->sched->wait_queue); amd_sched_wakeup(job->sched);
return added; return added;
} }
...@@ -249,6 +251,15 @@ static bool amd_sched_ready(struct amd_gpu_scheduler *sched) ...@@ -249,6 +251,15 @@ static bool amd_sched_ready(struct amd_gpu_scheduler *sched)
sched->hw_submission_limit; sched->hw_submission_limit;
} }
/**
* Wake up the scheduler when it is ready
*/
static void amd_sched_wakeup(struct amd_gpu_scheduler *sched)
{
if (amd_sched_ready(sched))
wake_up_interruptible(&sched->wait_queue);
}
/** /**
* Select next entity containing real IB submissions * Select next entity containing real IB submissions
*/ */
......
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