All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 2/4] drm/i915/gt: Use caller provided forcewake for intel_mocs_init_engine
Date: Wed,  3 Jul 2019 16:52:23 +0100	[thread overview]
Message-ID: <20190703155225.9501-2-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20190703155225.9501-1-chris@chris-wilson.co.uk>

During post-reset resume, we call intel_mocs_init_engine to reinitialise
the MOCS registers. Suprisingly, especially when enhanced by lockdep,
the acquisition of the forcewake lock around each register write takes a
substantial portion of the reset time. We don't need to use the
individual forcewake here as we can assume that the caller is holding a
blanket forcewake for the reset&resume and the resume is serialised.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_mocs.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_mocs.c b/drivers/gpu/drm/i915/gt/intel_mocs.c
index ae6cbf0d517c..290a5e9b90b9 100644
--- a/drivers/gpu/drm/i915/gt/intel_mocs.c
+++ b/drivers/gpu/drm/i915/gt/intel_mocs.c
@@ -346,6 +346,9 @@ void intel_mocs_init_engine(struct intel_engine_cs *engine)
 	unsigned int index;
 	u32 unused_value;
 
+	/* Called under a blanket forcewake */
+	assert_forcewakes_active(uncore, FORCEWAKE_ALL);
+
 	if (!get_mocs_settings(gt, &table))
 		return;
 
@@ -355,16 +358,16 @@ void intel_mocs_init_engine(struct intel_engine_cs *engine)
 	for (index = 0; index < table.size; index++) {
 		u32 value = get_entry_control(&table, index);
 
-		intel_uncore_write(uncore,
-				   mocs_register(engine->id, index),
-				   value);
+		intel_uncore_write_fw(uncore,
+				      mocs_register(engine->id, index),
+				      value);
 	}
 
 	/* All remaining entries are also unused */
 	for (; index < table.n_entries; index++)
-		intel_uncore_write(uncore,
-				   mocs_register(engine->id, index),
-				   unused_value);
+		intel_uncore_write_fw(uncore,
+				      mocs_register(engine->id, index),
+				      unused_value);
 }
 
 /**
-- 
2.20.1

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

  reply	other threads:[~2019-07-03 15:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-03 15:52 [PATCH 1/4] drm/i915: Check caller held wakerefs in assert_forcewakes_active Chris Wilson
2019-07-03 15:52 ` Chris Wilson [this message]
2019-07-03 15:52 ` [PATCH 3/4] drm/i915/gt: Assume we hold forcewake for execlists resume Chris Wilson
2019-07-03 15:52 ` [PATCH 4/4] drm/i915/gt: Ignore forcewake acquisition for posting_reads Chris Wilson
2019-07-03 18:46 ` ✓ Fi.CI.BAT: success for series starting with [1/4] drm/i915: Check caller held wakerefs in assert_forcewakes_active Patchwork
2019-07-04  8:17 ` [PATCH v2] " Chris Wilson
2019-07-04  8:38   ` Tvrtko Ursulin
2019-07-04  9:26 ` ✗ Fi.CI.BAT: failure for series starting with [v2] drm/i915: Check caller held wakerefs in assert_forcewakes_active (rev2) Patchwork
2019-07-04  9:37 ` [PATCH v3] drm/i915: Check caller held wakerefs in assert_forcewakes_active Chris Wilson
2019-07-04 10:14 ` ✗ Fi.CI.BAT: failure for series starting with [v3] drm/i915: Check caller held wakerefs in assert_forcewakes_active (rev3) Patchwork
2019-07-04 10:20 ` [PATCH v4] drm/i915: Check caller held wakerefs in assert_forcewakes_active Chris Wilson
2019-07-04 12:12 ` ✓ Fi.CI.BAT: success for series starting with [v4] drm/i915: Check caller held wakerefs in assert_forcewakes_active (rev4) Patchwork
2019-07-04 22:46 ` ✗ Fi.CI.IGT: failure for series starting with [1/4] drm/i915: Check caller held wakerefs in assert_forcewakes_active Patchwork
2019-07-05 15:06 ` ✗ Fi.CI.IGT: failure for series starting with [v4] drm/i915: Check caller held wakerefs in assert_forcewakes_active (rev4) 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=20190703155225.9501-2-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.