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 09:54:14 +0000 (10:54 +0100)
commitd0e3ab637de1e8940a8940432c9de11e0fcc7b0a
tree96b047215c081e5e132dd91a4b205f8ea3e36ded
parente61aa46d0f27bd460080ccd244296d1944b9813e
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