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@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to