0579-drm-vc4-Fix-sending-of-page-flip-completion-events-i.patch 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. From 5aecf0a83cc2271427aad4f1a313a3c01e581c03 Mon Sep 17 00:00:00 2001
  2. From: Eric Anholt <eric@anholt.net>
  3. Date: Thu, 2 Feb 2017 09:42:18 -0800
  4. Subject: [PATCH] drm/vc4: Fix sending of page flip completion events in FKMS
  5. mode.
  6. In the rewrite of vc4_crtc.c for fkms, I dropped the part of the
  7. CRTC's atomic flush handler that moved the completion event from the
  8. proposed atomic state change to the CRTC's current state. That meant
  9. that when full screen pageflipping happened (glxgears -fullscreen in
  10. X, compton, por weston), the app would end up blocked firever waiting
  11. to draw its next frame.
  12. Signed-off-by: Eric Anholt <eric@anholt.net>
  13. ---
  14. drivers/gpu/drm/vc4/vc4_firmware_kms.c | 15 +++++++++++++++
  15. 1 file changed, 15 insertions(+)
  16. --- a/drivers/gpu/drm/vc4/vc4_firmware_kms.c
  17. +++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c
  18. @@ -312,6 +312,21 @@ static int vc4_crtc_atomic_check(struct
  19. static void vc4_crtc_atomic_flush(struct drm_crtc *crtc,
  20. struct drm_crtc_state *old_state)
  21. {
  22. + struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
  23. + struct drm_device *dev = crtc->dev;
  24. +
  25. + if (crtc->state->event) {
  26. + unsigned long flags;
  27. +
  28. + crtc->state->event->pipe = drm_crtc_index(crtc);
  29. +
  30. + WARN_ON(drm_crtc_vblank_get(crtc) != 0);
  31. +
  32. + spin_lock_irqsave(&dev->event_lock, flags);
  33. + vc4_crtc->event = crtc->state->event;
  34. + crtc->state->event = NULL;
  35. + spin_unlock_irqrestore(&dev->event_lock, flags);
  36. + }
  37. }
  38. static void vc4_crtc_handle_page_flip(struct vc4_crtc *vc4_crtc)