From patchwork Tue Oct 24 13:00:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?U2hhd24gU3VuZyAo5a6L5a2d6KyZKQ==?= X-Patchwork-Id: 157431 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1923138vqx; Tue, 24 Oct 2023 06:03:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGCNBpcrR/x44vMfVtBPIlaDiY58k8NYv08F/1HnZAKa1eucWx86EuoR+HZoMD9w3EFV5W2 X-Received: by 2002:a05:6a21:338c:b0:15d:53ad:22fe with SMTP id yy12-20020a056a21338c00b0015d53ad22femr3218783pzb.3.1698152584615; Tue, 24 Oct 2023 06:03:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698152584; cv=none; d=google.com; s=arc-20160816; b=snCoN/hy3dN3XFCPw4rH1PAsRzL+RyQTXMhxwdUNwvH1fO6ZZhBigv0QGb1js6BOX7 shh8j0XzNqIaGpsamENneXURriWSQNHhMG0QWAnyjLjXwOodp8jdUh5PVtXbGoabIStS GhR/6feKbQr0ayWwBG4sU92/W67LPSxXp5JQUauixICJ5pKJa/RohEKlJKSxBjtUUzx+ xFPbWu6pYjJeWGBC8NWADVI2ASopdWQEh8j1AR56VUweHlHPDUh/gmGvbhl2SVwtP8v9 9EigElSrBsI2NGwAD1nOlTMiRu2U73J01L3ylIqQr7UcB40Mwb4rn7SKHOrlnK18E9tf IPrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=qQCik8KGy7uP0HMhVPEmAaiZ7pU4ORlIvGE0VGAdLew=; fh=fv4tbCKTXdNtjEvV4h1+g1nnsRjdLHbhnCNyWnoFRfI=; b=KZ64G1JCy0w8aDhWNBG5k2ryjpvV1X2M4lCi6RnUlEhRnXhnU9dbRntTIxROe9SaF0 eVFYfBWhu7wVoZLo+pxNVT5709bRmPYw9n0rJOuGLtqECSAtwRcVJ3b8ZzMg+1TCoN1i M0bLtlcGf7e85wZX01neyag80pFHFAkDoOn11ThYzrbZlKRZvFr/ItTnXepRxd6sMlsP V+AlAIf/RhZ8gv1ee0fZbgUKbJPAciUo4+EuHem6E+MROZA7tAg1MXUJ4sgxjq8/KuCR NIjKGcWLtLUUdUkyX31dCvrAunLV+zdGmpLR7LZ55aOIoI6sAmZGMdtPU3qUbvaVXty0 6HhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=VLsZJNu7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id w8-20020a63f508000000b005b64e8336casi8736956pgh.464.2023.10.24.06.03.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 06:03:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=VLsZJNu7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id D526D8029858; Tue, 24 Oct 2023 06:03:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234601AbjJXNCn (ORCPT + 26 others); Tue, 24 Oct 2023 09:02:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234559AbjJXNBK (ORCPT ); Tue, 24 Oct 2023 09:01:10 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 545C3D7B; Tue, 24 Oct 2023 06:01:06 -0700 (PDT) X-UUID: 5f941bd0726d11ee8051498923ad61e6-20231024 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=qQCik8KGy7uP0HMhVPEmAaiZ7pU4ORlIvGE0VGAdLew=; b=VLsZJNu7elUyA/AOhKdom3CehaXvFPwChR9OkKe5aAMW8CAgF62Mi/og1W8I1lzaqfH4xKxvtWdNuvf0KIp6kvhYZJtA69qhTvBavxDWePM1J/bDh41utPfEBHMzUE0FFzrz97p4NUTQW5yszxekfgI7Hg6hxCjQuT6pRq6rBPg=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.32,REQID:1cca9461-03bf-4eff-a42e-9c1c7d93f903,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:5f78ec9,CLOUDID:2ddab6fb-4a48-46e2-b946-12f04f20af8c,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR: NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_ULN X-UUID: 5f941bd0726d11ee8051498923ad61e6-20231024 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 2114022422; Tue, 24 Oct 2023 21:00:57 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs11n2.mediatek.inc (172.21.101.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Tue, 24 Oct 2023 21:00:56 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Tue, 24 Oct 2023 21:00:56 +0800 From: Hsiao Chien Sung To: AngeloGioacchino Del Regno , CK Hu , Krzysztof Kozlowski , Matthias Brugger , Rob Herring CC: Chun-Kuang Hu , Philipp Zabel , David Airlie , Daniel Vetter , Fei Shao , Sean Paul , Johnson Wang , "Nancy . Lin" , Moudy Ho , Hsiao Chien Sung , "Jason-JH . Lin" , Nathan Lu , , , , , Subject: [PATCH v11 22/23] drm/mediatek: Fix underrun in VDO1 when switches off the layer Date: Tue, 24 Oct 2023 21:00:47 +0800 Message-ID: <20231024130048.14749-23-shawn.sung@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20231024130048.14749-1-shawn.sung@mediatek.com> References: <20231024130048.14749-1-shawn.sung@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 24 Oct 2023 06:03:00 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780642044629286150 X-GMAIL-MSGID: 1780642044629286150 Do not reset Merge while using CMDQ because reset API doesn't wait for frame done event as CMDQ does and could lead to underrun when the layer is switching off. Fixes: aaf94f7c3ae6 ("drm/mediatek: Add display merge async reset control") Reviewed-by: CK Hu Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Hsiao Chien Sung --- drivers/gpu/drm/mediatek/mtk_disp_merge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.18.0 diff --git a/drivers/gpu/drm/mediatek/mtk_disp_merge.c b/drivers/gpu/drm/mediatek/mtk_disp_merge.c index fd14a59bc951..c19fb1836034 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_merge.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_merge.c @@ -104,7 +104,7 @@ void mtk_merge_stop_cmdq(struct device *dev, struct cmdq_pkt *cmdq_pkt) mtk_ddp_write(cmdq_pkt, 0, &priv->cmdq_reg, priv->regs, DISP_REG_MERGE_CTRL); - if (priv->async_clk) + if (!cmdq_pkt && priv->async_clk) reset_control_reset(priv->reset_ctl); }