aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/at91/patches-5.10/193-media-atmel-atmel-sama5d2-isc-fix-YUYV-format.patch
diff options
context:
space:
mode:
authorClaudiu Beznea <claudiu.beznea@microchip.com>2022-02-04 15:57:50 +0200
committerPetr Štetiar <ynezz@true.cz>2022-02-24 19:05:28 +0100
commite58cd453d58b20c6a6f34d3591640aa19aa14d25 (patch)
treea4fef5f5d79575a7a60b516482ee114c1dbc932e /target/linux/at91/patches-5.10/193-media-atmel-atmel-sama5d2-isc-fix-YUYV-format.patch
parent3ed992a99630457f660761ce199e3d2a00f06168 (diff)
downloadupstream-e58cd453d58b20c6a6f34d3591640aa19aa14d25.tar.gz
upstream-e58cd453d58b20c6a6f34d3591640aa19aa14d25.tar.bz2
upstream-e58cd453d58b20c6a6f34d3591640aa19aa14d25.zip
at91: add kernel support for sama7g5 soc
Add kernel support for SAMA7G5 by back-porting mainline kernel patches. Among SAMA7G5 features could be remembered: - ARM Cortex-A7 - double data rate multi-port dynamic RAM controller supporting DDR2, DDR3, DDR3L, LPDDR2, LPDDR3 up to 533MHz - peripherals for audio, video processing - 1 gigabit + 1 megabit Ethernet controllers - 6 CAN controllers - trust zone support - DVFS for CPU - criptography IPs Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Diffstat (limited to 'target/linux/at91/patches-5.10/193-media-atmel-atmel-sama5d2-isc-fix-YUYV-format.patch')
-rw-r--r--target/linux/at91/patches-5.10/193-media-atmel-atmel-sama5d2-isc-fix-YUYV-format.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/target/linux/at91/patches-5.10/193-media-atmel-atmel-sama5d2-isc-fix-YUYV-format.patch b/target/linux/at91/patches-5.10/193-media-atmel-atmel-sama5d2-isc-fix-YUYV-format.patch
new file mode 100644
index 0000000000..c8cf87021f
--- /dev/null
+++ b/target/linux/at91/patches-5.10/193-media-atmel-atmel-sama5d2-isc-fix-YUYV-format.patch
@@ -0,0 +1,53 @@
+From 21261e30679118b96ed537d1cdf9e12682fc1b29 Mon Sep 17 00:00:00 2001
+From: Eugen Hristev <eugen.hristev@microchip.com>
+Date: Wed, 9 Jun 2021 15:00:28 +0200
+Subject: [PATCH 193/247] media: atmel: atmel-sama5d2-isc: fix YUYV format
+
+SAMA5D2 does not have the YCYC field for the RLP (rounding, limiting,
+packaging) module.
+The YCYC field is supposed to work with interleaved YUV formats like YUYV.
+In SAMA5D2, we have to use YYCC field, which is used for both planar
+formats like YUV420 and interleaved formats like YUYV.
+Fix the according rlp callback to replace the generic YCYC field (which
+makes more sense from a logical point of view) with the required YYCC
+field.
+
+Fixes: debfa496871c ("media: atmel: atmel-isc-base: add support for more formats and additional pipeline modules")
+Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
+Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
+Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
+---
+ .../media/platform/atmel/atmel-sama5d2-isc.c | 17 +++++++++++++++++
+ 1 file changed, 17 insertions(+)
+
+diff --git a/drivers/media/platform/atmel/atmel-sama5d2-isc.c b/drivers/media/platform/atmel/atmel-sama5d2-isc.c
+index d6fd22b127fd..4f09db71d152 100644
+--- a/drivers/media/platform/atmel/atmel-sama5d2-isc.c
++++ b/drivers/media/platform/atmel/atmel-sama5d2-isc.c
+@@ -255,6 +255,23 @@ static void isc_sama5d2_config_rlp(struct isc_device *isc)
+ struct regmap *regmap = isc->regmap;
+ u32 rlp_mode = isc->config.rlp_cfg_mode;
+
++ /*
++ * In sama5d2, the YUV planar modes and the YUYV modes are treated
++ * in the same way in RLP register.
++ * Normally, YYCC mode should be Luma(n) - Color B(n) - Color R (n)
++ * and YCYC should be Luma(n + 1) - Color B (n) - Luma (n) - Color R (n)
++ * but in sama5d2, the YCYC mode does not exist, and YYCC must be
++ * selected for both planar and interleaved modes, as in fact
++ * both modes are supported.
++ *
++ * Thus, if the YCYC mode is selected, replace it with the
++ * sama5d2-compliant mode which is YYCC .
++ */
++ if ((rlp_mode & ISC_RLP_CFG_MODE_YCYC) == ISC_RLP_CFG_MODE_YCYC) {
++ rlp_mode &= ~ISC_RLP_CFG_MODE_MASK;
++ rlp_mode |= ISC_RLP_CFG_MODE_YYCC;
++ }
++
+ regmap_update_bits(regmap, ISC_RLP_CFG + isc->offsets.rlp,
+ ISC_RLP_CFG_MODE_MASK, rlp_mode);
+ }
+--
+2.32.0
+