All of lore.kernel.org
 help / color / mirror / Atom feed
From: YoungJun Cho <yj44.cho@samsung.com>
To: airlied@linux.ie, dri-devel@lists.freedesktop.org
Cc: mark.rutland@arm.com, devicetree@vger.kernel.org,
	linux-samsung-soc@vger.kernel.org, pawel.moll@arm.com,
	ijc+devicetree@hellion.org.uk, sw0312.kim@samsung.com,
	a.hajda@samsung.com, kyungmin.park@samsung.com,
	robh+dt@kernel.org, galak@codeaurora.org, kgene.kim@samsung.com
Subject: [PATCH v4 02/14] drm/exynos: use wait_event_timeout() for safety usage
Date: Thu, 05 Jun 2014 15:19:42 +0900	[thread overview]
Message-ID: <1401949194-20092-3-git-send-email-yj44.cho@samsung.com> (raw)
In-Reply-To: <1401949194-20092-1-git-send-email-yj44.cho@samsung.com>

There could be the case that the page flip operation isn't finished correctly
with some abnormal condition such as panel reset. So this patch replaces
wait_event() with wait_event_timeout() to avoid waiting for page flip completion
infinitely.
And clears exynos_crtc->pending_flip in exynos_drm_crtc_page_flip()
when exynos_drm_crtc_mode_set_commit() is failed.

Signed-off-by: YoungJun Cho <yj44.cho@samsung.com>
Acked-by: Inki Dae <inki.dae@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_drm_crtc.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
index 95c9435..3bf091d 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
@@ -69,8 +69,10 @@ static void exynos_drm_crtc_dpms(struct drm_crtc *crtc, int mode)
 
 	if (mode > DRM_MODE_DPMS_ON) {
 		/* wait for the completion of page flip. */
-		wait_event(exynos_crtc->pending_flip_queue,
-				atomic_read(&exynos_crtc->pending_flip) == 0);
+		if (!wait_event_timeout(exynos_crtc->pending_flip_queue,
+				!atomic_read(&exynos_crtc->pending_flip),
+				HZ/20))
+			atomic_set(&exynos_crtc->pending_flip, 0);
 		drm_vblank_off(crtc->dev, exynos_crtc->pipe);
 	}
 
@@ -259,6 +261,7 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
 			spin_lock_irq(&dev->event_lock);
 			drm_vblank_put(dev, exynos_crtc->pipe);
 			list_del(&event->base.link);
+			atomic_set(&exynos_crtc->pending_flip, 0);
 			spin_unlock_irq(&dev->event_lock);
 
 			goto out;
-- 
1.7.9.5

  parent reply	other threads:[~2014-06-05  6:19 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-05  6:19 [PATCH v4 00/14] drm/exynos: support LCD I80 interface display YoungJun Cho
2014-06-05  6:19 ` [PATCH v4 01/14] drm/exynos: dsi: move the EoT packets configuration point YoungJun Cho
2014-06-05  6:19 ` YoungJun Cho [this message]
2014-06-05  6:19 ` [PATCH v4 03/14] ARM: dts: samsung-fimd: add LCD I80 interface specific properties YoungJun Cho
2014-06-05  6:19 ` [PATCH v4 04/14] drm/exynos: add TE handler to support LCD I80 interface YoungJun Cho
2014-06-05  6:19 ` [PATCH v4 05/14] drm/exynos: dsi: " YoungJun Cho
2014-06-05  6:19 ` [PATCH v4 06/14] drm/exynos: fimd: " YoungJun Cho
2014-06-05  6:19 ` [PATCH v4 07/14] ARM: dts: exynos_dsim: add exynos5420 compatible to DT bindings YoungJun Cho
2014-06-05  6:19 ` [PATCH v4 08/14] drm/exynos: dsi: add driver data to support Exynos5420 YoungJun Cho
2014-06-05  6:19 ` [PATCH v4 09/14] ARM: dts: s6e3fa0: add DT bindings YoungJun Cho
2014-06-05  6:19 ` [PATCH v4 10/14] drm/panel: add S6E3FA0 driver YoungJun Cho
2014-06-05  6:19 ` [PATCH v4 11/14] ARM: dts: exynos4: add system register property YoungJun Cho
2014-06-05  6:19 ` [PATCH v4 12/14] ARM: dts: exynos5: " YoungJun Cho
2014-06-05  6:19 ` [PATCH v4 13/14] ARM: dts: exynos5420: add mipi-phy node YoungJun Cho
2014-06-05  6:19 ` [PATCH v4 14/14] ARM: dts: exynos5420: add dsi node YoungJun Cho
2014-06-05  8:14 ` [PATCH v4 00/14] drm/exynos: support LCD I80 interface display Inki Dae
2014-06-05  8:20   ` Thierry Reding
2014-06-05  8:43     ` Inki Dae
2014-06-05  8:51       ` Thierry Reding

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1401949194-20092-3-git-send-email-yj44.cho@samsung.com \
    --to=yj44.cho@samsung.com \
    --cc=a.hajda@samsung.com \
    --cc=airlied@linux.ie \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=kgene.kim@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=sw0312.kim@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.