From patchwork Wed Sep 29 07:02:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SmFzb24tSkggTGluICjmnpfnnb/npaUp?= X-Patchwork-Id: 12524715 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9AE22C433EF for ; Wed, 29 Sep 2021 07:02:51 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 6525F60F6E for ; Wed, 29 Sep 2021 07:02:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6525F60F6E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 92B2F6E194; Wed, 29 Sep 2021 07:02:47 +0000 (UTC) Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by gabe.freedesktop.org (Postfix) with ESMTPS id 070FB6E18F for ; Wed, 29 Sep 2021 07:02:42 +0000 (UTC) X-UUID: 3d92c1e65cee4e10a9e245d5b4750398-20210929 X-UUID: 3d92c1e65cee4e10a9e245d5b4750398-20210929 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 965992882; Wed, 29 Sep 2021 15:02:38 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.3; Wed, 29 Sep 2021 15:02:37 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 29 Sep 2021 15:02:36 +0800 From: jason-jh.lin To: Chun-Kuang Hu , Philipp Zabel CC: David Airlie , Daniel Vetter , "Matthias Brugger" , Yongqiang Niu , , , , , , , , , Subject: [PATCH 3/3] drm/mediatek: Fix cursor plane is not config when primary is updating Date: Wed, 29 Sep 2021 15:02:35 +0800 Message-ID: <20210929070235.4290-4-jason-jh.lin@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210929070235.4290-1-jason-jh.lin@mediatek.com> References: <20210929070235.4290-1-jason-jh.lin@mediatek.com> MIME-Version: 1.0 X-MTK: N X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" If cursor plane has updated but primary plane config task is not finished, mtk_drm_crtc_update_config will call mbox_flush() to clear all task in current GCE thread and let cursor plane re-send a new GCE task with cursor + primary plane config to replace the unfinished GCE task. So the plane config flag should not be cleared when mailbox callback with a error status. Fixes: 9efb16c2fdd6 ("drm/mediatek: Clear pending flag when cmdq packet is done") Signed-off-by: jason-jh.lin --- drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c index 06342df2a0be..fb0d9424acec 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c @@ -281,6 +281,9 @@ static void ddp_cmdq_cb(struct mbox_client *cl, void *mssg) struct mtk_crtc_state *state; unsigned int i; + if (data->sta != 0) + return; + state = to_mtk_crtc_state(mtk_crtc->base.state); state->pending_config = false;