From patchwork Wed Feb 22 16:05:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 9587075 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B9CD9600CA for ; Wed, 22 Feb 2017 16:05:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A525628678 for ; Wed, 22 Feb 2017 16:05:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 99E322867D; Wed, 22 Feb 2017 16:05:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D6A128678 for ; Wed, 22 Feb 2017 16:05:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754713AbdBVQFV (ORCPT ); Wed, 22 Feb 2017 11:05:21 -0500 Received: from mailout3.w1.samsung.com ([210.118.77.13]:62620 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753919AbdBVQFU (ORCPT ); Wed, 22 Feb 2017 11:05:20 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OLS00DLCA0TVI80@mailout3.w1.samsung.com> for linux-samsung-soc@vger.kernel.org; Wed, 22 Feb 2017 16:05:17 +0000 (GMT) Received: from eusmges5.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170222160517eucas1p2d9294d2c8bd58f6af9dfaf56dfc85cff~lp5af0EcZ1588515885eucas1p2C; Wed, 22 Feb 2017 16:05:17 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges5.samsung.com (EUCPMTA) with SMTP id 24.F0.17477.CB6BDA85; Wed, 22 Feb 2017 16:05:17 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170222160516eucas1p298a994725044878022fece1600f9e36a~lp5ZkcHzJ1598415984eucas1p29; Wed, 22 Feb 2017 16:05:16 +0000 (GMT) X-AuditID: cbfec7f5-f79d06d000004445-bd-58adb6bc2e76 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 0E.77.06687.117BDA85; Wed, 22 Feb 2017 16:06:41 +0000 (GMT) Received: from AMDC2768.DIGITAL.local ([106.120.43.17]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OLS00IUKA0QUK20@eusync3.samsung.com>; Wed, 22 Feb 2017 16:05:16 +0000 (GMT) From: Andrzej Hajda To: Inki Dae Cc: Andrzej Hajda , Bartlomiej Zolnierkiewicz , Marek Szyprowski , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, Krzysztof Kozlowski , Javier Martinez Canillas Subject: [PATCH 2/4] drm/exynos: simplify completion event handling Date: Wed, 22 Feb 2017 17:05:03 +0100 Message-id: <1487779505-4062-3-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 2.7.4 In-reply-to: <1487779505-4062-1-git-send-email-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrDIsWRmVeSWpSXmKPExsWy7djPc7p7t62NMFhWbnFr3TlWi40z1rNa XPn6ns1i0v0JLBZv3q5hsjh/fgO7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YSN3ovMEPYYhIX7q1n62Lk 4hASWMIo8f/BcxYIp5FJouvOCSaQKjYBTYm/m2+ygdgiAsoSq/a1s4MUMQtsYJK423eSFSQh LOAsMbV1EWMXIwcHi4CqxIV2sG28Ak4Sk648ZILYJidx81wnM0gJJ1D5oouWIGEhoJLXs5ay T2DkXcDIsIpRJLW0ODc9t9hQrzgxt7g0L10vOT93EyMwqLcd+7l5B+OljcGHGAU4GJV4eA8s WhshxJpYVlyZe4hRgoNZSYT3/2KgEG9KYmVValF+fFFpTmrxIUZToJMmMkuJJucDIy6vJN7Q xNDc0tDI2MLC3MhISZy35MOVcCGB9MSS1OzU1ILUIpg+Jg5OqQZGPvea3JYkLff7YfuzRLbx +vJoePw9+TL6xskcNovuR6Fhce5/1oVs+NJe+t/oyaXdx403Hl864Yr+TwO+fdUHv+cd//5j 6YuSjsbFhX6xb7sjPtonvWD33xarbqVj+m/ezOcKawTcfBM+WE6NmNhzol6a4cDHsI5p586e ZzG++ersvULf9zfFlViKMxINtZiLihMB9zOqBIACAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170222160516eucas1p298a994725044878022fece1600f9e36a X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?UTF-8?B?QW5kcnplaiBIYWpkYRtTUlBPTC1LZXJuZWwgKFRQKRvsgrw=?= =?UTF-8?B?7ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?QW5kcnplaiBIYWpkYRtTUlBPTC1LZXJuZWwgKFRQKRtTYW1z?= =?UTF-8?B?dW5nIEVsZWN0cm9uaWNzG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjczOTI=?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170222160516eucas1p298a994725044878022fece1600f9e36a X-RootMTR: 20170222160516eucas1p298a994725044878022fece1600f9e36a References: <1487779505-4062-1-git-send-email-a.hajda@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP All Exynos CRTC drivers shouldn't fail at referencing vblank events, alternate path is actually dead code. Signed-off-by: Andrzej Hajda --- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index c65f450..5b7cd77 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c @@ -105,16 +105,15 @@ void exynos_crtc_handle_event(struct exynos_drm_crtc *exynos_crtc) struct drm_pending_vblank_event *event = crtc->state->event; unsigned long flags; - if (event) { - crtc->state->event = NULL; - spin_lock_irqsave(&crtc->dev->event_lock, flags); - if (drm_crtc_vblank_get(crtc) == 0) - drm_crtc_arm_vblank_event(crtc, event); - else - drm_crtc_send_vblank_event(crtc, event); - spin_unlock_irqrestore(&crtc->dev->event_lock, flags); - } + if (!event) + return; + crtc->state->event = NULL; + + WARN_ON(drm_crtc_vblank_get(crtc) != 0); + spin_lock_irqsave(&crtc->dev->event_lock, flags); + drm_crtc_arm_vblank_event(crtc, event); + spin_unlock_irqrestore(&crtc->dev->event_lock, flags); } static void exynos_drm_crtc_destroy(struct drm_crtc *crtc)