frontends/va: add ability for encoder to output statistics
Signed-off-by: Thong Thai <thong.thai@amd.com> Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19512>
This commit is contained in:
@@ -686,6 +686,27 @@ handleVAEncPackedHeaderDataBufferType(vlVaContext *context, vlVaBuffer *buf)
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static VAStatus
|
||||||
|
handleVAStatsStatisticsBufferType(VADriverContextP ctx, vlVaContext *context, vlVaBuffer *buf)
|
||||||
|
{
|
||||||
|
if (context->decoder->entrypoint != PIPE_VIDEO_ENTRYPOINT_ENCODE)
|
||||||
|
return VA_STATUS_ERROR_UNIMPLEMENTED;
|
||||||
|
|
||||||
|
vlVaDriver *drv;
|
||||||
|
drv = VL_VA_DRIVER(ctx);
|
||||||
|
|
||||||
|
if (!drv)
|
||||||
|
return VA_STATUS_ERROR_INVALID_CONTEXT;
|
||||||
|
|
||||||
|
if (!buf->derived_surface.resource)
|
||||||
|
buf->derived_surface.resource = pipe_buffer_create(drv->pipe->screen, PIPE_BIND_VERTEX_BUFFER,
|
||||||
|
PIPE_USAGE_STREAM, buf->size);
|
||||||
|
|
||||||
|
context->target->associated_data = buf->derived_surface.resource;
|
||||||
|
|
||||||
|
return VA_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
VAStatus
|
VAStatus
|
||||||
vlVaRenderPicture(VADriverContextP ctx, VAContextID context_id, VABufferID *buffers, int num_buffers)
|
vlVaRenderPicture(VADriverContextP ctx, VAContextID context_id, VABufferID *buffers, int num_buffers)
|
||||||
{
|
{
|
||||||
@@ -781,6 +802,10 @@ vlVaRenderPicture(VADriverContextP ctx, VAContextID context_id, VABufferID *buff
|
|||||||
handleVAEncPackedHeaderDataBufferType(context, buf);
|
handleVAEncPackedHeaderDataBufferType(context, buf);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case VAStatsStatisticsBufferType:
|
||||||
|
handleVAStatsStatisticsBufferType(ctx, context, buf);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user