[Intel-gfx] [PATCH] drm/i915: simplify bind_to_vm init code

Chris Wilson chris at chris-wilson.co.uk
Thu Mar 17 13:53:19 UTC 2016


On Thu, Mar 17, 2016 at 01:41:32PM +0000, Matthew Auld wrote:
> Hi,
> 
> If we don't do any of the fence business for !i915_is_gtt, then will
> this not change the following code:
> 
> if (alignment == 0)
>     alignment = flags & PIN_MAPPABLE ? fence_alignment : unfenced_alignment;
> 
> Or am I missing something?

Fwiw, the patches I have sent previously change it to:

size = max(size, vma->size);
if (flags & PIN_MAPPABLE)
	size = i915_gem_get_gtt_size(dev, size, obj->tiling_mode);

alignment =
	max_t(u64, max(alignment, vma->display_alignment),
      	      i915_gem_get_gtt_alignment(dev, size, obj->tiling_mode, flags & PIN_MAPPABLE));
if (alignment == 4096)
	alignment = 0;

start = flags & PIN_OFFSET_BIAS ? flags & PIN_OFFSET_MASK : 0;

end = vma->vm->total;
if (flags & PIN_MAPPABLE)
	end = min_t(u64, end, dev_priv->gtt.mappable_end);
if (flags & PIN_ZONE_4G)
	end = min_t(u64, end, (1ULL << 32) - PAGE_SIZE);
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list