From cf0bc4fb55f96cab82d76a2d6726690070fd92fd Mon Sep 17 00:00:00 2001 From: Sajeesh Sidharthan Date: Wed, 20 Oct 2021 21:30:38 +0530 Subject: [PATCH] frontends/va/av1: handle multiple slice params Multiple slice params in a single vaRenderPicture function call is not handled. This patch will fix overwriting slice params when multiple slice params received in one buffer. Change-Id: I880df5bc35dfbd64382a178074482548882ee4af Signed-off-by: Sajeesh Sidharthan Reviewed-by: Leo Liu Part-of: --- src/gallium/frontends/va/picture.c | 3 ++- src/gallium/frontends/va/picture_av1.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gallium/frontends/va/picture.c b/src/gallium/frontends/va/picture.c index 20d58c52f24..2843983a753 100644 --- a/src/gallium/frontends/va/picture.c +++ b/src/gallium/frontends/va/picture.c @@ -562,6 +562,7 @@ vlVaRenderPicture(VADriverContextP ctx, VAContextID context_id, VABufferID *buff VAStatus vaStatus = VA_STATUS_SUCCESS; unsigned i; + unsigned slice_param_idx = 0; if (!ctx) return VA_STATUS_ERROR_INVALID_CONTEXT; @@ -602,7 +603,7 @@ vlVaRenderPicture(VADriverContextP ctx, VAContextID context_id, VABufferID *buff break; case VASliceParameterBufferType: - handleSliceParameterBuffer(context, buf, i); + handleSliceParameterBuffer(context, buf, slice_param_idx++); break; case VASliceDataBufferType: diff --git a/src/gallium/frontends/va/picture_av1.c b/src/gallium/frontends/va/picture_av1.c index 1ac83fa4bd8..d48163647dc 100644 --- a/src/gallium/frontends/va/picture_av1.c +++ b/src/gallium/frontends/va/picture_av1.c @@ -351,6 +351,6 @@ void vlVaHandleSliceParameterBufferAV1(vlVaContext *context, vlVaBuffer *buf, un { VASliceParameterBufferAV1 *av1 = buf->data; - context->desc.av1.slice_parameter.slice_data_size[num >> 1] = av1->slice_data_size; - context->desc.av1.slice_parameter.slice_data_offset[num >> 1] = av1->slice_data_offset; + context->desc.av1.slice_parameter.slice_data_size[num] = av1->slice_data_size; + context->desc.av1.slice_parameter.slice_data_offset[num] = av1->slice_data_offset; }