From: Varad Gautam <varad.gau...@collabora.com>

the hardware does not provide interrupts on vblank, so we just send a fake
vblank event on atomic_flush.

Signed-off-by: Varad Gautam <varad.gau...@collabora.com>
---
 drivers/gpu/drm/cirrus/cirrus_mode.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/gpu/drm/cirrus/cirrus_mode.c 
b/drivers/gpu/drm/cirrus/cirrus_mode.c
index eda3c4d18b37..e777157fe474 100644
--- a/drivers/gpu/drm/cirrus/cirrus_mode.c
+++ b/drivers/gpu/drm/cirrus/cirrus_mode.c
@@ -226,6 +226,23 @@ static void cirrus_crtc_destroy(struct drm_crtc *crtc)
        kfree(cirrus_crtc);
 }
 
+static void cirrus_crtc_atomic_flush(struct drm_crtc *crtc,
+                                    struct drm_crtc_state *old_crtc_state)
+{
+       struct drm_device *dev = crtc->dev;
+       struct drm_pending_vblank_event *event;
+       unsigned long flags;
+
+       if (crtc->state && crtc->state->event) {
+               event = crtc->state->event;
+               crtc->state->event = NULL;
+
+               spin_lock_irqsave(&dev->event_lock, flags);
+               drm_crtc_send_vblank_event(crtc, event);
+               spin_unlock_irqrestore(&dev->event_lock, flags);
+       }
+}
+
 /* These provide the minimum set of functions required to handle a CRTC */
 static const struct drm_crtc_funcs cirrus_crtc_funcs = {
        .gamma_set = cirrus_crtc_gamma_set,
@@ -244,6 +261,7 @@ static const struct drm_crtc_helper_funcs 
cirrus_helper_funcs = {
        .prepare = cirrus_crtc_prepare,
        .commit = cirrus_crtc_commit,
        .load_lut = cirrus_crtc_load_lut,
+       .atomic_flush = cirrus_crtc_atomic_flush,
 };
 
 static int cirrus_plane_update(struct drm_plane *plane,
-- 
2.13.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to