From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Widawsky Subject: Re: [PATCH 3/5] drm/i915/contexts: Switch to default on resume Date: Wed, 15 Aug 2012 08:58:31 -0700 Message-ID: References: <1344980117-1993-1-git-send-email-ben@bwidawsk.net> <1344980117-1993-4-git-send-email-ben@bwidawsk.net> <1345022292_97153@CP5-2952> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from shiva.chad-versace.us (209-20-75-48.static.cloud-ips.com [209.20.75.48]) by gabe.freedesktop.org (Postfix) with ESMTP id C7D329E9C4 for ; Wed, 15 Aug 2012 08:58:28 -0700 (PDT) In-Reply-To: <1345022292_97153@CP5-2952> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Chris Wilson Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On 2012-08-15 02:18, Chris Wilson wrote: > On Tue, 14 Aug 2012 14:35:15 -0700, Ben Widawsky > 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 Agreed, I was thinking re-ordering the series would just magically solve all such issues :-) -- Ben Widawsky, Intel Open Source Technology Center