From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH] drm/i915: Restore global mappings upon resume Date: Thu, 26 Sep 2013 23:59:37 +0200 Message-ID: <20130926215937.GA26592@phenom.ffwll.local> References: <1380183765-5719-1-git-send-email-chris@chris-wilson.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ea0-f180.google.com (mail-ea0-f180.google.com [209.85.215.180]) by gabe.freedesktop.org (Postfix) with ESMTP id 89268E7DEC for ; Thu, 26 Sep 2013 14:59:52 -0700 (PDT) Received: by mail-ea0-f180.google.com with SMTP id h10so825867eaj.25 for ; Thu, 26 Sep 2013 14:59:51 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1380183765-5719-1-git-send-email-chris@chris-wilson.co.uk> 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, Ben Widawsky List-Id: intel-gfx@lists.freedesktop.org On Thu, Sep 26, 2013 at 09:22:45AM +0100, Chris Wilson wrote: > commit c6916417c8575637659686ff0e4f744babf0cb4e > Author: Ben Widawsky > Date: Tue Sep 24 09:58:00 2013 -0700 > > drm/i915: Use the new vm [un]bind functions > > changes the interpretation of the bind routines, and in particular we > only bind into the global GTT if we pass a flag to the routine. So upon > resume, we need to ask for whatever we thing is bound into the global > GTT (cursors, fences, scanouts) to be rebound or else glorious > corruption ensues. > > v2.1: Clear the is-bound flags before attempting to rebind. > > Fixes: i-g-t/gem_suspend > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69834 > Signed-off-by: Chris Wilson > Cc: Ben Widawsky Merged with the aliasing clearing dropped as discussed on irc. -Daniel > --- > drivers/gpu/drm/i915/i915_gem_gtt.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c > index e053f14..55a8d87 100644 > --- a/drivers/gpu/drm/i915/i915_gem_gtt.c > +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c > @@ -508,8 +508,14 @@ void i915_gem_restore_gtt_mappings(struct drm_device *dev) > list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list) { > struct i915_vma *vma = i915_gem_obj_to_vma(obj, > &dev_priv->gtt.base); > + unsigned flags = obj->has_global_gtt_mapping ? GLOBAL_BIND : 0; > + > i915_gem_clflush_object(obj, obj->pin_display); > - vma->vm->bind_vma(vma, obj->cache_level, 0); > + > + obj->has_global_gtt_mapping = false; > + obj->has_aliasing_ppgtt_mapping = false; > + > + vma->vm->bind_vma(vma, obj->cache_level, flags); > } > > i915_gem_chipset_flush(dev); > -- > 1.8.4.rc3 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch