[Mesa-dev] [PATCH v4] anv: return VK_ERROR_OUT_OF_DEVICE_MEMORY when surface size is out of HW limits

Jason Ekstrand jason at jlekstrand.net
Wed Jan 17 21:32:26 UTC 2018


On Tue, Jan 16, 2018 at 11:35 PM, Samuel Iglesias Gonsálvez <
siglesias at igalia.com> wrote:

> Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
> ---
>  src/intel/vulkan/anv_image.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
> index 4d13e05e11f..72e408764d8 100644
> --- a/src/intel/vulkan/anv_image.c
> +++ b/src/intel/vulkan/anv_image.c
> @@ -335,10 +335,8 @@ make_surface(const struct anv_device *dev,
>        .usage = usage,
>        .tiling_flags = tiling_flags);
>
> -   /* isl_surf_init() will fail only if provided invalid input. Invalid
> input
> -    * is illegal in Vulkan.
> -    */
> -   assert(ok);
> +   if (!ok)
> +      return VK_ERROR_OUT_OF_DEVICE_MEMORY;
>

This looks fine.  It might be worth adding a comment saying why we're doing
this.  Unfortunately, the new spec text hasn't appeared publically yet.  In
any case

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

In order to solve the longer-term problem of just having a single bool
returned by isl_surf_init_s, I can think of a few different solutions:

 1) Move the max size check out of isl_surf_init and have a max size in the
isl_device and require the driver to do the check.
 2) Add a new ISL enum for error codes so we can be more descriptive.

All in all, I'm not too worried about it at the moment.


>
>     image->planes[plane].aux_usage = ISL_AUX_USAGE_NONE;
>
> --
> 2.14.1
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180117/a7c48cbf/attachment-0001.html>


More information about the mesa-dev mailing list