diff options
author | Matthew Brost <matthew.brost@intel.com> | 2021-06-18 03:06:33 +0200 |
---|---|---|
committer | Matt Roper <matthew.d.roper@intel.com> | 2021-06-19 00:13:20 +0200 |
commit | c4fd7d8cc3caa614ab492e0efc8854328f72b719 (patch) | |
tree | 6d86ebc7d662bd0ad2c4bab3ecd36b20ee5234ca /drivers/gpu/drm/i915/i915_scheduler.h | |
parent | drm/i915: Add i915_sched_engine_is_empty function (diff) | |
download | linux-c4fd7d8cc3caa614ab492e0efc8854328f72b719.tar.xz linux-c4fd7d8cc3caa614ab492e0efc8854328f72b719.zip |
drm/i915: Reset sched_engine.no_priolist immediately after dequeue
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
Diffstat (limited to 'drivers/gpu/drm/i915/i915_scheduler.h')
-rw-r--r-- | drivers/gpu/drm/i915/i915_scheduler.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_scheduler.h b/drivers/gpu/drm/i915/i915_scheduler.h index 5bec7b3b8456..713c38c99de9 100644 --- a/drivers/gpu/drm/i915/i915_scheduler.h +++ b/drivers/gpu/drm/i915/i915_scheduler.h @@ -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, |