Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: <intel-gfx@lists.freedesktop.org>, <dri-devel@lists.freedesktop.org>
Cc: daniel.vetter@intel.com
Subject: [Intel-gfx] [PATCH 3/9] drm/i915: Add i915_sched_engine_reset_on_empty function
Date: Thu,  3 Jun 2021 14:27:16 -0700	[thread overview]
Message-ID: <20210603212722.59719-4-matthew.brost@intel.com> (raw)
In-Reply-To: <20210603212722.59719-1-matthew.brost@intel.com>

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.

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_engine_pm.c            | 2 --
 drivers/gpu/drm/i915/gt/intel_execlists_submission.c | 1 +
 drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c    | 2 ++
 drivers/gpu/drm/i915/i915_scheduler.h                | 7 +++++++
 4 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_engine_pm.c b/drivers/gpu/drm/i915/gt/intel_engine_pm.c
index b6a00dd72808..1f07ac4e0672 100644
--- a/drivers/gpu/drm/i915/gt/intel_engine_pm.c
+++ b/drivers/gpu/drm/i915/gt/intel_engine_pm.c
@@ -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;
diff --git a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
index 2326a73af6d3..609753b5401a 100644
--- a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
+++ b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
@@ -1553,6 +1553,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
 	 * 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);
 
 	/*
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
index 5d00f2e3c1de..f4a6fbfaf82e 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
@@ -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);
 }
 
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,
-- 
2.28.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2021-06-03 21:09 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-03 21:27 [Intel-gfx] [PATCH 0/9] Introduce i915_sched_engine object Matthew Brost
2021-06-03 21:27 ` [Intel-gfx] [PATCH 1/9] drm/i915: Move priolist to new " Matthew Brost
2021-06-04 17:38   ` Jason Ekstrand
2021-06-04 17:35     ` Matthew Brost
2021-06-04 17:51       ` Jason Ekstrand
2021-06-04 17:51         ` Matthew Brost
2021-06-04 18:14           ` Jason Ekstrand
2021-06-03 21:27 ` [Intel-gfx] [PATCH 2/9] drm/i915: Add i915_sched_engine_is_empty function Matthew Brost
2021-06-04 17:50   ` Jason Ekstrand
2021-06-03 21:27 ` Matthew Brost [this message]
2021-06-04 18:31   ` [Intel-gfx] [PATCH 3/9] drm/i915: Add i915_sched_engine_reset_on_empty function Jason Ekstrand
2021-06-04 18:49     ` Matthew Brost
2021-06-03 21:27 ` [Intel-gfx] [PATCH 4/9] drm/i915: Move active tracking to i915_sched_engine Matthew Brost
2021-06-04 19:00   ` Jason Ekstrand
2021-06-04 19:12     ` Matthew Brost
2021-06-03 21:27 ` [Intel-gfx] [PATCH 5/9] drm/i915: Move engine->schedule " Matthew Brost
2021-06-04 19:03   ` Jason Ekstrand
2021-06-04 20:06     ` Matthew Brost
2021-06-03 21:27 ` [Intel-gfx] [PATCH 6/9] drm/i915: Add kick_backend function " Matthew Brost
2021-06-04 19:09   ` Jason Ekstrand
2021-06-04 19:19     ` Matthew Brost
2021-06-03 21:27 ` [Intel-gfx] [PATCH 7/9] drm/i915: Update i915_scheduler to operate on i915_sched_engine Matthew Brost
2021-06-04 19:17   ` Jason Ekstrand
2021-06-04 19:14     ` Matthew Brost
2021-06-03 21:27 ` [Intel-gfx] [PATCH 8/9] drm/i915: Move submission tasklet to i915_sched_engine Matthew Brost
2021-06-04 19:26   ` Jason Ekstrand
2021-06-04 19:55     ` Matthew Brost
2021-06-03 21:27 ` [Intel-gfx] [PATCH 9/9] drm/i915/doc: Add kernel doc for i915_sched_engine Matthew Brost
2021-06-04 17:20   ` Jason Ekstrand
2021-06-04 17:26     ` Matthew Brost
2021-06-03 23:32 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Introduce i915_sched_engine object (rev2) Patchwork
2021-06-03 23:37 ` [Intel-gfx] ✗ Fi.CI.DOCS: " Patchwork
2021-06-04  0:03 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-06-04  2:03 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210603212722.59719-4-matthew.brost@intel.com \
    --to=matthew.brost@intel.com \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox