From patchwork Wed Oct 8 13:21:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 5053641 Return-Path: X-Original-To: patchwork-intel-gfx@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 AF76AC11AB for ; Wed, 8 Oct 2014 13:21:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4738E2015A for ; Wed, 8 Oct 2014 13:21:58 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D1C63201FA for ; Wed, 8 Oct 2014 13:21:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E29C26E1C7; Wed, 8 Oct 2014 06:21:54 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wg0-f51.google.com (mail-wg0-f51.google.com [74.125.82.51]) by gabe.freedesktop.org (Postfix) with ESMTP id 1AD4489C80; Wed, 8 Oct 2014 06:21:52 -0700 (PDT) Received: by mail-wg0-f51.google.com with SMTP id b13so11598235wgh.22 for ; Wed, 08 Oct 2014 06:21:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=Pmd8rsswCvX4zHB0MH6tMM85PxPMwEaEGsdzvz0iVyk=; b=SJaFMFq63LihSNKCoCndAayuyjpCACOuHaCgmwJMx6pPldxo5DWPcLlsxhUeGnA2V8 EiQ/cbmNE0wbzLdrJtqbynfbxfcRsJ8URd2u44vlptz0S+HcpE8LOFwnh1Hkj4RW/Nj8 J2YWLXElJlLAfAJ6fTi029K6/zcLLHlaqvEKOLT42cwJhNnT7I39PM8dN9kk18Z9QVPu nKVArRl+ZkRN6bJe78qDHBuTjv+japvMEwj2O03KSycPnwbKwLRBDUt2u7pgiVnn8PCq EmaChCn2wzXnMftyieJ/Ul3P1lNB34B7J/EQcJaFaM212Z5CzSAMYRX8hEkoBM4F5HpK x8/g== X-Received: by 10.180.75.4 with SMTP id y4mr13430744wiv.47.1412774512088; Wed, 08 Oct 2014 06:21:52 -0700 (PDT) Received: from localhost (port-30500.pppoe.wtnet.de. [46.59.169.246]) by mx.google.com with ESMTPSA id n5sm18553980wix.0.2014.10.08.06.21.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Oct 2014 06:21:51 -0700 (PDT) Date: Wed, 8 Oct 2014 15:21:50 +0200 From: Thierry Reding To: Daniel Vetter , Ville =?utf-8?B?U3lyasOkbMOk?= Message-ID: <20141008132148.GA32477@ulmo> References: <20140912074859.GA30934@phenom.ffwll.local> MIME-Version: 1.0 In-Reply-To: <20140912074859.GA30934@phenom.ffwll.local> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: Joonyoung Shim , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Inki Dae , Andrzej Hajda , Benjamin Gaignard , Russell King Subject: Re: [Intel-gfx] [PULL] topic/vblank-rework, take 2 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_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 On Fri, Sep 12, 2014 at 09:48:59AM +0200, Daniel Vetter wrote: [...] > Ville Syrjälä (16): > drm: Always reject drm_vblank_get() after drm_vblank_off() This particular commit seems to be wreaking havoc. Inki already reported this at some point and Andrzej and Joonyoung tried to fix this on Exynos already, but it seems like a couple more drivers would suffer from this. At least those using drm_vblank_off() but not drm_vblank_on() would see the same issue. A quick grep indicate that Armada, Exynos, GMA500 and STI would all suffer from the same problem. Adding the respective maintainers. I've used the attached patch to fix the issue on Tegra. Ville, does that conversion look right? Perhaps it would be safer to call drm_crtc_vblank_on() before activating the CRTC to avoid a potential race? It seems like drm_vblank_on() and drm_vblank_off() would replace drm_vblank_{pre,post}_modeset() completely, so I've removed them as part of the patch as well. I suppose the attached patch and equivalent ones for the other drivers would need to be carried in this series to avoid regressions. Thierry From 1b7539953054f8f4b102570c21ddee36a65f4a06 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Wed, 8 Oct 2014 14:48:51 +0200 Subject: [PATCH] drm/tegra: dc: Add missing call to drm_vblank_on() When the CRTC is enabled, make sure the VBLANK machinery is enabled. Failure to do so will cause drm_vblank_get() to not enable the VBLANK on the CRTC and VBLANK-synchronized page-flips won't work. While at it, get rid of the legacy drm_vblank_pre_modeset() and drm_vblank_post_modeset() calls that are replaced by drm_vblank_on() and drm_vblank_off(). Reported-by: Alexandre Courbot Signed-off-by: Thierry Reding --- drivers/gpu/drm/tegra/dc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index 2bc344b1fcd5..2aeaa4960d21 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -741,7 +741,6 @@ static const struct drm_crtc_funcs tegra_crtc_funcs = { static void tegra_crtc_disable(struct drm_crtc *crtc) { - struct tegra_dc *dc = to_tegra_dc(crtc); struct drm_device *drm = crtc->dev; struct drm_plane *plane; @@ -757,7 +756,7 @@ static void tegra_crtc_disable(struct drm_crtc *crtc) } } - drm_vblank_off(drm, dc->pipe); + drm_crtc_vblank_off(crtc); } static bool tegra_crtc_mode_fixup(struct drm_crtc *crtc, @@ -846,8 +845,6 @@ static int tegra_crtc_mode_set(struct drm_crtc *crtc, u32 value; int err; - drm_vblank_pre_modeset(crtc->dev, dc->pipe); - err = tegra_crtc_setup_clk(crtc, mode); if (err) { dev_err(dc->dev, "failed to setup clock for CRTC: %d\n", err); @@ -948,7 +945,7 @@ static void tegra_crtc_commit(struct drm_crtc *crtc) value = GENERAL_ACT_REQ | WIN_A_ACT_REQ; tegra_dc_writel(dc, value, DC_CMD_STATE_CONTROL); - drm_vblank_post_modeset(crtc->dev, dc->pipe); + drm_crtc_vblank_on(crtc); } static void tegra_crtc_load_lut(struct drm_crtc *crtc) -- 2.1.0