From patchwork Mon Mar 18 04:09:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 10856863 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1E2DD14DE for ; Mon, 18 Mar 2019 04:09:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF5A328A45 for ; Mon, 18 Mar 2019 04:09:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DEC42291E3; Mon, 18 Mar 2019 04:09:36 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 73D2F28A45 for ; Mon, 18 Mar 2019 04:09:36 +0000 (UTC) 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:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=JHlDTjbMH8fkar05R0RysrkQOLctrIQqbCTSay8qFKM=; b=NmWxIt0VMQOxnv Ds1hxmN72g2vVbXkxKAKdhONSh7rMIxrm5qASyNGGfetRkHe3lF8ZE5KQDCUj4f+PnqrE+aYgEkyG Ply5bwEQFlvinYxVsFKOXF5XPlNMHXHpL5Ykh2Pq5wj78NFlgf1/LDZnYgoo0gx4HFfJ66Bg2gMkn BxorMuUoHAyK3WZ2KpTYnPNRiI0e+IOs2rzjnzdgItYvKvo3eFX3Z6rwbCqvyWp94tCUdOKbABdU/ U2hw+uKqW81kMDxjdY/0h88IOWLQ2Q4x4iGhFEW/yhTjMJZZyY6yvlsVADaFP6mgIsvVZvkFQ8mOt j70GviaUkBLvhLCzXemg==; 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 1h5jaf-0005de-TA; Mon, 18 Mar 2019 04:09:33 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h5jaZ-0005bN-QG for linux-arm-kernel@lists.infradead.org; Mon, 18 Mar 2019 04:09:31 +0000 Received: by mail-pg1-x543.google.com with SMTP id b2so10437575pgl.9 for ; Sun, 17 Mar 2019 21:09:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=i5EKXBALYEwdk9E9LRVZlQ6e7qbUkPvzI+TKapn/pPc=; b=Vv2+JK0g+Q3XAT84IcZLW9ZhWuuBF7Ger9uIs5AEOIUsO6v0XTJPss7XXf+1HMuJzB Ny/PFZ2ubwiSyCl06zztNTJEbRwBlBt59wir15qLkoXTQDZmkDJseV8rY+a9+dh5hIM1 lDqIip/t31OoVJNjIrBYVefSCa73QXBBCxYQU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=i5EKXBALYEwdk9E9LRVZlQ6e7qbUkPvzI+TKapn/pPc=; b=nOF9RKQlMO28cJOWoU/hMX4h/ObwtCOTTETfPfYeNokUBvVrUcOyrg9FA3KAmSK3yA IQn+iBqMgydKfwzpZXcS7H5th8+wZLKA+nyfanwyrYGZSzwNg9P9+frmLlumcGHcj/p+ 7yZRMF91+Qh+fkBpC74bDSO8OnOjzkmolh0F+Q5DCZGhddNbF6UgURRTwQt3JjDM0eah 7ceIgvO1NNWwHsP841Mg/4NN7tPNA5PnLn4QnlmY/QRhm9HJ1F3FqWzR/F323htAD+ui JiUn18DIVfbl7Wd8h9AF0DmYxOMuRicqmLekoYcUPp3eTUFiHCGbYCWP0mGdYmixA0hx /AAQ== X-Gm-Message-State: APjAAAUYuOzqXq3pnUdOCrp5YRCj+QS/yfA+5epN0Gpo0yq81EPx8Sa3 m7Ad8MwYG5DTBVvRL56cPDn6K9IIShE= X-Google-Smtp-Source: APXvYqzDJRpIyEqsZICxFfV0bdzLRJ6o67alJ+dyAvsWtaokWT6OL1N3yfo3KGLp5baYHDZFa7FbJQ== X-Received: by 2002:aa7:8186:: with SMTP id g6mr17209005pfi.138.1552882166442; Sun, 17 Mar 2019 21:09:26 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:b852:bd51:9305:4261]) by smtp.gmail.com with ESMTPSA id k16sm5859126pfa.17.2019.03.17.21.09.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 17 Mar 2019 21:09:25 -0700 (PDT) From: Hsin-Yi Wang To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] gpu/drm: mediatek: call mtk_dsi_stop() after mtk_drm_crtc_atomic_disable() Date: Mon, 18 Mar 2019 12:09:15 +0800 Message-Id: <20190318040915.101218-1-hsinyi@chromium.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190317_210927_873700_8CA08BE9 X-CRM114-Status: GOOD ( 12.12 ) 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, Matthias Brugger , linux-mediatek@lists.infradead.org, Daniel Vetter , CK Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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(); Change to make mtk_dsi_stop() called in mtk_dsi_ddp_stop() instead of mtk_output_dsi_disable(). 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;