From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: matthew.auld@intel.com
Subject: Re: [PATCH 03/15] drm/i915/gt: Use caller provided forcewake for intel_mocs_init_engine
Date: Wed, 3 Jul 2019 12:23:52 +0100 [thread overview]
Message-ID: <629db077-98c1-d547-e665-2ec3cdac542d@linux.intel.com> (raw)
In-Reply-To: <20190703091726.11690-3-chris@chris-wilson.co.uk>
On 03/07/2019 10:17, Chris Wilson wrote:
> 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>
> ---
> 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);
> +
Assert is strictly speaking a bit weak since forcewake status can
theoretically change until the actual access below. But in our current
code we indeed hold it for the whole reset.
I don't have any actual ideas on how to fundamentally improve the
assert. Thought to have it after the writes is the only thing which came
to mind. Thoughts?
Regards,
Tvrtko
> 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);
> }
>
> /**
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-07-03 11:23 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-03 9:17 [PATCH 01/15] drm/i915/selftests: Common live setup/teardown Chris Wilson
2019-07-03 9:17 ` [PATCH 02/15] drm/i915/selftests: Lock the drm_mm while modifying Chris Wilson
2019-07-03 9:50 ` Matthew Auld
2019-07-03 9:17 ` [PATCH 03/15] drm/i915/gt: Use caller provided forcewake for intel_mocs_init_engine Chris Wilson
2019-07-03 11:23 ` Tvrtko Ursulin [this message]
2019-07-03 11:47 ` Chris Wilson
2019-07-03 12:01 ` Tvrtko Ursulin
2019-07-03 9:17 ` [PATCH 04/15] drm/i915/gt: Assume we hold forcewake for execlists resume Chris Wilson
2019-07-03 12:03 ` Tvrtko Ursulin
2019-07-03 9:17 ` [PATCH 05/15] drm/i915/gt: Ignore forcewake acquisition for posting_reads Chris Wilson
2019-07-03 11:26 ` Tvrtko Ursulin
2019-07-03 11:44 ` Chris Wilson
2019-07-03 9:17 ` [PATCH 06/15] drm/i915/gem: Free pages before rcu-freeing the object Chris Wilson
2019-07-03 10:37 ` Matthew Auld
2019-07-03 9:17 ` [PATCH 07/15] drm/i915: Markup potential lock for i915_active Chris Wilson
2019-07-03 10:38 ` Matthew Auld
2019-07-03 9:17 ` [PATCH 08/15] drm/i915: Mark up vma->active as safe for use inside shrinkers Chris Wilson
2019-07-03 10:53 ` Matthew Auld
2019-07-03 9:17 ` [PATCH 09/15] drm/i915/execlists: Hesitate before slicing Chris Wilson
2019-07-03 9:17 ` [PATCH 10/15] drm/i915: Teach execbuffer to take the engine wakeref not GT Chris Wilson
2019-07-03 9:17 ` [PATCH 11/15] drm/i915/gt: Track timeline activeness in enter/exit Chris Wilson
2019-07-03 9:17 ` [PATCH 12/15] drm/i915/gt: Convert timeline tracking to spinlock Chris Wilson
2019-07-03 9:17 ` [PATCH 13/15] drm/i915/gt: Guard timeline pinning with its own mutex Chris Wilson
2019-07-03 9:17 ` [PATCH 14/15] drm/i915: Protect request retirement with timeline->mutex Chris Wilson
2019-07-03 9:17 ` [PATCH 15/15] drm/i915: Replace struct_mutex for batch pool serialisation Chris Wilson
2019-07-03 9:41 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/15] drm/i915/selftests: Common live setup/teardown Patchwork
2019-07-03 9:47 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-07-03 9:48 ` [PATCH 01/15] " Matthew Auld
2019-07-03 10:04 ` Chris Wilson
2019-07-03 9:59 ` ✓ Fi.CI.BAT: success for series starting with [01/15] " Patchwork
2019-07-04 3:22 ` ✗ 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=629db077-98c1-d547-e665-2ec3cdac542d@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=matthew.auld@intel.com \
/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.