From 82ee420b15585349981e1e738c56aa2aa942686a Mon Sep 17 00:00:00 2001 From: Feng Jiang Date: Fri, 2 Jun 2023 09:38:37 +0800 Subject: [PATCH] frontends/va: Add slice_count to AV1 slice_parameter Save the number of slice in AV1 slice parameter, so that the underlying driver (such as virgl) can handle the slice parameters better. Signed-off-by: Feng Jiang Suggested-by: Sil Vilerino Reviewed-by: Boyuan Zhang Reviewed-by: Daniel Almeida Reviewed-by: Sil Vilerino Part-of: --- src/gallium/frontends/va/picture_av1.c | 3 +++ src/gallium/include/pipe/p_video_state.h | 1 + 2 files changed, 4 insertions(+) diff --git a/src/gallium/frontends/va/picture_av1.c b/src/gallium/frontends/va/picture_av1.c index 1f6a9494adf..e6f2652e362 100644 --- a/src/gallium/frontends/va/picture_av1.c +++ b/src/gallium/frontends/va/picture_av1.c @@ -392,6 +392,8 @@ void vlVaHandlePictureParameterBufferAV1(vlVaDriver *drv, vlVaContext *context, else vlVaGetReferenceFrame(drv, av1->ref_frame_map[i], &context->desc.av1.ref[i]); } + + context->desc.av1.slice_parameter.slice_count = 0; } void vlVaHandleSliceParameterBufferAV1(vlVaContext *context, vlVaBuffer *buf, unsigned num_slices) @@ -409,5 +411,6 @@ void vlVaHandleSliceParameterBufferAV1(vlVaContext *context, vlVaBuffer *buf, un context->desc.av1.slice_parameter.slice_data_row[slice_index] = av1->tile_row; context->desc.av1.slice_parameter.slice_data_col[slice_index] = av1->tile_column; context->desc.av1.slice_parameter.slice_data_anchor_frame_idx[slice_index] = av1->anchor_frame_idx; + context->desc.av1.slice_parameter.slice_count = slice_index + 1; } } diff --git a/src/gallium/include/pipe/p_video_state.h b/src/gallium/include/pipe/p_video_state.h index ccf86e548db..8ca665966b8 100644 --- a/src/gallium/include/pipe/p_video_state.h +++ b/src/gallium/include/pipe/p_video_state.h @@ -1377,6 +1377,7 @@ struct pipe_av1_picture_desc uint16_t slice_data_row[256]; uint16_t slice_data_col[256]; uint8_t slice_data_anchor_frame_idx[256]; + uint16_t slice_count; } slice_parameter; };