Re: [PATCH 1/2] drm/i915: Assert the vma can fit within the address space

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 19, 2017 at 12:58:46PM +0000, Chris Wilson wrote:
> Useful sanity check that the vma is legal to bind inside the address
> space.
> 
> Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> ---
>  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);

Seconds thoughts, it is probably wiser to bail here with
ERR_PTR(-E2BIG); We don't check in execbuf and this stops from having to
write patch 2 as well.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux