[Intel-gfx] [PATCH 08/10] drm/i915: Track display alignment on VMA

Joonas Lahtinen joonas.lahtinen at linux.intel.com
Mon Aug 15 09:38:42 UTC 2016


On pe, 2016-08-12 at 11:28 +0100, Chris Wilson wrote:
> When using the aliasing ppgtt and pagefliping with the shrinker/eviction

s/fliping/flipping/

> active, we note that we often have to rebind the backbuffer before
> flipping onto the scanout because it has an invalid alignment. If we
> store the worst-case alignment required for a VMA, we can avoid having
> to rebind at critical junctures.
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

<SNIP>

> @@ -2984,17 +2983,10 @@ i915_vma_insert(struct i915_vma *vma, u64 size, u64 alignment, u64 flags)
>  		size = i915_gem_get_ggtt_size(dev_priv, size,
>  					      i915_gem_object_get_tiling(obj));
>  
> -	min_alignment =
> -		i915_gem_get_ggtt_alignment(dev_priv, size,
> -					    i915_gem_object_get_tiling(obj),
> -					    flags & PIN_MAPPABLE);
> -	if (alignment == 0)
> -		alignment = min_alignment;
> -	if (alignment & (min_alignment - 1)) {
> -		DRM_DEBUG("Invalid object alignment requested %llu, minimum %llu\n",
> -			  alignment, min_alignment);
> -		return -EINVAL;
> -	}
> +	alignment = max(max(alignment, vma->display_alignment),
> +			i915_gem_get_ggtt_alignment(dev_priv, size,
> +						    i915_gem_object_get_tiling(obj),
> +						    flags & PIN_MAPPABLE));

No DRM_DEBUG no more?

> @@ -183,7 +183,7 @@ struct i915_vma {
>  	struct drm_i915_fence_reg *fence;
>  	struct sg_table *pages;
>  	void __iomem *iomap;
> -	u64 size;
> +	u64 size, display_alignment;

Unrelated variables, better off their own lines.

Reviewed-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation


More information about the Intel-gfx mailing list