public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH 1/4] drm/i915: Restore default render context after hw state reset
@ 2014-10-07 14:21 Mika Kuoppala
  2014-10-07 14:21 ` [PATCH 2/4] drm/i915: Reinitialize default context after resume Mika Kuoppala
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Mika Kuoppala @ 2014-10-07 14:21 UTC (permalink / raw)
  To: intel-gfx; +Cc: Daniel Vetter, miku

After reset or suspend, the hardware render context state
has been cleared to default values. If this is a first
switch after such event, we need to restore the state
to get back to pre reset state.

As the render context state contains the wa
registers, on bdw, this also effectively restores the
workarounds past reset/suspend. With older gens,
explicit reinitialization of some registers by driver is
still required.

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Brad Volkin <bradley.d.volkin@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
---
 drivers/gpu/drm/i915/i915_gem_context.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index a5221d8..e7fefd7 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -577,7 +577,8 @@ 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->legacy_hw_ctx.initialized ||
+	    (from != NULL && i915_gem_context_is_default(to)))
 		hw_flags |= MI_RESTORE_INHIBIT;
 
 	ret = mi_set_context(ring, to, hw_flags);
-- 
1.9.1

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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-10-21 21:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-07 14:21 [PATCH 1/4] drm/i915: Restore default render context after hw state reset Mika Kuoppala
2014-10-07 14:21 ` [PATCH 2/4] drm/i915: Reinitialize default context after resume Mika Kuoppala
2014-10-07 15:06   ` Chris Wilson
2014-10-07 14:21 ` [PATCH 3/4] drm/i915: Build workaround list in ring initialization Mika Kuoppala
2014-10-13 15:21   ` Siluvery, Arun
2014-10-20 16:13   ` Siluvery, Arun
2014-10-21 12:52     ` Daniel Vetter
2014-10-21 15:54   ` Mika Kuoppala
2014-10-07 14:21 ` [PATCH 4/4] drm/i915: Check workaround status on dfs read time Mika Kuoppala
2014-10-13 15:22   ` Siluvery, Arun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox