Skip to content

Fix vaQuerySurfaceStatus and vaSyncSurface for decode

Daniel Almeida requested to merge dwlsalmeida/mesa:va into main

Add a get_decoder_feedback vfunc that can be used to query the status of the previous decode job denoted by 'fence' given 'timeout'.

Use this call to implement vaQuerySurfaceStatus and vaSyncSurface in the va state tracker.

A pointer to the surface's fence is passed to the codecs before the end_frame vfunc and the codec is responsible for allocating a fence on command stream submission.

This fence is then queried on vaQuerySurfaceStatus and waited on in vaSyncSurface.

Notably both functions were not implemented as per the VA-API docs for PIPE_VIDEO_ENTRYPOINT_BITSTREAM. In such case, we notify the user with VA_STATUS_ERROR_UNIMPLEMENTED in vaQuerySurfaceStatus and vaSyncSurface if the underlying codec does not implement get_decoder_feedback()

This is in contrast with the previous implementation, where nothing would be done for decode, yet VA_STATUS_SUCCESS would be returned.

Merge request reports