[Intel-gfx] [PATCH 4/6] drm/i915: Add bind/unbind object functions to VM

Chris Wilson chris at chris-wilson.co.uk
Tue Sep 17 09:49:26 CEST 2013


On Mon, Sep 16, 2013 at 10:44:29PM -0700, Ben Widawsky wrote:
> I'm sorry. After reading my comments again, you're absolutely right.
> 
> How's this?

I'm liking it better, since it gives some insight into why GLOBAL_BIND
is required.

> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index 2a71a29..fcf36ae 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -658,10 +658,17 @@ static void gen6_ggtt_bind_vma(struct i915_vma *vma,
>         struct drm_i915_gem_object *obj = vma->obj;
>         const unsigned long entry = vma->node.start >> PAGE_SHIFT;
>  
> -       /* If there is an aliasing PPGTT, and the user didn't explicitly ask for
> -        * the global, just use aliasing */
> +       /* If there is no aliasing PPGTT, or the caller needs a global mapping,
> +        * or we have a global mapping already but the cacheability flags have
> +        * changed, set the global PTES.
> +        *
> +        * If there is an aliasing PPGTT it is anecdotally faster, so use that
> +        * instead if none of the above hold true.
> +        *
> +        * NB: A global mapping should only be needed for special regions like
> +        * "gtt mappable", SNB errata, or if specified via special execbuf flags

+ At all other times, the GPU will use the aliasing ppgtt.

Just adds that extra bit of stress that the predominant access is
through the aliasing ppgtt.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre



More information about the Intel-gfx mailing list