All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 5.13 01/14] gpu: ipu-v3: Fix i.MX IPU-v3 offset calculations for (semi)planar U/V formats
@ 2021-08-30 11:59 Sasha Levin
  2021-08-30 11:59   ` Sasha Levin
                   ` (12 more replies)
  0 siblings, 13 replies; 21+ messages in thread
From: Sasha Levin @ 2021-08-30 11:59 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Krzysztof Hałasa, Philipp Zabel, Sasha Levin, dri-devel

From: Krzysztof Hałasa <khalasa@piap.pl>

[ Upstream commit 7cca7c8096e2c8a4149405438329b5035d0744f0 ]

Video captured in 1400x1050 resolution (bytesperline aka stride = 1408
bytes) is invalid. Fix it.

Signed-off-by: Krzysztof Halasa <khalasa@piap.pl>
Link: https://lore.kernel.org/r/m3y2bmq7a4.fsf@t19.piap.pl
[p.zabel@pengutronix.de: added "gpu: ipu-v3:" prefix to commit description]
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/ipu-v3/ipu-cpmem.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/ipu-v3/ipu-cpmem.c b/drivers/gpu/ipu-v3/ipu-cpmem.c
index a1c85d1521f5..82b244cb313e 100644
--- a/drivers/gpu/ipu-v3/ipu-cpmem.c
+++ b/drivers/gpu/ipu-v3/ipu-cpmem.c
@@ -585,21 +585,21 @@ static const struct ipu_rgb def_bgra_16 = {
 	.bits_per_pixel = 16,
 };
 
-#define Y_OFFSET(pix, x, y)	((x) + pix->width * (y))
-#define U_OFFSET(pix, x, y)	((pix->width * pix->height) +		\
-				 (pix->width * ((y) / 2) / 2) + (x) / 2)
-#define V_OFFSET(pix, x, y)	((pix->width * pix->height) +		\
-				 (pix->width * pix->height / 4) +	\
-				 (pix->width * ((y) / 2) / 2) + (x) / 2)
-#define U2_OFFSET(pix, x, y)	((pix->width * pix->height) +		\
-				 (pix->width * (y) / 2) + (x) / 2)
-#define V2_OFFSET(pix, x, y)	((pix->width * pix->height) +		\
-				 (pix->width * pix->height / 2) +	\
-				 (pix->width * (y) / 2) + (x) / 2)
-#define UV_OFFSET(pix, x, y)	((pix->width * pix->height) +	\
-				 (pix->width * ((y) / 2)) + (x))
-#define UV2_OFFSET(pix, x, y)	((pix->width * pix->height) +	\
-				 (pix->width * y) + (x))
+#define Y_OFFSET(pix, x, y)	((x) + pix->bytesperline * (y))
+#define U_OFFSET(pix, x, y)	((pix->bytesperline * pix->height) +	 \
+				 (pix->bytesperline * ((y) / 2) / 2) + (x) / 2)
+#define V_OFFSET(pix, x, y)	((pix->bytesperline * pix->height) +	 \
+				 (pix->bytesperline * pix->height / 4) + \
+				 (pix->bytesperline * ((y) / 2) / 2) + (x) / 2)
+#define U2_OFFSET(pix, x, y)	((pix->bytesperline * pix->height) +	 \
+				 (pix->bytesperline * (y) / 2) + (x) / 2)
+#define V2_OFFSET(pix, x, y)	((pix->bytesperline * pix->height) +	 \
+				 (pix->bytesperline * pix->height / 2) + \
+				 (pix->bytesperline * (y) / 2) + (x) / 2)
+#define UV_OFFSET(pix, x, y)	((pix->bytesperline * pix->height) +	 \
+				 (pix->bytesperline * ((y) / 2)) + (x))
+#define UV2_OFFSET(pix, x, y)	((pix->bytesperline * pix->height) +	 \
+				 (pix->bytesperline * y) + (x))
 
 #define NUM_ALPHA_CHANNELS	7
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2021-09-07 13:07 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-30 11:59 [PATCH AUTOSEL 5.13 01/14] gpu: ipu-v3: Fix i.MX IPU-v3 offset calculations for (semi)planar U/V formats Sasha Levin
2021-08-30 11:59 ` [PATCH AUTOSEL 5.13 02/14] reset: reset-zynqmp: Fixed the argument data type Sasha Levin
2021-08-30 11:59   ` Sasha Levin
2021-08-30 11:59 ` [PATCH AUTOSEL 5.13 03/14] qed: Fix the VF msix vectors flow Sasha Levin
2021-08-30 11:59 ` [PATCH AUTOSEL 5.13 04/14] net: dsa: mv88e6xxx: Update mv88e6393x serdes errata Sasha Levin
2021-08-30 11:59 ` [PATCH AUTOSEL 5.13 05/14] riscv: dts: microchip: Use 'local-mac-address' for emac1 Sasha Levin
2021-08-30 11:59   ` Sasha Levin
2021-08-30 11:59 ` [PATCH AUTOSEL 5.13 06/14] riscv: dts: microchip: Add ethernet0 to the aliases node Sasha Levin
2021-08-30 11:59   ` Sasha Levin
2021-08-30 11:59 ` [PATCH AUTOSEL 5.13 07/14] net: macb: Add a NULL check on desc_ptp Sasha Levin
2021-08-30 11:59 ` [PATCH AUTOSEL 5.13 08/14] qede: Fix memset corruption Sasha Levin
2021-08-30 11:59 ` [PATCH AUTOSEL 5.13 09/14] perf/x86/intel/pt: Fix mask of num_address_ranges Sasha Levin
2021-08-30 11:59 ` [PATCH AUTOSEL 5.13 10/14] ceph: fix possible null-pointer dereference in ceph_mdsmap_decode() Sasha Levin
2021-08-30 11:59 ` [PATCH AUTOSEL 5.13 11/14] perf/x86/amd/ibs: Work around erratum #1197 Sasha Levin
2021-08-30 11:59 ` [PATCH AUTOSEL 5.13 12/14] perf/x86/amd/power: Assign pmu.module Sasha Levin
2021-08-30 11:59 ` [PATCH AUTOSEL 5.13 13/14] net: fix NULL pointer reference in cipso_v4_doi_free Sasha Levin
2021-08-30 12:42   ` Dongliang Mu
2021-08-30 14:20     ` Paul Moore
2021-09-05 12:54       ` Sasha Levin
2021-09-07 13:06         ` Paul Moore
2021-08-30 11:59 ` [PATCH AUTOSEL 5.13 14/14] cryptoloop: add a deprecation warning Sasha Levin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.