From 69c7b25037e391581ea581b44ba3c5fdcb9d4070 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Thu, 9 May 2024 16:59:39 +0200 Subject: [PATCH] frontends/va: Only increment slice offset after first slice parameters Fixes slice offset if app submits exactly one data buffer followed by parameter buffers. Fixes: 6746d4df6ea ("frontends/va: Fix AV1 slice_data_offset with multiple slice data buffers") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11133 Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11138 Tested-by: Marcus Seyfarth Reviewed-by: Boyuan Zhang Part-of: (cherry picked from commit b33bb4077d7500232a5cadd956b5c8810bb5c9ba) --- .pick_status.json | 2 +- src/gallium/frontends/va/picture.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 06dcdcec8b7..c933592eb50 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2234,7 +2234,7 @@ "description": "frontends/va: Only increment slice offset after first slice parameters", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "6746d4df6eac83d048e88c2d54aa19e7c1a0a696", "notes": null diff --git a/src/gallium/frontends/va/picture.c b/src/gallium/frontends/va/picture.c index 7bddd86db97..1a3cf42ff83 100644 --- a/src/gallium/frontends/va/picture.c +++ b/src/gallium/frontends/va/picture.c @@ -1033,7 +1033,8 @@ vlVaRenderPicture(VADriverContextP ctx, VAContextID context_id, VABufferID *buff case VASliceDataBufferType: vaStatus = handleVASliceDataBufferType(context, buf); - slice_offset += buf->size; + if (slice_idx) + slice_offset += buf->size; break; case VAProcPipelineParameterBufferType: