[Mesa-dev] [PATCH] st/va:Add support for indirect manner by returning VA_STATUS_ERROR_OPERATION_FAILED

Liu, Leo Leo.Liu at amd.com
Thu Feb 7 14:45:05 UTC 2019


VA spec regarding VAImage:

This operation is only possible on implementations with
  * direct rendering capabilities and internal surface formats that can be
  * represented with a VAImage. When the operation is not possible this 
interface
  * will return VA_STATUS_ERROR_OPERATION_FAILED. Clients should then 
fall back
  * to using vaCreateImage + vaPutImage to accomplish the same task in an
  * indirect manner.

This is similar to your commit message, so please add it something like 
"based on VA spec..." to your commit message.

With that fixed, the patch is:

Reviewed-by: Leo Liu <leo.liu at amd.com>

On 2019-02-07 5:09 a.m., Guttula, Suresh wrote:
> This patch will return VA_STATUS_ERROR_OPERATION_FAILED incase vaDeriveImage()
> failed for non-contiguous planes.This error string is required to support
> indirect manner i.e. vaCreateImage()+vaPutImage() incase vaDeriveImage()
> failed with VA_STATUS_ERROR_OPERATION_FAILED.
>
> Signed-off-by: suresh guttula <suresh.guttula at amd.com>
> ---
>   src/gallium/state_trackers/va/image.c | 7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/state_trackers/va/image.c b/src/gallium/state_trackers/va/image.c
> index 807fc83..f7e0db0 100644
> --- a/src/gallium/state_trackers/va/image.c
> +++ b/src/gallium/state_trackers/va/image.c
> @@ -212,9 +212,12 @@ vlVaDeriveImage(VADriverContextP ctx, VASurfaceID surface, VAImage *image)
>   
>      surf = handle_table_get(drv->htab, surface);
>   
> -   if (!surf || !surf->buffer || surf->buffer->interlaced)
> +   if (!surf || !surf->buffer)
>         return VA_STATUS_ERROR_INVALID_SURFACE;
>   
> +   if (surf->buffer->interlaced)
> +     return VA_STATUS_ERROR_OPERATION_FAILED;
> +
>      surfaces = surf->buffer->get_surfaces(surf->buffer);
>      if (!surfaces || !surfaces[0]->texture)
>         return VA_STATUS_ERROR_ALLOCATION_FAILED;
> @@ -261,7 +264,7 @@ vlVaDeriveImage(VADriverContextP ctx, VASurfaceID surface, VAImage *image)
>      default:
>         /* VaDeriveImage is designed for contiguous planes. */
>         FREE(img);
> -      return VA_STATUS_ERROR_INVALID_IMAGE_FORMAT;
> +      return VA_STATUS_ERROR_OPERATION_FAILED;
>      }
>   
>      img_buf = CALLOC(1, sizeof(vlVaBuffer));


More information about the mesa-dev mailing list