Skip to content

Commit f3396f6

Browse files
jernejskgregkh
authored andcommitted
drm/sun4i: Fix macros in sun8i_csc.h
commit c302c98 upstream. 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 quite sometime, it actually become important after CSC code rework with commit ea067ae ("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: 8830293 ("drm/sun4i: Add DE2 CSC library") Reported-by: Roman Stratiienko <r.stratiienko@gmail.com> Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Maxime Ripard <maxime@cerno.tech> Link: https://patchwork.freedesktop.org/patch/msgid/20210831184819.93670-1-jernej.skrabec@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 1023355 commit f3396f6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/gpu/drm/sun4i/sun8i_csc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ struct sun8i_mixer;
1616
#define CCSC10_OFFSET 0xA0000
1717
#define CCSC11_OFFSET 0xF0000
1818

19-
#define SUN8I_CSC_CTRL(base) (base + 0x0)
20-
#define SUN8I_CSC_COEFF(base, i) (base + 0x10 + 4 * i)
19+
#define SUN8I_CSC_CTRL(base) ((base) + 0x0)
20+
#define SUN8I_CSC_COEFF(base, i) ((base) + 0x10 + 4 * (i))
2121

2222
#define SUN8I_CSC_CTRL_EN BIT(0)
2323

0 commit comments

Comments
 (0)