]> git.ipfire.org Git - thirdparty/linux.git/blobdiff - include/drm/gpu_scheduler.h
drm/sched: Convert the GPU scheduler to variable number of run-queues
[thirdparty/linux.git] / include / drm / gpu_scheduler.h
index f9544d9b670d33aee0114b85d5946684128d8175..653e0eec9743ecfa6c96f3cc26292c45b61aa67d 100644 (file)
@@ -472,7 +472,9 @@ struct drm_sched_backend_ops {
  * @hw_submission_limit: the max size of the hardware queue.
  * @timeout: the time after which a job is removed from the scheduler.
  * @name: name of the ring for which this scheduler is being used.
- * @sched_rq: priority wise array of run queues.
+ * @num_rqs: Number of run-queues. This is at most DRM_SCHED_PRIORITY_COUNT,
+ *           as there's usually one run-queue per priority, but could be less.
+ * @sched_rq: An allocated array of run-queues of size @num_rqs;
  * @wake_up_worker: the wait queue on which the scheduler sleeps until a job
  *                  is ready to be scheduled.
  * @job_scheduled: once @drm_sched_entity_do_release is called the scheduler
@@ -501,7 +503,8 @@ struct drm_gpu_scheduler {
        uint32_t                        hw_submission_limit;
        long                            timeout;
        const char                      *name;
-       struct drm_sched_rq             sched_rq[DRM_SCHED_PRIORITY_COUNT];
+       u32                             num_rqs;
+       struct drm_sched_rq             **sched_rq;
        wait_queue_head_t               wake_up_worker;
        wait_queue_head_t               job_scheduled;
        atomic_t                        hw_rq_count;
@@ -521,7 +524,7 @@ struct drm_gpu_scheduler {
 
 int drm_sched_init(struct drm_gpu_scheduler *sched,
                   const struct drm_sched_backend_ops *ops,
-                  uint32_t hw_submission, unsigned hang_limit,
+                  u32 num_rqs, uint32_t hw_submission, unsigned int hang_limit,
                   long timeout, struct workqueue_struct *timeout_wq,
                   atomic_t *score, const char *name, struct device *dev);