From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: Re: [PATCH 11/18] drm/i915: switch to default context on idle Date: Thu, 29 Mar 2012 21:28:10 +0100 Message-ID: <1333052905_146734@CP5-2952> References: <1332103198-25852-1-git-send-email-ben@bwidawsk.net> <1332103198-25852-12-git-send-email-ben@bwidawsk.net> <20120329192905.GE27737@phenom.ffwll.local> 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 CA82B9E9DC for ; Thu, 29 Mar 2012 13:28:29 -0700 (PDT) In-Reply-To: <20120329192905.GE27737@phenom.ffwll.local> 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: Daniel Vetter , Ben Widawsky Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Thu, 29 Mar 2012 21:29:05 +0200, Daniel Vetter wrote: > On Sun, Mar 18, 2012 at 01:39:51PM -0700, Ben Widawsky wrote: > > To keep things as sane as possible, switch to the default context before > > idling. This should help free context objects, as well as put things in > > a more well defined state before suspending. > > > > Signed-off-by: Ben Widawsky > > Context are yet another thing that will nicely fragment our global gtt > space. You don't pin them to mappable, which is a start, but I wonder > whether we should integrate this into our evict_something code? Although > that project is more involved with the current evict code, so maybe just > add a fixme. My suggestion for when we want to step beyond having the context pinned all the time was for a hook into unbind that checked to see if this was a "pinned" object and to fixup any registers to point back to the default. In the case of contexts, it would check a flag to see if it was indeed the active context and then schedule a change back to the default context prior to unbinding. From another viewpoint, this sounds alot like fences, and maybe we should add the tracking to the CXTID register in a similar manner. -Chris -- Chris Wilson, Intel Open Source Technology Centre