From 9d4bc470cd54d592f50ec2a3ac2eaa853b6fb978 Mon Sep 17 00:00:00 2001 From: Ruijing Dong Date: Tue, 23 May 2023 09:47:59 -0400 Subject: [PATCH] gallium/pipe: add interface update_decoder_target reason: decoder uses the target buffer address in record to indentify the reference frames. When target buffer has changed outside of decoding process, it has to be updated back to decoder, otherwise the outdated reference will cause image corruption. Cc: mesa-stable Reviewed-by: Boyuan Zhang Reviewed-by: Sil Vilerino Signed-off-by: Ruijing Dong Part-of: (cherry picked from commit 5b2544f8689706de4cedebbb6777bb375af78325) --- .pick_status.json | 2 +- src/gallium/include/pipe/p_video_codec.h | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index e297689c1a4..e4048b430ab 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1246,7 +1246,7 @@ "description": "gallium/pipe: add interface update_decoder_target", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/include/pipe/p_video_codec.h b/src/gallium/include/pipe/p_video_codec.h index c68d8fd672c..bda37e396dd 100644 --- a/src/gallium/include/pipe/p_video_codec.h +++ b/src/gallium/include/pipe/p_video_codec.h @@ -133,6 +133,19 @@ struct pipe_video_codec int (*get_decoder_fence)(struct pipe_video_codec *codec, struct pipe_fence_handle *fence, uint64_t timeout); + /** + * Update target buffer address. + * + * Due to reallocation, target buffer address has changed, and the + * changed buffer will need to update to decoder so that when this buffer + * used as a reference frame, decoder can obtain its recorded information. + * Failed updating this buffer will miss reference frames and + * cause image corruption in the sebsequent output. + * If no target buffer change, this call is not necessary. + */ + void (*update_decoder_target)(struct pipe_video_codec *codec, + struct pipe_video_buffer *old, + struct pipe_video_buffer *updated); }; /**