]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/i915: Reset sched_engine.no_priolist immediately after dequeue
authorMatthew Brost <matthew.brost@intel.com>
Fri, 18 Jun 2021 01:06:33 +0000 (18:06 -0700)
committerMatt Roper <matthew.d.roper@intel.com>
Fri, 18 Jun 2021 22:13:20 +0000 (15:13 -0700)
Rather than touching schedule state in the generic PM code, reset the
priolist allocation when empty in the submission code. Add a wrapper
function to do this and update the backends to call it in the correct
place.

v3:
 (Jason Ekstrand)
  Update patch commit message with a better description

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210618010638.98941-4-matthew.brost@intel.com
drivers/gpu/drm/i915/gt/intel_engine_pm.c
drivers/gpu/drm/i915/gt/intel_execlists_submission.c
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
drivers/gpu/drm/i915/i915_scheduler.h

index b6a00dd72808525aac9a1b7df44ded7ecfbe0504..1f07ac4e0672a6d7e342a8cdc5e913a5c8e89eb2 100644 (file)
@@ -280,8 +280,6 @@ static int __engine_park(struct intel_wakeref *wf)
        if (engine->park)
                engine->park(engine);
 
-       engine->sched_engine->no_priolist = false;
-
        /* While gt calls i915_vma_parked(), we have to break the lock cycle */
        intel_gt_pm_put_async(engine->gt);
        return 0;
index e36b0e81876ad2d9b24382b8db32b2d1ad04eb59..47a43aafa39fdef2bed246dacf9a38da6419c46b 100644 (file)
@@ -1553,6 +1553,7 @@ done:
         * interrupt for secondary ports).
         */
        sched_engine->queue_priority_hint = queue_prio(sched_engine);
+       i915_sched_engine_reset_on_empty(sched_engine);
        spin_unlock(&engine->active.lock);
 
        /*
index d65a7665b38e53e38473fe03cc771714556502d8..9887a514a4d524b7b9dca77a41c7a8ae461575fb 100644 (file)
@@ -263,6 +263,8 @@ static void guc_submission_tasklet(struct tasklet_struct *t)
 
        __guc_dequeue(engine);
 
+       i915_sched_engine_reset_on_empty(engine->sched_engine);
+
        spin_unlock_irqrestore(&engine->active.lock, flags);
 }
 
index 5bec7b3b8456dabc868173b06774b76bf4515efa..713c38c99de94bf68d66b14fc69c8e0cabf8e773 100644 (file)
@@ -72,6 +72,13 @@ i915_sched_engine_is_empty(struct i915_sched_engine *sched_engine)
        return RB_EMPTY_ROOT(&sched_engine->queue.rb_root);
 }
 
+static inline void
+i915_sched_engine_reset_on_empty(struct i915_sched_engine *sched_engine)
+{
+       if (i915_sched_engine_is_empty(sched_engine))
+               sched_engine->no_priolist = false;
+}
+
 void i915_request_show_with_schedule(struct drm_printer *m,
                                     const struct i915_request *rq,
                                     const char *prefix,