0519-drm-vc4-Enable-Disable-vblanks-properly-in-crtc-en-d.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. From c4bd9665b145cacfdf9cbd5f3d83ed0961080236 Mon Sep 17 00:00:00 2001
  2. From: Mario Kleiner <mario.kleiner.de@gmail.com>
  3. Date: Tue, 19 Jul 2016 20:59:01 +0200
  4. Subject: [PATCH] drm/vc4: Enable/Disable vblanks properly in crtc en/disable.
  5. Add missing drm_crtc_vblank_on/off() calls so vblank irq
  6. handling/updating/timestamping never runs with a crtc shut down
  7. or during its shutdown/startup, as that causes large jumps in
  8. vblank count and trouble for compositors.
  9. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
  10. Signed-off-by: Eric Anholt <eric@anholt.net>
  11. ---
  12. drivers/gpu/drm/vc4/vc4_crtc.c | 6 ++++++
  13. 1 file changed, 6 insertions(+)
  14. --- a/drivers/gpu/drm/vc4/vc4_crtc.c
  15. +++ b/drivers/gpu/drm/vc4/vc4_crtc.c
  16. @@ -468,6 +468,9 @@ static void vc4_crtc_disable(struct drm_
  17. int ret;
  18. require_hvs_enabled(dev);
  19. + /* Disable vblank irq handling before crtc is disabled. */
  20. + drm_crtc_vblank_off(crtc);
  21. +
  22. if (VC4_DSI_USE_FIRMWARE_SETUP &&
  23. (CRTC_READ(PV_V_CONTROL) & PV_VCONTROL_DSI)) {
  24. /* Skip disabling the PV/HVS for the channel if it was
  25. @@ -531,6 +534,9 @@ static void vc4_crtc_enable(struct drm_c
  26. /* Turn on the pixel valve, which will emit the vstart signal. */
  27. CRTC_WRITE(PV_V_CONTROL,
  28. CRTC_READ(PV_V_CONTROL) | PV_VCONTROL_VIDEN);
  29. +
  30. + /* Enable vblank irq handling after crtc is started. */
  31. + drm_crtc_vblank_on(crtc);
  32. }
  33. static bool vc4_crtc_mode_fixup(struct drm_crtc *crtc,