Re: [RFC v2] libdrm_intel: Add API for execbuf pad to size functionality

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

 



On Wed, Apr 01, 2015 at 12:14:09PM +0100, Tvrtko Ursulin wrote:
>  static int
> +drm_intel_gem_bo_pad_to_size(drm_intel_bo *bo, uint64_t pad_to_size)
> +{
> +	drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo;
> +
> +	if (pad_to_size < bo->size)
> +		return -EINVAL;
> +
> +	if (pad_to_size > bo->size)
> +		bo_gem->pad_to_size = pad_to_size;

Thinking too hard here :)

This fails to restore a previously padded object to bo->size, and we
need to allow pad_to_size = 0.

static int
drm_intel_gem_bo_pad_to_size(drm_intel_bo *bo, uint64_t pad_to_size)
{
	drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo;

	if (pad_to_size && pad_to_size < bo->size)
		return -EINVAL;

	bo_gem->pad_to_size = pad_to_size;
	return 0;
}
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://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