Mesa (main): frontends/va/av1: handle multiple slice params

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Oct 21 16:24:48 UTC 2021


Module: Mesa
Branch: main
Commit: cf0bc4fb55f96cab82d76a2d6726690070fd92fd
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cf0bc4fb55f96cab82d76a2d6726690070fd92fd

Author: Sajeesh Sidharthan <sajeesh.sidharthan at amd.com>
Date:   Wed Oct 20 21:48:38 2021 +0530

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 <sajeesh.sidharthan at amd.com>
Reviewed-by: Leo Liu <leo.liu at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13463>

---

 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;
 }



More information about the mesa-commit mailing list