summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Kleiner2016-07-19 20:59:01 +0200
committerEric Anholt2016-08-20 04:05:59 +0200
commite941f05d3c1155b5cee65e146324219c6a72be27 (patch)
treea444e7c871d6a15eb2c7241c91899e0ffcde071b
parentdrm/vc4: Enable precise vblank timestamping for interlaced modes. (diff)
downloadkernel-qcow2-linux-e941f05d3c1155b5cee65e146324219c6a72be27.tar.gz
kernel-qcow2-linux-e941f05d3c1155b5cee65e146324219c6a72be27.tar.xz
kernel-qcow2-linux-e941f05d3c1155b5cee65e146324219c6a72be27.zip
drm/vc4: Enable/Disable vblanks properly in crtc en/disable.
Add missing drm_crtc_vblank_on/off() calls so vblank irq handling/updating/timestamping never runs with a crtc shut down or during its shutdown/startup, as that causes large jumps in vblank count and trouble for compositors. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Signed-off-by: Eric Anholt <eric@anholt.net>
-rw-r--r--drivers/gpu/drm/vc4/vc4_crtc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c
index 7ffdad543ed2..2682f07d8f1e 100644
--- a/drivers/gpu/drm/vc4/vc4_crtc.c
+++ b/drivers/gpu/drm/vc4/vc4_crtc.c
@@ -475,6 +475,9 @@ static void vc4_crtc_disable(struct drm_crtc *crtc)
int ret;
require_hvs_enabled(dev);
+ /* Disable vblank irq handling before crtc is disabled. */
+ drm_crtc_vblank_off(crtc);
+
CRTC_WRITE(PV_V_CONTROL,
CRTC_READ(PV_V_CONTROL) & ~PV_VCONTROL_VIDEN);
ret = wait_for(!(CRTC_READ(PV_V_CONTROL) & PV_VCONTROL_VIDEN), 1);
@@ -525,6 +528,9 @@ static void vc4_crtc_enable(struct drm_crtc *crtc)
/* Turn on the pixel valve, which will emit the vstart signal. */
CRTC_WRITE(PV_V_CONTROL,
CRTC_READ(PV_V_CONTROL) | PV_VCONTROL_VIDEN);
+
+ /* Enable vblank irq handling after crtc is started. */
+ drm_crtc_vblank_on(crtc);
}
static bool vc4_crtc_mode_fixup(struct drm_crtc *crtc,