From patchwork Thu Oct 2 08:58:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joonyoung Shim X-Patchwork-Id: 5017281 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B1B199F348 for ; Thu, 2 Oct 2014 08:59:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CB0B920274 for ; Thu, 2 Oct 2014 08:59:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AF96C2026F for ; Thu, 2 Oct 2014 08:59:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751481AbaJBI6u (ORCPT ); Thu, 2 Oct 2014 04:58:50 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:12925 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751319AbaJBI6r (ORCPT ); Thu, 2 Oct 2014 04:58:47 -0400 Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NCT00EZ17LWN260@mailout2.samsung.com>; Thu, 02 Oct 2014 17:58:44 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.113]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id DF.2A.18167.4C31D245; Thu, 02 Oct 2014 17:58:44 +0900 (KST) X-AuditID: cbfee690-f79ab6d0000046f7-bf-542d13c401d2 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id F5.B8.09430.4C31D245; Thu, 02 Oct 2014 17:58:44 +0900 (KST) Received: from [10.88.100.151] by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NCT00DEJ7LW1M10@mmp2.samsung.com>; Thu, 02 Oct 2014 17:58:44 +0900 (KST) Message-id: <542D13CC.5000304@samsung.com> Date: Thu, 02 Oct 2014 17:58:52 +0900 From: Joonyoung Shim User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-version: 1.0 To: Andrzej Hajda , Inki Dae Cc: Seung-Woo Kim , Kyungmin Park , David Airlie , Kukjin Kim , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/exynos: fix vblank handling during dpms off References: <542B9A0E.7020206@samsung.com> <1412151287-12845-1-git-send-email-a.hajda@samsung.com> In-reply-to: <1412151287-12845-1-git-send-email-a.hajda@samsung.com> Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKIsWRmVeSWpSXmKPExsWyRsSkUPeIsG6IwecP2ha31p1jteg9d5LJ 4srX92wWk+5PYLHoXXCVzeJs0xt2i8u75rBZzDi/j8lixuSXbA6cHtu/PWD1uN99nMmjb8sq Ro/Pm+QCWKK4bFJSczLLUov07RK4MnZt+8BSsFam4tca5QbGJ+JdjJwcEgImErc3XWWBsMUk LtxbzwZiCwksZZR49cwMpubfl0WsXYxcQPHpjBKH555lgnBeM0q8Pv6BEaSKV0BLYlvDObBJ LAKqEt/fdYFNYhPQk7iz7ThQAweHqECYxN/b3BDlghI/Jt8DKxcR8JCY/2YPM8hMZoEmJomr zx4wgySEBVwkrk74zARxUYrEk99vwWxOoPifkx/BZjIDzb9/UQskzCwgL7F5zVuwORIC19gl rn5uY4O4R0Di2+RDLCD1EgKyEpsOMEM8JilxcMUNlgmMYrOQnDQL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g63WgUIC6YklqdmpqQWpRTB9TBycUg2MktHL 3fKOxeq7Chc62Uk/OKC9WnBz8wLBBwEKG5Vl+iqKU4KUK4y4g0oMdmWIOr2bu+d2o9k5FpNG btcmGb5T82ue5pW4+C4Vamta/3uTrtv69z5/Vc/cqX9d/Ey6OLuXd7u2RMlj5SN753V0/biz 0lb/XfzKqdN4vteoMBd8zth2PH/RbDslluKMREMt5qLiRAAqnMXkAwMAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 Hi Andrzej, On 10/01/2014 05:14 PM, Andrzej Hajda wrote: > The patch disables vblanks during dpms off only if pagefilp has > not been finished. It also replaces drm_vblank_off with drm_crtc_vblank_put. > It fixes issue with page_flip ioctl not being able to acquire vblank counter. This problem isn't related with pageflip, it just causes from 7ffd7a68511c710b84db3548a1997fd2625f580a commit (drm: Always reject drm_vblank_get() after drm_vblank_off()). We need to use drm_vblank_on() as a counterpart to drm_vblank_off() after the commit . How about below patch? From 6de01473746af225c688ee430123001d57d9af2a Mon Sep 17 00:00:00 2001 From: Joonyoung Shim Date: Thu, 2 Oct 2014 17:48:27 +0900 Subject: [PATCH] drm/exynos: use drm_vblank_on() We need to use drm_vblank_on() as a counterpart to drm_vblank_off() after the commit 7ffd7a68511c ("drm: Always reject drm_vblank_get() after drm_vblank_off()"). If not, drm_vblank_get() will be failed always after drm_vblank_off(). Signed-off-by: Joonyoung Shim --- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index 8e38e9f..dfa209a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c @@ -71,7 +71,6 @@ static void exynos_drm_crtc_dpms(struct drm_crtc *crtc, int mode) !atomic_read(&exynos_crtc->pending_flip), HZ/20)) atomic_set(&exynos_crtc->pending_flip, 0); - drm_vblank_off(crtc->dev, exynos_crtc->pipe); } if (manager->ops->dpms) @@ -90,6 +89,7 @@ static void exynos_drm_crtc_commit(struct drm_crtc *crtc) struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); struct exynos_drm_manager *manager = exynos_crtc->manager; + drm_vblank_on(crtc->dev, exynos_crtc->pipe); exynos_drm_crtc_dpms(crtc, DRM_MODE_DPMS_ON); exynos_plane_commit(crtc->primary); @@ -177,10 +177,12 @@ static int exynos_drm_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, static void exynos_drm_crtc_disable(struct drm_crtc *crtc) { + struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); struct drm_plane *plane; int ret; exynos_drm_crtc_dpms(crtc, DRM_MODE_DPMS_OFF); + drm_vblank_off(crtc->dev, exynos_crtc->pipe); drm_for_each_legacy_plane(plane, &crtc->dev->mode_config.plane_list) { if (plane->crtc != crtc)