[Intel-gfx] [PATCH] drm/i915: restore ggtt double-bind avoidance

Daniel Vetter daniel at ffwll.ch
Thu Oct 15 03:12:35 PDT 2015


On Thu, Oct 15, 2015 at 09:48:26AM +0100, Chris Wilson wrote:
> On Thu, Oct 15, 2015 at 09:37:31AM +0200, Daniel Vetter wrote:
> > This was accidentally lost in
> > 
> > commit 75d04a3773ecee617847de963ae4195d6aa74c28
> > Author: Mika Kuoppala <mika.kuoppala at linux.intel.com>
> > Date:   Tue Apr 28 17:56:17 2015 +0300
> > 
> >     drm/i915/gtt: Allocate va range only if vma is not bound
> > 
> > While at it implement an improved version suggested by Chris which
> > avoids the double-bind irrespective of what type of bind is done
> > first.
> > 
> > Cc: Chris Wilson <chris at chris-wilson.co.uk>
> > Cc: Michel Thierry <michel.thierry at intel.com>
> > Cc: Mika Kuoppala <mika.kuoppala at intel.com>
> > Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_gem_gtt.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> > index a3910fb656e7..e90c062e1122 100644
> > --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> > +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> > @@ -2542,6 +2542,9 @@ static int ggtt_bind_vma(struct i915_vma *vma,
> >  					    cache_level, pte_flags);
> >  	}
> >  
> > +	if (!dev_priv->mm.aliasing_ppgtt)
> > +		vma->bound |= GLOBAL_BIND | LOCAL_BIND;
> > +
> >  	return 0;
> >  }
> 
> Didn't we already add:
> 
>         if (!dev_priv->mm.aliasing_ppgtt || flags & GLOBAL_BIND) {
>                 vma->vm->insert_entries(vma->vm,
>                                         vma->ggtt_view.pages,
>                                         vma->node.start,
>                                         cache_level, pte_flags);
> 
>                 /* Note the inconsistency here is due to absence of the
>                  * aliasing ppgtt on gen4 and earlier. Though we always
>                  * request PIN_USER for execbuffer (translated to LOCAL_BIND),
>                  * without the appgtt, we cannot honour that request and so
>                  * must substitute it with a global binding. Since we do this
>                  * behind the upper layers back, we need to explicitly set
>                  * the bound flag ourselves.
>                  */
>                 vma->bound |= GLOBAL_BIND;
> 
>         }
> 
> to ggtt_bind_vma() ?

Yeah, my patch superseeds this one (it's an old one, cherrished for a long
time) - LOCAL_BIND also implies GLOBAL_BIND if we lack a ppgtt. This is
something I've missed in

commit 0875546c5318c85c13d07014af5350e9000bc9e9
Author: Daniel Vetter <daniel.vetter at ffwll.ch>
Date:   Mon Apr 20 09:04:05 2015 -0700

    drm/i915: Fix up the vma aliasing ppgtt binding

I'll frob the patch a bit and ping you on irc, but first lunch.
-Daniel

> -Chris
> 
> -- 
> Chris Wilson, Intel Open Source Technology Centre

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the Intel-gfx mailing list