[PATCH v3 3/4] media: verisilicon: g1: vp8: Use the decoder buffer for missing references

From: Arun Iyengar via B4 Relay

Date: Fri Dec 04 2026 - 01:38:23 EST


From: Arun Iyengar <aiyengar1990@xxxxxxxxx>

A missing reference falls back to the CAPTURE buffer. With the
post-processor on, that is the post-processor output, not a decoded
picture in the decoder's layout.

Use the decoder buffer, as the output setup does.

Fixes: 8c2d66b036c7 ("media: hantro: Support color conversion via post-processing")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Arun Iyengar <aiyengar1990@xxxxxxxxx>
---
drivers/media/platform/verisilicon/hantro_g1_vp8_dec.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/verisilicon/hantro_g1_vp8_dec.c b/drivers/media/platform/verisilicon/hantro_g1_vp8_dec.c
index 6db06aca4511..4e50ec804397 100644
--- a/drivers/media/platform/verisilicon/hantro_g1_vp8_dec.c
+++ b/drivers/media/platform/verisilicon/hantro_g1_vp8_dec.c
@@ -378,7 +378,7 @@ static void cfg_ref(struct hantro_ctx *ctx,
if (!ref) {
vpu_debug(0, "failed to find last frame ts=%llu\n",
hdr->last_frame_ts);
- ref = vb2_dma_contig_plane_dma_addr(&vb2_dst->vb2_buf, 0);
+ ref = hantro_get_dec_buf_addr(ctx, &vb2_dst->vb2_buf);
}
vdpu_write_relaxed(vpu, ref, G1_REG_ADDR_REF(0));

@@ -387,7 +387,7 @@ static void cfg_ref(struct hantro_ctx *ctx,
vpu_debug(0, "failed to find golden frame ts=%llu\n",
hdr->golden_frame_ts);
if (!ref)
- ref = vb2_dma_contig_plane_dma_addr(&vb2_dst->vb2_buf, 0);
+ ref = hantro_get_dec_buf_addr(ctx, &vb2_dst->vb2_buf);
if (hdr->flags & V4L2_VP8_FRAME_FLAG_SIGN_BIAS_GOLDEN)
ref |= G1_REG_ADDR_REF_TOPC_E;
vdpu_write_relaxed(vpu, ref, G1_REG_ADDR_REF(4));
@@ -397,7 +397,7 @@ static void cfg_ref(struct hantro_ctx *ctx,
vpu_debug(0, "failed to find alt frame ts=%llu\n",
hdr->alt_frame_ts);
if (!ref)
- ref = vb2_dma_contig_plane_dma_addr(&vb2_dst->vb2_buf, 0);
+ ref = hantro_get_dec_buf_addr(ctx, &vb2_dst->vb2_buf);
if (hdr->flags & V4L2_VP8_FRAME_FLAG_SIGN_BIAS_ALT)
ref |= G1_REG_ADDR_REF_TOPC_E;
vdpu_write_relaxed(vpu, ref, G1_REG_ADDR_REF(5));

--
2.55.0