[PATCH 2/2] media: verisilicon: rockchip_vpu2_hw_jpeg_enc: Add data_offset to source addresses

Andri Yngvason andri at yngvason.is
Tue May 9 08:02:49 PDT 2023


This accommodates planes that are backed by a single dmabuf.

Signed-off-by: Andri Yngvason <andri at yngvason.is>
---
 drivers/media/platform/verisilicon/rockchip_vpu2_hw_jpeg_enc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/verisilicon/rockchip_vpu2_hw_jpeg_enc.c b/drivers/media/platform/verisilicon/rockchip_vpu2_hw_jpeg_enc.c
index 52c76fb91c56..716c248dc2bf 100644
--- a/drivers/media/platform/verisilicon/rockchip_vpu2_hw_jpeg_enc.c
+++ b/drivers/media/platform/verisilicon/rockchip_vpu2_hw_jpeg_enc.c
@@ -99,7 +99,8 @@ static void rockchip_vpu2_jpeg_enc_set_buffers(struct hantro_dev *vpu,
 	vepu_write_relaxed(vpu, size_left, VEPU_REG_STR_BUF_LIMIT);
 
 	for (i = 0; i < num_planes; i++) {
-		src = vb2_dma_contig_plane_dma_addr(src_buf, i);
+		src = vb2_dma_contig_plane_dma_addr(src_buf, i) +
+			src_buf->planes[i].data_offset;
 		vepu_write_relaxed(vpu, src, __vepu_reg_addr_for_plane(i));
 	}
 }
-- 
2.40.1




More information about the Linux-rockchip mailing list