]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: rockchip: rga: fix too small buffer size
authorSven Püschel <s.pueschel@pengutronix.de>
Wed, 20 May 2026 22:44:11 +0000 (00:44 +0200)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Thu, 21 May 2026 10:32:19 +0000 (12:32 +0200)
Fix the command buffer size being only a quarter of the actual size.
The RGA_CMDBUF_SIZE macro was potentially intended to specify the length
of the cmdbuf u32 array pointer. But as it's used to specify the size of
the allocation, which is counted in bytes. Therefore adjust the macro
size to bytes as it better matches the variable name and adjust it's
users accordingly.

As the command buffer is relatively small, it probably didn't caused
an issue due to being smaller than a single page.

Fixes: f7e7b48e6d79 ("[media] rockchip/rga: v4l2 m2m support")
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Sven Püschel <s.pueschel@pengutronix.de>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/platform/rockchip/rga/rga-hw.c
drivers/media/platform/rockchip/rga/rga-hw.h

index 43ed742a164929927001ef8e8925a29eb93615b2..d1618bb2475013bfaca29b417df8b1a3c0a8e502 100644 (file)
@@ -414,7 +414,7 @@ static void rga_cmd_set(struct rga_ctx *ctx,
 {
        struct rockchip_rga *rga = ctx->rga;
 
-       memset(rga->cmdbuf_virt, 0, RGA_CMDBUF_SIZE * 4);
+       memset(rga->cmdbuf_virt, 0, RGA_CMDBUF_SIZE);
 
        rga_cmd_set_src_addr(ctx, src->dma_desc_pa);
        /*
index cc6bd7f5b0300364948fd15109c643199d94e5de..2b8537a5fd0d7a17444485c61fa5caed91f07324 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef __RGA_HW_H__
 #define __RGA_HW_H__
 
-#define RGA_CMDBUF_SIZE 0x20
+#define RGA_CMDBUF_SIZE 0x80
 
 /* Hardware limits */
 #define MAX_WIDTH 8192