MLK-16986-5: drm: mxsfb_crtc: Fix the framebuffer misplacement
authorFabio Estevam <fabio.estevam@nxp.com>
Thu, 2 Feb 2017 21:26:38 +0000 (19:26 -0200)
committerNitin Garg <nitin.garg@nxp.com>
Tue, 20 Mar 2018 19:50:09 +0000 (14:50 -0500)
commiteea348bf0dee7016d049ce20ee686346961191f4
tree9fd48921b8597280e06322651ee733dcf1c04c37
parent92fb9731165f9785c8f7a947faaf39f361a52de6
MLK-16986-5: drm: mxsfb_crtc: Fix the framebuffer misplacement

Currently the framebuffer content is displayed with incorrect offsets
in both the vertical and horizontal directions.

The fbdev version of the driver does not show this problem. Breno Lima
dumped the eLCDIF controller registers on both the drm and fbdev drivers
and noticed that the VDCTRL3 register is configured incorrectly in the
drm driver.

The fbdev driver calculates the vertical and horizontal wait counts
of the VDCTRL3 register by doing: back porch + sync length.

Looking at the horizontal and vertical timing diagram from
include/drm/drm_modes.h this value corresponds to:

crtc_[hv]total - crtc_[hv]sync_start

So fix the VDCTRL3 register setting accordingly so that the eLCDIF
controller can properly show the framebuffer content in the correct
position.

Reported-by: Breno Lima <breno.lima@nxp.com>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Tested-by: Breno Lima <breno.lima@nxp.com>
Tested-by: Marek Vasut <marex@denx.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
drivers/gpu/drm/mxsfb/mxsfb_crtc.c