#include <drm/drmP.h>
#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)
{
/* first job wakes up scheduler */
if (first)
- wake_up_interruptible(&job->sched->wait_queue);
+ amd_sched_wakeup(job->sched);
return added;
}
}
/**
+ * 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
*/
static struct amd_sched_entity *