From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 4/6] drm/i915: Record the default hw state after reset upon load
Date: Thu, 02 Nov 2017 16:26:19 +0200 [thread overview]
Message-ID: <1509632779.27999.16.camel@linux.intel.com> (raw)
In-Reply-To: <20171102124226.30086-5-chris@chris-wilson.co.uk>
On Thu, 2017-11-02 at 12:42 +0000, Chris Wilson wrote:
> Take a copy of the HW state after a reset upon module loading by
> executing a context switch from a blank context to the kernel context,
> thus saving the default hw state over the blank context image.
> We can then use the default hw state to initialise any future context,
> ensuring that each starts with the default view of hw state.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
<SNIP>
> @@ -795,11 +770,7 @@ static int do_rcs_switch(struct drm_i915_gem_request *req)
> return ret;
> }
>
> - if (!to->engine[RCS].initialised || i915_gem_context_is_default(to))
> - /* NB: If we inhibit the restore, the context is not allowed to
> - * die because future work may end up depending on valid address
> - * space. This means we must enforce that a page table load
> - * occur when this occurs. */
Maybe add a comment explaining that we never ever assume execution on
the kernel context, so we don't care about the register state.
> + if (i915_gem_context_is_kernel(to))
> hw_flags = MI_RESTORE_INHIBIT;
> else if (ppgtt && intel_engine_flag(engine) & ppgtt->pd_dirty_rings)
> hw_flags = MI_FORCE_RESTORE;
<SNIP>
> @@ -2193,11 +2184,28 @@ populate_lr_context(struct i915_gem_context *ctx,
> }
> ctx_obj->mm.dirty = true;
>
> + if (engine->default_state) {
> + void *defaults;
> +
> + defaults = i915_gem_object_pin_map(engine->default_state,
> + I915_MAP_WB);
> + if (IS_ERR(defaults))
> + return PTR_ERR(defaults);
> +
> + memcpy(vaddr + LRC_HEADER_PAGES * PAGE_SIZE,
> + defaults + LRC_HEADER_PAGES * PAGE_SIZE,
Could use somethingsomething_offset variable.
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Regards, Joonas
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-11-02 14:26 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-02 12:42 Context isolation Chris Wilson
2017-11-02 12:42 ` [PATCH 1/6] drm/i915: Force the switch to the i915->kernel_context Chris Wilson
2017-11-02 13:45 ` Joonas Lahtinen
2017-11-02 15:40 ` Mika Kuoppala
2017-11-02 15:45 ` Chris Wilson
2017-11-02 12:42 ` [PATCH 2/6] drm/i915: Move GT powersaving init to i915_gem_init() Chris Wilson
2017-11-02 13:46 ` Joonas Lahtinen
2017-11-02 14:35 ` Sagar Arun Kamble
2017-11-02 14:55 ` Chris Wilson
2017-11-02 15:38 ` Sagar Arun Kamble
2017-11-02 12:42 ` [PATCH 3/6] drm/i915: Inline intel_modeset_gem_init() Chris Wilson
2017-11-02 13:47 ` Joonas Lahtinen
2017-11-02 12:42 ` [PATCH 4/6] drm/i915: Record the default hw state after reset upon load Chris Wilson
2017-11-02 13:56 ` Mika Kuoppala
2017-11-02 14:10 ` Chris Wilson
2017-11-02 14:23 ` Ville Syrjälä
2017-11-02 14:37 ` Chris Wilson
2017-11-02 14:26 ` Joonas Lahtinen [this message]
2017-11-02 12:42 ` [PATCH 5/6] drm/i915: Remove redundant intel_autoenable_gt_powersave() Chris Wilson
2017-11-02 13:36 ` Joonas Lahtinen
2017-11-02 12:42 ` [PATCH 6/6] drm/i915: Stop caching the "golden" renderstate Chris Wilson
2017-11-02 14:43 ` Joonas Lahtinen
2017-11-02 14:54 ` Rodrigo Vivi
2017-11-02 14:56 ` Joonas Lahtinen
2017-11-02 22:36 ` Oscar Mateo
2017-11-02 23:34 ` Rodrigo Vivi
2017-11-02 23:36 ` Chris Wilson
2017-11-03 8:39 ` Joonas Lahtinen
2017-11-03 17:44 ` Rodrigo Vivi
2017-11-02 13:14 ` ✗ Fi.CI.BAT: failure for series starting with [1/6] drm/i915: Force the switch to the i915->kernel_context 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=1509632779.27999.16.camel@linux.intel.com \
--to=joonas.lahtinen@linux.intel.com \
--cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).