Skip to content

Commit 7a79279

Browse files
Russell Kingdliviu
authored andcommitted
drm/arm: hdlcd: fix plane base address update
While testing HDMI with Xorg on the Juno board, I find that when Xorg starts up or shuts down, the display is shifted significantly to the right and wrapped in the active region. (No sync bars are visible.) The timings are correct, it behaves as if the start address has been shifted many pixels _into_ the framebuffer. This occurs whenever the display mode size is changed - using xrandr in Xorg shows that changing the resolution triggers the problem almost every time, but changing the refresh rate does not. Using devmem2 to disable and re-enable the HDLCD resolves the issue, and repeated disable/enable cycles do not make the issue re-appear. Further debugging shows that we try to update the controller configuration while enabled. Alwys ensure that the HDLCD is disabled prior to updating the controller timings, and use drm_crtc_vblank_off()/drm_crtc_vblank_on() so that DRM knows whether it can expect vblank interrupts. Signed-off-by: Russell King <[email protected]> Signed-off-by: Liviu Dudau <[email protected]>
1 parent a25f094 commit 7a79279

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/gpu/drm/arm/hdlcd_crtc.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,14 @@ static void hdlcd_crtc_enable(struct drm_crtc *crtc)
150150
clk_prepare_enable(hdlcd->clk);
151151
hdlcd_crtc_mode_set_nofb(crtc);
152152
hdlcd_write(hdlcd, HDLCD_REG_COMMAND, 1);
153+
drm_crtc_vblank_on(crtc);
153154
}
154155

155156
static void hdlcd_crtc_disable(struct drm_crtc *crtc)
156157
{
157158
struct hdlcd_drm_private *hdlcd = crtc_to_hdlcd_priv(crtc);
158159

159-
if (!crtc->state->active)
160-
return;
161-
160+
drm_crtc_vblank_off(crtc);
162161
hdlcd_write(hdlcd, HDLCD_REG_COMMAND, 0);
163162
clk_disable_unprepare(hdlcd->clk);
164163
}

0 commit comments

Comments
 (0)