[PATCH] drm/exynos: release unhandled page flip events at postclose.

Inki Dae inki.dae at samsung.com
Mon Sep 30 03:45:32 PDT 2013

This patch resolves a dead lock issue that could be incurred when
exynos_drm_crtc_dpms function was called.

The exynos_drm_crtc_dpms function waits for the completion of pended
page flip events. However, preclose callback - this releases all unhandled
page flip events - is called prior to the exynos_drm_crtc_dpms function call
when drm is closed. So at this time, this will make the exynos_drm_crtc_dpms
to wait infiniately for the completion of the page flip events.

This patch releases the unhandled page flip events at postclose instead
of preclose so that exynos_drm_crtc_dpms function can be waked up.

Signed-off-by: Inki Dae <inki.dae at samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park at samsung.com>
 drivers/gpu/drm/exynos/exynos_drm_drv.c |   15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index f727f98..9974294 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -167,10 +167,18 @@ static int exynos_drm_open(struct drm_device *dev, struct drm_file *file)
 static void exynos_drm_preclose(struct drm_device *dev,
 					struct drm_file *file)
+	exynos_drm_subdrv_close(dev, file);
+static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file)
 	struct exynos_drm_private *private = dev->dev_private;
 	struct drm_pending_vblank_event *e, *t;
 	unsigned long flags;
+	if (!file->driver_priv)
+		return;
 	/* release events of current file */
 	spin_lock_irqsave(&dev->event_lock, flags);
 	list_for_each_entry_safe(e, t, &private->pageflip_event_list,
@@ -182,13 +190,6 @@ static void exynos_drm_preclose(struct drm_device *dev,
 	spin_unlock_irqrestore(&dev->event_lock, flags);
-	exynos_drm_subdrv_close(dev, file);
-static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file)
-	if (!file->driver_priv)
-		return;
 	file->driver_priv = NULL;

More information about the dri-devel mailing list