0
0
mirror of https://github.com/libretro/Lakka-LibreELEC.git synced 2025-03-02 20:05:55 +00:00
Lakka-LibreELEC/projects/Allwinner/patches/linux/0073-media-verisilicon-g2-fix-chroma-offset-calculation.patch
Rudi Heitbaum 33b0203020 linux (Allwinner): rebase and update patches for 6.11
The following changes were introduced in 6.11-rc1 and 6.11-rc7

only pass 3 variables to
- of: remove internal arguments from of_property_for_each_u32()
- 9722c3b66e

6.11-rc7 has refactored drm 9da7ec9b19
resulting in the following compile error.

build.LibreELEC-H6.aarch64-13.0-devel/toolchain/bin/aarch64-libreelec-linux-gnu-ld: drivers/gpu/drm/sun4i/sun8i_dw_hdmi.o: in function `sun8i_dw_hdmi_bind':
build.LibreELEC-H6.aarch64-13.0-devel/build/linux-6.11-rc7/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c:394:(.text+0x73c): undefined reference to `drm_bridge_connector_init'

Co-authored-by: Jernej Skrabec <jernej.skrabec@gmail.com>
2024-09-19 23:05:33 +00:00

28 lines
1.2 KiB
Diff

From 4a6926ea19c64b49e2bdeb30ceef98fc812cc52d Mon Sep 17 00:00:00 2001
From: Jernej Skrabec <jernej.skrabec@gmail.com>
Date: Thu, 19 Sep 2024 20:17:30 +0200
Subject: [PATCH] media: verisilicon: g2: Fix chroma offset calculation
Since bit depth may not be divisible by 8 (like 10 or 12), division must
be rounded up.
Fixes: 3eeaee737dce ("media: verisilicon: g2: Use common helpers to compute chroma and mv offsets")
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
---
drivers/media/platform/verisilicon/hantro_g2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/platform/verisilicon/hantro_g2.c b/drivers/media/platform/verisilicon/hantro_g2.c
index b880a6849d5852..24ae7b69f6a0ae 100644
--- a/drivers/media/platform/verisilicon/hantro_g2.c
+++ b/drivers/media/platform/verisilicon/hantro_g2.c
@@ -47,7 +47,7 @@ irqreturn_t hantro_g2_irq(int irq, void *dev_id)
size_t hantro_g2_chroma_offset(struct hantro_ctx *ctx)
{
- return ctx->dst_fmt.width * ctx->dst_fmt.height * ctx->bit_depth / 8;
+ return ctx->dst_fmt.width * ctx->dst_fmt.height * DIV_ROUND_UP(ctx->bit_depth, 8);
}
size_t hantro_g2_motion_vectors_offset(struct hantro_ctx *ctx)