Skip to contentSkip to conversation

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

PATCH Superseded Inki Dae 1 participant 1 message Sep 30, 2013

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Inki Dae

author maintainer
#0 lore raw

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

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.

---
 drivers/gpu/drm/exynos/exynos_drm_drv.c |   15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_drv.c +8 -7
index f727f98..9974294 100644
@@ -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;
 
 	kfree(file->driver_priv);
 	file->driver_priv = NULL;
Signature · 1 line
1.7.9.5