[Intel-gfx] [PATCH 3/5] drm/i915/contexts: Switch to default on resume

Chris Wilson chris at chris-wilson.co.uk
Wed Aug 15 11:18:01 CEST 2012


On Tue, 14 Aug 2012 14:35:15 -0700, Ben Widawsky <ben at bwidawsk.net> wrote:
> In order to make the HW state CCID match with what we think it should
> be, we must order a switch to the default context.
> 
> The really sad thing here is that the switch can potentially fail, and
> as such we have to assume contexts no longer work. There is likely room
> for improvement but until we actually start seeing the case occur, I
> think it should be fine.
> 
> This was accidentally left this out of the first series, noticed by
> Chris Wilson.

However that do_switch() is a no-op as it spots that the
ring->last_ctx_obj is the DEFAULT_CONTEXT (saved across s&r) and we exit
early.

The only clean way I could see was to extract the actual set_switch
portion of do_switch() (i.e. discard the initial checks and pre-/post-op
pinning). Which brings you nicely into the next few patches...
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre



More information about the Intel-gfx mailing list