From patchwork Thu Dec 14 05:58:46 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: 178481 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp8343205dys; Wed, 13 Dec 2023 22:02:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IGk9ImYlYMxPOeoy0x3Ev2Bqct339WecAGS268RDLhW4zA+U9/JsN4cNG965XruQMgXYIPy X-Received: by 2002:a05:6a21:1f03:b0:18f:97c:8a51 with SMTP id ry3-20020a056a211f0300b0018f097c8a51mr10866139pzb.124.1702533719938; Wed, 13 Dec 2023 22:01:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702533719; cv=none; d=google.com; s=arc-20160816; b=qI/8BJa+rRkdgCFDI1hSVt1YNpenHWnAc6l5NJDR+M7S0UoFQ0nAflPFcLG3rJ0P90 NvjE0nM3HMQGlO/4d2W9s0Lc237Zyfc1UIOcSsIawywkvkUXbMXWz+7vB5alB7jNEcbu ecMldjS4Btd9dJWyNFs+JMcZAxttYMJZbm2zLIro/WC9Wi0wJLeGGdzim+J0dqbP5P5u B8MHbophVnevMjpYNUqv1YoES1jSrBj8r/KTGjTPe3jvUEeBTnqroaBzSBQt8pkvaDRA skkgUCKWW7HaSdfZXhrQGbcP1HsgH476SN9VLCDpj4iKr8Ee0h4PvD1t3FXjQFcrTfDv Jshw== 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=qfrhPgjKMPJROymzBvB0YwzDzPDiGcgM9P/DdSw2bKg=; fh=3sxgsd2Uw0IiS0u77AMxpPqPOsrCjkgXK0HsUFuBxjc=; b=M/Ni1CqPKfYlAOXxgy08QQKvnMLC8S3f+SzYslFnl5dsiQ7+kSd7yXtqe7Zf02C9tl IxxfuD7ZO+VCB/8t4C6J3Z8I6AeSXoCyY57dDQO7Und4z2DV04Y8pzlb5NEkf5VJO0FC CXFJdJnBNA46ogZaUSK4g7+iDr8c7ixGSdwT+45yk78FmaR7iRHDcF75oolZrM/H06SY 9extJXOY+v7pggI+h8BGl8aM2duVWP/bvLZPUpHaDScd3LsLMJNPINdX0dfgrK22B75G KgkvT6wkTM5UmnPdmcEjvTMzpXkkjAH3Mvkv3VpnzUyXGRtFjcJgKWwQPfxLO5RjDomj 0B4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="oXpOj/JG"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id bj7-20020a056a02018700b005b8f1c4aa49si11145013pgb.895.2023.12.13.22.01.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 22:01:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="oXpOj/JG"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 27F9A82D755C; Wed, 13 Dec 2023 22:01:51 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235370AbjLNGBX (ORCPT + 99 others); Thu, 14 Dec 2023 01:01:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235413AbjLNF7t (ORCPT ); Thu, 14 Dec 2023 00:59:49 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8955910C; Wed, 13 Dec 2023 21:59:08 -0800 (PST) X-UUID: dc3453da9a4511eeba30773df0976c77-20231214 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=qfrhPgjKMPJROymzBvB0YwzDzPDiGcgM9P/DdSw2bKg=; b=oXpOj/JG1v9JYHP9KiDmN7+sAgb0O2HP3CZOZaVwJvJav8P7UOlNmMw8vxltf1xZiF7UdCDCjFD/2h3r3B3NCy8BKR5GPqWX8sb/pNarxQQ0HgMos60MPyPCCotzUC+ZAex+Ynvu13wvb/S8bpUSPnL/yc+01znfI+65nsNEo8E=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.35,REQID:1a3365cc-3241-41cc-bee8-ed79d1c78cd7,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:5d391d7,CLOUDID:903c29bd-2ac7-4da2-9f94-677a477649d9,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: dc3453da9a4511eeba30773df0976c77-20231214 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 792396031; Thu, 14 Dec 2023 13:58:53 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.108) by mtkmbs13n2.mediatek.inc (172.21.101.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Thu, 14 Dec 2023 13:58:52 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Thu, 14 Dec 2023 13:58:52 +0800 From: Hsiao Chien Sung To: AngeloGioacchino Del Regno , CK Hu CC: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chun-Kuang Hu , Philipp Zabel , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Matthias Brugger , Moudy Ho , Hsiao Chien Sung , Nathan Lu , "Nancy . Lin" , "Roy-CW . Yeh" , "Jason-JH . Lin" , xinlei lee , , , , , Subject: [PATCH v12 22/23] drm/mediatek: Fix underrun in VDO1 when switches off the layer Date: Thu, 14 Dec 2023 13:58:46 +0800 Message-ID: <20231214055847.4936-23-shawn.sung@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20231214055847.4936-1-shawn.sung@mediatek.com> References: <20231214055847.4936-1-shawn.sung@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.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 (howler.vger.email [0.0.0.0]); Wed, 13 Dec 2023 22:01:51 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785235997673079165 X-GMAIL-MSGID: 1785235997673079165 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(-) diff --git a/drivers/gpu/drm/mediatek/mtk_disp_merge.c b/drivers/gpu/drm/mediatek/mtk_disp_merge.c index e525a6b9e5b0..22f768d923d5 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_merge.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_merge.c @@ -103,7 +103,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); }