kfree(omap_crtc);
}
+static void omap_crtc_arm_event(struct drm_crtc *crtc)
+{
+ struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
+
+ WARN_ON(omap_crtc->pending);
+ omap_crtc->pending = true;
+
+ if (crtc->state->event) {
+ omap_crtc->event = crtc->state->event;
+ crtc->state->event = NULL;
+ }
+}
+
static void omap_crtc_enable(struct drm_crtc *crtc)
{
struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
ret = drm_crtc_vblank_get(crtc);
WARN_ON(ret != 0);
- WARN_ON(omap_crtc->pending);
- omap_crtc->pending = true;
+ omap_crtc_arm_event(crtc);
spin_unlock_irq(&crtc->dev->event_lock);
}
DBG("%s", omap_crtc->name);
+ spin_lock_irq(&crtc->dev->event_lock);
+ if (crtc->state->event) {
+ drm_crtc_send_vblank_event(crtc, crtc->state->event);
+ crtc->state->event = NULL;
+ }
+ spin_unlock_irq(&crtc->dev->event_lock);
+
drm_crtc_vblank_off(crtc);
}
spin_lock_irq(&crtc->dev->event_lock);
priv->dispc_ops->mgr_go(omap_crtc->channel);
-
- WARN_ON(omap_crtc->pending);
- omap_crtc->pending = true;
-
- if (crtc->state->event)
- omap_crtc->event = crtc->state->event;
+ omap_crtc_arm_event(crtc);
spin_unlock_irq(&crtc->dev->event_lock);
}