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

Chris Wilson chris at chris-wilson.co.uk
Tue Aug 16 08:40:34 UTC 2016


On Mon, Aug 15, 2016 at 12:38:42PM +0300, Joonas Lahtinen wrote:
> On pe, 2016-08-12 at 11:28 +0100, Chris Wilson wrote:
> > @@ -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?

The invalid uabi alignment is caught by execbuf and here instead of
treating it as an error we just overrule the caller with our minimum
requirements.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list