From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3093C43381 for ; Wed, 20 Mar 2019 06:48:32 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 90AC921850 for ; Wed, 20 Mar 2019 06:48:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="uVwkmHLX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 90AC921850 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Date:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Z5q+OpaQuqGUnb6//tfI/raRdUmqVHM6JmbG3jFBflc=; b=uVwkmHLXqG13AP 1kZ0WJq2CahGoQczEIC891BsVqw8gk9C7UfJjT1Zeg6vv20mdX1R8nhrGaO/i/gzfrvRm5SrO3/s0 85Dco/+xMvgs+WNGTJRtWPHU3N06I7HdqMAH34qKu0FfEchHjC0R5JguHFVGzy7/ZrzEMJbGapSpB uc5F4t0N+Fl1/6m+01YkcM5F0TeMVkknRlDqoBZOoLcNFvVsaMm9cbmsyFZas9mGZOBhva2IBQf/n 0GIVnS0fl4Xaefx3m+MeGRf2C+gSLzuX3b0icq7gZupTbBODQJSWar9b608gWs5wPo+l08lqkaUtC 4hN3Ex/jFvC9lO1vUbxA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6V1X-0005Nw-Kh; Wed, 20 Mar 2019 06:48:27 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6V1T-0005N5-H4; Wed, 20 Mar 2019 06:48:25 +0000 X-UUID: 057140b099dd492188b858eb32d45663-20190319 X-UUID: 057140b099dd492188b858eb32d45663-20190319 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 1408434697; Tue, 19 Mar 2019 22:48:01 -0800 Received: from mtkmbs05n1.mediatek.inc (172.21.101.15) by MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 19 Mar 2019 23:47:59 -0700 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs05n1.mediatek.inc (172.21.101.15) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 20 Mar 2019 14:47:57 +0800 Received: from [172.21.77.4] (172.21.77.4) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 20 Mar 2019 14:47:57 +0800 Message-ID: <1553064478.28297.3.camel@mtksdaap41> Subject: Re: [PATCH] gpu/drm: mediatek: call mtk_dsi_stop() after mtk_drm_crtc_atomic_disable() From: CK Hu To: Hsin-Yi Wang Date: Wed, 20 Mar 2019 14:47:58 +0800 In-Reply-To: References: <20190318040915.101218-1-hsinyi@chromium.org> <1553051356.20221.23.camel@mtksdaap41> X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190319_234823_568813_A88EBDC2 X-CRM114-Status: GOOD ( 26.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Philipp Zabel , David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, Daniel Vetter , Matthias Brugger , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, Hsin-yi: On Wed, 2019-03-20 at 13:39 +0800, Hsin-Yi Wang wrote: > On Wed, Mar 20, 2019 at 11:09 AM CK Hu wrote: > > > > Hi, Hsin-yi: > > > > On Mon, 2019-03-18 at 12:09 +0800, Hsin-Yi Wang wrote: > > > mtk_dsi_stop() should be called after mtk_drm_crtc_atomic_disable(), which needs > > > ovl irq for drm_crtc_wait_one_vblank(), since after mtk_dsi_stop() is called, > > > ovl irq will be disabled. If drm_crtc_wait_one_vblank() is called after last > > > irq, it will timeout with this message: "vblank wait timed out on crtc 0". This > > > happens sometimes when turning off the screen. > > > > > > In drm_atomic_helper.c#disable_outputs(), > > > the calling sequence when turning off the screen is: > > > > > > 1. mtk_dsi_encoder_disable() > > > --> mtk_output_dsi_disable() > > > --> mtk_dsi_stop(); // sometimes make vblank timeout in atomic_disable > > > --> mtk_dsi_poweroff(); > > > 2. mtk_drm_crtc_atomic_disable() > > > --> drm_crtc_wait_one_vblank(); > > > ... > > > --> mtk_dsi_ddp_stop() > > > --> mtk_dsi_poweroff(); > > > > > > > Thanks for your inference, but I wonder this patch meet all > > consideration. In MT8173 with a bridge chip, the timing to disable dsi > > signal output would influence bridge chip output garbage or not. It's > > better that you could test this on MT8173, or let this patch go for > > weeks and wait for someone to test. If no one care about MT8173, I could > > accept this patch. > We care about MT8173, but it's not easy to test since we have to bring > the whole kernel to >= 4.19 to be able to test latest dsi driver. > The patch (0707632b5bac) that added mtk_dsi_stop() was after MT8173 > (on 3.18), for panel without bridge, so I think without mtk_dsi_stop() > was also working fine for MT8173. OK, I find that in the first version of this driver, there is no mtk_dsi_stop() before mtk_dsi_poweroff(), so I think MT8173 does not do mtk_dsi_stop(). So maybe this works fine for MT8173. Regards, CK > > > > > > Change to make mtk_dsi_stop() called in mtk_dsi_ddp_stop() instead of > > > mtk_output_dsi_disable(). > > > > mtk_dsi_poweroff() has reference count, why not just move mtk_dsi_stop() > > into mtk_dsi_poweroff()? > Yes, we can also call mtk_dsi_stop() in mtk_dsi_poweroff() when > refcount is 0. I can send v2 if you think this way is better. > > Thanks > > > > Regards, > > CK > > > > > > > > Fixes: 0707632b5bac ("drm/mediatek: update DSI sub driver flow for sending commands to panel") > > > Signed-off-by: Hsin-Yi Wang > > > --- > > > drivers/gpu/drm/mediatek/mtk_dsi.c | 4 +++- > > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > > > diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c > > > index b00eb2d2e086..cdd9637dd517 100644 > > > --- a/drivers/gpu/drm/mediatek/mtk_dsi.c > > > +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c > > > @@ -696,7 +696,6 @@ static void mtk_output_dsi_disable(struct mtk_dsi *dsi) > > > } > > > } > > > > > > - mtk_dsi_stop(dsi); > > > mtk_dsi_poweroff(dsi); > > > > > > dsi->enabled = false; > > > @@ -857,6 +856,7 @@ static void mtk_dsi_ddp_stop(struct mtk_ddp_comp *comp) > > > { > > > struct mtk_dsi *dsi = container_of(comp, struct mtk_dsi, ddp_comp); > > > > > > + mtk_dsi_stop(dsi); > > > mtk_dsi_poweroff(dsi); > > > } > > > > > > @@ -1178,6 +1178,8 @@ static int mtk_dsi_remove(struct platform_device *pdev) > > > struct mtk_dsi *dsi = platform_get_drvdata(pdev); > > > > > > mtk_output_dsi_disable(dsi); > > > + mtk_dsi_stop(dsi); > > > + mtk_dsi_poweroff(dsi); > > > component_del(&pdev->dev, &mtk_dsi_component_ops); > > > > > > return 0; > > > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel