From: Guttula, Suresh Date: Mon, 11 Feb 2019 11:12:52 +0000 (-0500) Subject: st/va:Add support for indirect manner by returning VA_STATUS_ERROR_OPERATION_FAILED X-Git-Tag: android-x86-9.0-r1~9986 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=2cf2a5673995e61de5943d502d1b29102e16cd5c;p=android-x86%2Fexternal-mesa.git st/va:Add support for indirect manner by returning VA_STATUS_ERROR_OPERATION_FAILED Based on VA Spec,DeriveImage() returns VA_STATUS_ERROR_OPERATION_FAILED if driver dont have support for internal surface formats.Currently vaDeriveImage() failed for non-contiguous planes and operation failed error string is required to support indirect manner i.e. vaCreateImage()+vaPutImage() incase vaDeriveImage() failed with VA_STATUS_ERROR_OPERATION_FAILED. This patch will notify to the client as operation failed with proper error sting,so that client will fallback to vaCreateImage()+vaPutImage(). v2: updated commit message based on VA spec. Signed-off-by: suresh guttula Reviewed-by: Leo Liu --- diff --git a/src/gallium/state_trackers/va/image.c b/src/gallium/state_trackers/va/image.c index 807fc832c7f..f7e0db08961 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));