diff mbox series

drm/sun4i: Fix macros in sun8i_csc.h

Message ID 20210831184819.93670-1-jernej.skrabec@gmail.com (mailing list archive)
State New, archived
Headers show
Series drm/sun4i: Fix macros in sun8i_csc.h | expand

Commit Message

Jernej Škrabec Aug. 31, 2021, 6:48 p.m. UTC
Macros SUN8I_CSC_CTRL() and SUN8I_CSC_COEFF() don't follow usual
recommendation of having arguments enclosed in parenthesis. While that
didn't change anything for quiet sometime, it actually become important
after CSC code rework with commit ea067aee45a8 ("drm/sun4i: de2/de3:
Remove redundant CSC matrices").

Without this fix, colours are completely off for supported YVU formats
on SoCs with DE2 (A64, H3, R40, etc.).

Fix the issue by enclosing macro arguments in parenthesis.

Cc: stable@vger.kernel.org # 5.12+
Fixes: 883029390550 ("drm/sun4i: Add DE2 CSC library")
Reported-by: Roman Stratiienko <r.stratiienko@gmail.com>
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
---
 drivers/gpu/drm/sun4i/sun8i_csc.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Chen-Yu Tsai Sept. 1, 2021, 3:13 a.m. UTC | #1
On Wed, Sep 1, 2021 at 2:48 AM Jernej Skrabec <jernej.skrabec@gmail.com> wrote:
>
> Macros SUN8I_CSC_CTRL() and SUN8I_CSC_COEFF() don't follow usual
> recommendation of having arguments enclosed in parenthesis. While that
> didn't change anything for quiet sometime, it actually become important

                             ^ Typo

> after CSC code rework with commit ea067aee45a8 ("drm/sun4i: de2/de3:
> Remove redundant CSC matrices").
>
> Without this fix, colours are completely off for supported YVU formats
> on SoCs with DE2 (A64, H3, R40, etc.).
>
> Fix the issue by enclosing macro arguments in parenthesis.
>
> Cc: stable@vger.kernel.org # 5.12+
> Fixes: 883029390550 ("drm/sun4i: Add DE2 CSC library")
> Reported-by: Roman Stratiienko <r.stratiienko@gmail.com>
> Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>

Otherwise,

Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Maxime Ripard Sept. 1, 2021, 9:44 a.m. UTC | #2
On Wed, Sep 01, 2021 at 11:13:01AM +0800, Chen-Yu Tsai wrote:
> On Wed, Sep 1, 2021 at 2:48 AM Jernej Skrabec <jernej.skrabec@gmail.com> wrote:
> >
> > Macros SUN8I_CSC_CTRL() and SUN8I_CSC_COEFF() don't follow usual
> > recommendation of having arguments enclosed in parenthesis. While that
> > didn't change anything for quiet sometime, it actually become important
> 
>                              ^ Typo
> 
> > after CSC code rework with commit ea067aee45a8 ("drm/sun4i: de2/de3:
> > Remove redundant CSC matrices").
> >
> > Without this fix, colours are completely off for supported YVU formats
> > on SoCs with DE2 (A64, H3, R40, etc.).
> >
> > Fix the issue by enclosing macro arguments in parenthesis.
> >
> > Cc: stable@vger.kernel.org # 5.12+
> > Fixes: 883029390550 ("drm/sun4i: Add DE2 CSC library")
> > Reported-by: Roman Stratiienko <r.stratiienko@gmail.com>
> > Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
> 
> Otherwise,
> 
> Reviewed-by: Chen-Yu Tsai <wens@csie.org>

Fixed the typo and applied, thanks
Maxime
diff mbox series

Patch

diff --git a/drivers/gpu/drm/sun4i/sun8i_csc.h b/drivers/gpu/drm/sun4i/sun8i_csc.h
index a55a38ad849c..022cafa6c06c 100644
--- a/drivers/gpu/drm/sun4i/sun8i_csc.h
+++ b/drivers/gpu/drm/sun4i/sun8i_csc.h
@@ -16,8 +16,8 @@  struct sun8i_mixer;
 #define CCSC10_OFFSET 0xA0000
 #define CCSC11_OFFSET 0xF0000
 
-#define SUN8I_CSC_CTRL(base)		(base + 0x0)
-#define SUN8I_CSC_COEFF(base, i)	(base + 0x10 + 4 * i)
+#define SUN8I_CSC_CTRL(base)		((base) + 0x0)
+#define SUN8I_CSC_COEFF(base, i)	((base) + 0x10 + 4 * (i))
 
 #define SUN8I_CSC_CTRL_EN		BIT(0)