From patchwork Mon Sep 30 10:45:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 2964321 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3FB19BFF0B for ; Mon, 30 Sep 2013 10:46:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E6205200E1 for ; Mon, 30 Sep 2013 10:46:44 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id BD85A200DB for ; Mon, 30 Sep 2013 10:46:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 89615E6A78 for ; Mon, 30 Sep 2013 03:46:39 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by gabe.freedesktop.org (Postfix) with ESMTP id 12D35E5DCD for ; Mon, 30 Sep 2013 03:46:26 -0700 (PDT) Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MTX00LW0PVFSTT0@mailout2.samsung.com> for dri-devel@lists.freedesktop.org; Mon, 30 Sep 2013 19:45:32 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.112]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id 3B.99.17682.C4659425; Mon, 30 Sep 2013 19:45:32 +0900 (KST) X-AuditID: cbfee68e-b7f756d000004512-f5-5249564c5529 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 6D.D3.05832.C4659425; Mon, 30 Sep 2013 19:45:32 +0900 (KST) Received: from daeinki-desktop.10.32.193.11 ([10.252.75.62]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MTX00C6EPVWLN60@mmp2.samsung.com>; Mon, 30 Sep 2013 19:45:32 +0900 (KST) From: Inki Dae To: airlied@linux.ie, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/exynos: release unhandled page flip events at postclose. Date: Mon, 30 Sep 2013 19:45:32 +0900 Message-id: <1380537932-2702-1-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrCLMWRmVeSWpSXmKPExsWyRsSkQNcnzDPIYM9dC4vecyeZLK58fc9m Men+BBaLs01v2B1YPLZ/e8Dqcb/7OJNH35ZVjAHMUVw2Kak5mWWpRfp2CVwZR676FWwTqHj4 9SNbA+Mb3i5GDg4JAROJY1/ruhg5gUwxiQv31rN1MXJxCAksZZT4dvUJC0TCRGLWvU2MEInp jBL/rxxhhXC6mSSWtK8Gq2ITUJWYuOI+G4gtImAq0TFpKVicWcBOYteDfnYQW1jAV+L6lOus IDYLUP27LU8ZQWxeAWeJKS9nMkJcpCAxZ5INyHwJgftsEm2z/rJA1AtIfJt8iAWiRlZi0wFm iOMkJQ6uuMEygVFwASPDKkbR1ILkguKk9CIjveLE3OLSvHS95PzcTYzAEDz971nfDsabB6wP MSYDjZvILCWanA8M4bySeENjMyMLUxNTYyNzSzPShJXEedVarAOFBNITS1KzU1MLUovii0pz UosPMTJxcEo1MLZ7RiyL+Tq32PSR7qz58k/qxBI+Low3uHLKen6GRffldQ9f7Wt9fWLyBUll rR1tde8ap79Vt56f4vrVeqq4J5vDdqnzyzQaTtq5iBaHvNjbvm0xO0OlwB2LewoSTnnrOZPN Srj9zopsC/rcq6/3TG7i/edzugI/PHB6/Ehx327e++yNdy7f0VNiKc5INNRiLipOBADBIXUg VwIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrEIsWRmVeSWpSXmKPExsVy+t9jQV2fMM8ggzOLDSx6z51ksrjy9T2b xaT7E1gszja9YXdg8dj+7QGrx/3u40wefVtWMQYwRzUw2mSkJqakFimk5iXnp2TmpdsqeQfH O8ebmhkY6hpaWpgrKeQl5qbaKrn4BOi6ZeYA7VNSKEvMKQUKBSQWFyvp22GaEBripmsB0xih 6xsSBNdjZIAGEtYwZhy56lewTaDi4dePbA2Mb3i7GDk5JARMJGbd28QIYYtJXLi3nq2LkYtD SGA6o8T/K0dYIZxuJokl7atZQKrYBFQlJq64zwZiiwiYSnRMWgoWZxawk9j1oJ8dxBYW8JW4 PuU6K4jNAlT/bstTsA28As4SU17OBLI5gLYpSMyZZDOBkXsBI8MqRtHUguSC4qT0XCO94sTc 4tK8dL3k/NxNjOAQfya9g3FVg8UhRgEORiUeXoulHkFCrIllxZW5hxglOJiVRHgnuHkGCfGm JFZWpRblxxeV5qQWH2JMBlo+kVlKNDkfGH95JfGGxiZmRpZG5oYWRsbmpAkrifMebLUOFBJI TyxJzU5NLUgtgtnCxMEp1cDIs/9DpMzaaVqRLDqcLy8UcF8rqxU5sXDzjYqJpyOceo4kXskq D1NrUltVz5QgEyuY22H5/2junSumW9NtC7MWhX11U1nIHm5/oGHWnjXNzZ5f/GSf2To/yJzM dGr1goNv/mZaulUd3Vm5L1fNreeNauWrT0cE2buLA4LMlJ5se6PlfOZUvZASS3FGoqEWc1Fx IgAefmCxtQIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: kyungmin.park@samsung.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Kyungmin Park --- 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; kfree(file->driver_priv); file->driver_priv = NULL;