summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/omap_crtc.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2015-01-18 15:57:36 +0100
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2015-06-12 21:52:45 +0200
commit1d5e5ea1f6061ec9ad4f43928697f479aeb884c6 (patch)
tree316b7d55f847846b55cc6dd6db36cf87da001d7b /drivers/gpu/drm/omapdrm/omap_crtc.c
parentdrm: omapdrm: Simplify IRQ registration (diff)
downloadlinux-1d5e5ea1f6061ec9ad4f43928697f479aeb884c6.tar.xz
linux-1d5e5ea1f6061ec9ad4f43928697f479aeb884c6.zip
drm: omapdrm: Cancel pending page flips when closing device
Pending page flips must be cancelled when closing the device, otherwise their completion at next vblank will result in nasty effects, including possible oopses due to resources required to complete the page flip being freed. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_crtc.c')
-rw-r--r--drivers/gpu/drm/omapdrm/omap_crtc.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c
index 85129d56cf4c..a60f4e49b55f 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.c
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
@@ -263,9 +263,28 @@ static const struct dss_mgr_ops mgr_ops = {
};
/* -----------------------------------------------------------------------------
- * Setup and Flush
+ * Setup, Flush and Page Flip
*/
+void omap_crtc_cancel_page_flip(struct drm_crtc *crtc, struct drm_file *file)
+{
+ struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
+ struct drm_device *dev = crtc->dev;
+ unsigned long flags;
+
+ spin_lock_irqsave(&dev->event_lock, flags);
+
+ /* Only complete events queued for our file handle. */
+ if (omap_crtc->flip_event &&
+ file == omap_crtc->flip_event->base.file_priv) {
+ drm_send_vblank_event(dev, omap_crtc->pipe,
+ omap_crtc->flip_event);
+ omap_crtc->flip_event = NULL;
+ }
+
+ spin_unlock_irqrestore(&dev->event_lock, flags);
+}
+
static void omap_crtc_error_irq(struct omap_drm_irq *irq, uint32_t irqstatus)
{
struct omap_crtc *omap_crtc =