From: Christian König Date: Mon, 24 Aug 2015 12:29:40 +0000 (+0200) Subject: drm/amdgpu: wake up scheduler only when neccessary X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=88079006dc412c5d1676f9f6e9c4d72a209eb556;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git drm/amdgpu: wake up scheduler only when neccessary Signed-off-by: Christian König Acked-by: Alex Deucher Reviewed-by: Jammy Zhou Reviewed-by: Chunming Zhou --- diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c index ca22d9032477..414536557673 100644 --- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c +++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c @@ -27,6 +27,8 @@ #include #include "gpu_scheduler.h" +static void amd_sched_wakeup(struct amd_gpu_scheduler *sched); + /* Initialize a given run queue struct */ 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) /* first job wakes up scheduler */ if (first) - wake_up_interruptible(&job->sched->wait_queue); + amd_sched_wakeup(job->sched); return added; } @@ -249,6 +251,15 @@ static bool amd_sched_ready(struct amd_gpu_scheduler *sched) 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 */