mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-07 17:20:21 +01:00
st/va: Return correct status from vlVaQuerySurfaceStatus
This ensures that during encoding, applications can get the correct status of the surface before submitting more operations on the same. Reviewed-by: Leo Liu <leo.liu@amd.com> Signed-off-by: Indrajit Das <indrajit-kumar.das@amd.com>
This commit is contained in:
parent
0c226d40ef
commit
d2c170eb35
1 changed files with 31 additions and 0 deletions
|
|
@ -146,9 +146,40 @@ vlVaSyncSurface(VADriverContextP ctx, VASurfaceID render_target)
|
|||
VAStatus
|
||||
vlVaQuerySurfaceStatus(VADriverContextP ctx, VASurfaceID render_target, VASurfaceStatus *status)
|
||||
{
|
||||
vlVaDriver *drv;
|
||||
vlVaSurface *surf;
|
||||
vlVaContext *context;
|
||||
|
||||
if (!ctx)
|
||||
return VA_STATUS_ERROR_INVALID_CONTEXT;
|
||||
|
||||
drv = VL_VA_DRIVER(ctx);
|
||||
if (!drv)
|
||||
return VA_STATUS_ERROR_INVALID_CONTEXT;
|
||||
|
||||
mtx_lock(&drv->mutex);
|
||||
|
||||
surf = handle_table_get(drv->htab, render_target);
|
||||
if (!surf || !surf->buffer) {
|
||||
mtx_unlock(&drv->mutex);
|
||||
return VA_STATUS_ERROR_INVALID_SURFACE;
|
||||
}
|
||||
|
||||
context = handle_table_get(drv->htab, surf->ctx);
|
||||
if (!context) {
|
||||
mtx_unlock(&drv->mutex);
|
||||
return VA_STATUS_ERROR_INVALID_CONTEXT;
|
||||
}
|
||||
|
||||
if (context->decoder->entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE) {
|
||||
if(surf->feedback == NULL)
|
||||
*status=VASurfaceReady;
|
||||
else
|
||||
*status=VASurfaceRendering;
|
||||
}
|
||||
|
||||
mtx_unlock(&drv->mutex);
|
||||
|
||||
return VA_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue