frontends/va: Get buffer feedback with locked mutex in MapBuffer
Fixes: 93d434362b
("frontends/va: Move encode fence to coded buffer")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12344
Tested-by: Benjamin Cheng <benjamin.cheng@amd.com>
Reviewed-by: David (Ming Qiang) Wu <David.Wu3@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32761>
This commit is contained in:
@@ -145,6 +145,9 @@ VAStatus vlVaMapBuffer2(VADriverContextP ctx, VABufferID buf_id,
|
|||||||
return VA_STATUS_ERROR_INVALID_BUFFER;
|
return VA_STATUS_ERROR_INVALID_BUFFER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (buf->type == VAEncCodedBufferType)
|
||||||
|
vlVaGetBufferFeedback(buf);
|
||||||
|
|
||||||
if (buf->derived_surface.resource) {
|
if (buf->derived_surface.resource) {
|
||||||
struct pipe_resource *resource;
|
struct pipe_resource *resource;
|
||||||
struct pipe_box box;
|
struct pipe_box box;
|
||||||
@@ -198,8 +201,6 @@ VAStatus vlVaMapBuffer2(VADriverContextP ctx, VABufferID buf_id,
|
|||||||
if (buf->type == VAEncCodedBufferType) {
|
if (buf->type == VAEncCodedBufferType) {
|
||||||
VACodedBufferSegment* curr_buf_ptr = (VACodedBufferSegment*) buf->data;
|
VACodedBufferSegment* curr_buf_ptr = (VACodedBufferSegment*) buf->data;
|
||||||
|
|
||||||
vlVaGetBufferFeedback(buf);
|
|
||||||
|
|
||||||
if ((buf->extended_metadata.present_metadata & PIPE_VIDEO_FEEDBACK_METADATA_TYPE_ENCODE_RESULT) &&
|
if ((buf->extended_metadata.present_metadata & PIPE_VIDEO_FEEDBACK_METADATA_TYPE_ENCODE_RESULT) &&
|
||||||
(buf->extended_metadata.encode_result & PIPE_VIDEO_FEEDBACK_METADATA_ENCODE_FLAG_FAILED)) {
|
(buf->extended_metadata.encode_result & PIPE_VIDEO_FEEDBACK_METADATA_ENCODE_FLAG_FAILED)) {
|
||||||
curr_buf_ptr->status = VA_CODED_BUF_STATUS_BAD_BITSTREAM;
|
curr_buf_ptr->status = VA_CODED_BUF_STATUS_BAD_BITSTREAM;
|
||||||
|
Reference in New Issue
Block a user