[Intel-gfx] [PATCH 1/2] drm/i915: Assert the vma can fit within the address space
Mika Kuoppala
mika.kuoppala at linux.intel.com
Thu Jan 19 13:04:26 UTC 2017
Chris Wilson <chris at chris-wilson.co.uk> writes:
> Useful sanity check that the vma is legal to bind inside the address
> space.
>
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Reviewed-by: Mika Kuoppala <mika.kuoppala at intel.com>
> ---
> drivers/gpu/drm/i915/i915_vma.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
> index 635f2635b1f2..68e66ffb95e8 100644
> --- a/drivers/gpu/drm/i915/i915_vma.c
> +++ b/drivers/gpu/drm/i915/i915_vma.c
> @@ -107,6 +107,8 @@ vma_create(struct drm_i915_gem_object *obj,
> }
> }
>
> + GEM_BUG_ON(vma->size > vm->total);
> +
> if (i915_is_ggtt(vm)) {
> GEM_BUG_ON(overflows_type(vma->size, u32));
> vma->fence_size = i915_gem_fence_size(vm->i915, vma->size,
> --
> 2.11.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
More information about the Intel-gfx
mailing list