From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: "Volkin, Bradley D" <bradley.d.volkin@intel.com>
Cc: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 1/6] drm/i915: Reinitialize default context after reset
Date: Tue, 07 Oct 2014 17:54:54 +0300 [thread overview]
Message-ID: <87eguk0w1t.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20140919174615.GA2491@bdvolkin-ubuntu-desktop>
"Volkin, Bradley D" <bradley.d.volkin@intel.com> writes:
Hi Bradley,
> [snip]
>
> On Thu, Sep 18, 2014 at 07:58:30AM -0700, Mika Kuoppala wrote:
>> @@ -577,7 +596,7 @@ static int do_switch(struct intel_engine_cs *ring,
>> vma->bind_vma(vma, to->legacy_hw_ctx.rcs_state->cache_level, GLOBAL_BIND);
>> }
>>
>> - if (!to->legacy_hw_ctx.initialized || i915_gem_context_is_default(to))
>> + if (!to->initialized || i915_gem_context_is_default(to))
>> hw_flags |= MI_RESTORE_INHIBIT;
>>
>> ret = mi_set_context(ring, to, hw_flags);
>> @@ -618,26 +637,19 @@ static int do_switch(struct intel_engine_cs *ring,
>> /* obj is kept alive until the next request by its active ref */
>> i915_gem_object_ggtt_unpin(from->legacy_hw_ctx.rcs_state);
>> i915_gem_context_unreference(from);
>> - }
>>
>> - uninitialized = !to->legacy_hw_ctx.initialized && from == NULL;
>> - to->legacy_hw_ctx.initialized = true;
>> + /* We inherit the state from the previous context */
>> + to->initialized = true;
>> + }
>
> Regarding these two hunks, I may have asked this question before but if
> so I've forgotten the answer. Why do we want to set MI_RESTORE_INHIBIT
> when switching to the default context? Why do we want to inherit state
> from the previous context?
>
> I assumed that when switching to an initialized context we would always
> want to restore its last state.
>
I would have been pondering the same questions. Perhaps it has something
to do with the fact that default context should not assume anything
about its previous state and thus userspace needs to initialize
everything fully. And also to avoid the context switch performance
hit on restoring. Ben might know answer.
My plan is to experiment with making master copy of the first fully
initialized state and use it as a read-only bo to initialize all
subsequent contexts from. Atleast with the code, we could measure
the perf impact.
-Mika
next prev parent reply other threads:[~2014-10-07 14:56 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-18 14:58 [PATCH 0/6] RFC: Persistent workarounds across reset/resume Mika Kuoppala
2014-09-18 14:58 ` [PATCH 1/6] drm/i915: Reinitialize default context after reset Mika Kuoppala
2014-09-18 15:36 ` Chris Wilson
2014-09-19 15:43 ` Daniel Vetter
2014-09-19 17:46 ` Volkin, Bradley D
2014-10-07 14:54 ` Mika Kuoppala [this message]
2014-09-18 14:58 ` [PATCH 2/6] drm/i915: Reinitialize default context after resume Mika Kuoppala
2014-09-18 14:58 ` [PATCH 3/6] drm/i915: Disable render idle on user forcewake Mika Kuoppala
2014-09-18 15:30 ` Chris Wilson
2014-09-18 15:54 ` Mika Kuoppala
2014-09-18 16:03 ` Chris Wilson
2014-09-18 17:05 ` Ville Syrjälä
2014-09-18 14:58 ` [PATCH 4/6] drm/i915: Build workaround list in ring initialization Mika Kuoppala
2014-09-19 15:49 ` Daniel Vetter
2014-09-18 14:58 ` [PATCH 5/6] drm/i915: Add ivb workarounds into the wa list Mika Kuoppala
2014-09-18 14:58 ` [PATCH 6/6] drm/i915: Check workaround status on dfs read time Mika Kuoppala
2014-09-18 15:18 ` [PATCH] tests/gem_workarounds: adapt to constant wa list from driver Mika Kuoppala
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=87eguk0w1t.fsf@gaia.fi.intel.com \
--to=mika.kuoppala@linux.intel.com \
--cc=bradley.d.volkin@intel.com \
--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