From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: Re: [PATCH 3/5] drm/i915/contexts: Switch to default on resume Date: Wed, 15 Aug 2012 10:18:01 +0100 Message-ID: <1345022292_97153@CP5-2952> References: <1344980117-1993-1-git-send-email-ben@bwidawsk.net> <1344980117-1993-4-git-send-email-ben@bwidawsk.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from fireflyinternet.com (smtp.fireflyinternet.com [109.228.6.236]) by gabe.freedesktop.org (Postfix) with ESMTP id 2268F9E814 for ; Wed, 15 Aug 2012 02:18:17 -0700 (PDT) In-Reply-To: <1344980117-1993-4-git-send-email-ben@bwidawsk.net> 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: intel-gfx@lists.freedesktop.org Cc: Ben Widawsky List-Id: intel-gfx@lists.freedesktop.org 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 -- Chris Wilson, Intel Open Source Technology Centre