From: Sil Vilerino Date: Thu, 6 Jul 2023 14:39:15 +0000 (-0400) Subject: frontend/va: Fix vaSyncSurface and vaQuerySurface status for drivers not implementing... X-Git-Tag: upstream/23.3.3~5946 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=52647bd221f859d313fbad7159b17a5ecea5eeef;p=platform%2Fupstream%2Fmesa.git frontend/va: Fix vaSyncSurface and vaQuerySurface status for drivers not implementing get_processor_fence Reviewed-by: Ruijing Dong Part-of: --- diff --git a/src/gallium/frontends/va/surface.c b/src/gallium/frontends/va/surface.c index 96d3825..aaa8aff 100644 --- a/src/gallium/frontends/va/surface.c +++ b/src/gallium/frontends/va/surface.c @@ -138,7 +138,10 @@ vlVaSyncSurface(VADriverContextP ctx, VASurfaceID render_target) } if (context->decoder->entrypoint == PIPE_VIDEO_ENTRYPOINT_PROCESSING) { - int ret = 0; + /* If driver does not implement get_processor_fence assume no + * async work needed to be waited on and return success + */ + int ret = (context->decoder->get_processor_fence) ? 0 : 1; if (context->decoder->get_processor_fence) ret = context->decoder->get_processor_fence(context->decoder, @@ -258,23 +261,17 @@ vlVaQuerySurfaceStatus(VADriverContextP ctx, VASurfaceID render_target, VASurfac */ *status = VASurfaceRendering; } else if (context->decoder->entrypoint == PIPE_VIDEO_ENTRYPOINT_PROCESSING) { - int ret = 0; + /* If driver does not implement get_processor_fence assume no + * async work needed to be waited on and return surface ready + */ + int ret = (context->decoder->get_processor_fence) ? 0 : 1; if (context->decoder->get_processor_fence) ret = context->decoder->get_processor_fence(context->decoder, surf->fence, 0); - if (ret) *status = VASurfaceReady; else - /* An approach could be to just tell the client that this is not - * implemented, but this breaks other code. Compromise by at least - * conservatively setting the status to VASurfaceRendering if we can't - * query the hardware. Note that we _must_ set the status here, otherwise - * it comes out of the function unchanged. As we are returning - * VA_STATUS_SUCCESS, the client would be within his/her rights to use a - * potentially uninitialized/invalid status value unknowingly. - */ *status = VASurfaceRendering; }