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: 6746d4df6e ("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 <m.seyfarth@gmail.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29124>
(cherry picked from commit b33bb4077d)
This commit is contained in:
David Rosca 2024-05-09 16:59:39 +02:00 committed by Eric Engestrom
parent 1aaec51f56
commit 69c7b25037
2 changed files with 3 additions and 2 deletions

View file

@ -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

View file

@ -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: