drm: rcar-du: Fix CRTC timings when CMM is used
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Mon, 29 Nov 2021 01:10:46 +0000 (03:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:04:35 +0000 (11:04 +0100)
commit4d6a98ce80f6fd34f8c3034602bc53e219b6d9f1
tree837a59d9e2069c8a5dd4c0f5606ddaaaaeb4fb14
parent30bd6733ef960e02fcbac7f2bedb9df1830a5a7d
drm: rcar-du: Fix CRTC timings when CMM is used

[ Upstream commit f0ce591dc9a97067c6e783a2eaccd22c5476144d ]

When the CMM is enabled, an offset of 25 pixels must be subtracted from
the HDS (horizontal display start) and HDE (horizontal display end)
registers. Fix the timings calculation, and take this into account in
the mode validation.

This fixes a visible horizontal offset in the image with VGA monitors.
HDMI monitors seem to be generally more tolerant to incorrect timings,
but may be affected too.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/rcar-du/rcar_du_crtc.c