From patchwork Wed Feb 8 09:22:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Moudy Ho X-Patchwork-Id: 13132720 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 54FEBC05027 for ; Wed, 8 Feb 2023 09:30:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:CC:To:From:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=pqc9a9dKCxvrbK1ke2fhncynItEc+ih/4TttJQkZg7w=; b=ARoNkgiyJdNsUi70YeMLKngRr9 7POxIBJXHBBLGlgm9YkDB0T9HnCh4fXXGfb0Iz2tlSq9wCEPJ1yT+eFDgHFauMFn/O/hAYRw0q4kW tZvx0WZMuqe4fpXg6BFDN66c5WKqXDN2FrXV7XEX855HastM5vQm+eFxhf3QxXPlV8Y0tdcCp1i2/ Bh6f+Ti+Nn25SNizAdbwV2CkBssVFmhhTfU7R9b2gG+Zu5YkojC6W0Oo89juLh95O7s7i2zLaBpDH eU5jRwCFaMqtKwSpKFolEECzUFSzcjEBEwfyErOHikcGhGzrp9IeM+8OTQnAWHRz1GRjArE2nvMWX noJ+UFbA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pPgmH-00ErGc-Q7; Wed, 08 Feb 2023 09:30:09 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pPgfI-00Enyo-VC; Wed, 08 Feb 2023 09:23:01 +0000 X-UUID: 26881892a79211edbbe3f76fe852e059-20230208 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=pqc9a9dKCxvrbK1ke2fhncynItEc+ih/4TttJQkZg7w=; b=acnKU7hsoL37hzBKgzDTvsH7Lw86aM9dUn54EalhpOYhplleGRhaHDTn6rve4UPvNJA/E6yOIJIDhvdDFHPQEUwnlHGgyJP3+aOtjPbgKxVhyghHPxoneCvrH5ZNmq5Mj20TMa/AYPTaYuvCARWdBhYM1XIPgwrLTDweT9W7rNM=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.19,REQID:ef8c10d7-5683-4745-80f9-1d3fe5c51cd9,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:885ddb2,CLOUDID:0cddaa56-dd49-462e-a4be-2143a3ddc739,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-UUID: 26881892a79211edbbe3f76fe852e059-20230208 Received: from mtkmbs13n2.mediatek.inc [(172.21.101.108)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1618556610; Wed, 08 Feb 2023 02:22:47 -0700 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.3; Wed, 8 Feb 2023 17:22:12 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Wed, 8 Feb 2023 17:22:12 +0800 From: Moudy Ho To: Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Matthias Brugger CC: , , , , , , Moudy Ho Subject: [PATCH v4 12/16] media: platform: mtk-mdp3: add the blend of component in MUTEX MOD Date: Wed, 8 Feb 2023 17:22:05 +0800 Message-ID: <20230208092209.19472-13-moudy.ho@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230208092209.19472-1-moudy.ho@mediatek.com> References: <20230208092209.19472-1-moudy.ho@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230208_012257_146095_42E385D2 X-CRM114-Status: GOOD ( 12.75 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org In further chips, some components will cooperate to achieve advanced functions, and these MODs need to be set at the same time. Signed-off-by: Moudy Ho --- drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c | 6 ++++++ drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c index 6204173ecc5d..259217233570 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c @@ -117,6 +117,7 @@ static int mdp_path_subfrm_require(const struct mdp_path *path, /* Set mutex mod */ for (index = 0; index < num_comp; index++) { s32 inner_id = MDP_COMP_NONE; + const struct mdp_comp_blend *b; if (CFG_CHECK(MT8183, p_id)) inner_id = CFG_GET(MT8183, path->config, components[index].type); @@ -128,6 +129,11 @@ static int mdp_path_subfrm_require(const struct mdp_path *path, id = ctx->comp->public_id; mtk_mutex_write_mod(mutex, data->mdp_mutex_table_idx[id], false); + b = &data->comp_data[id].blend; + if (b->mod_aid) + mtk_mutex_write_mod(mutex, + data->mdp_mutex_table_idx[b->mod_id], + false); } mtk_mutex_write_sof(mutex, MUTEX_SOF_IDX_SINGLE_MODE); diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.h b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.h index 09e46dfe4f02..9a72020ef26f 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.h +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.h @@ -201,9 +201,15 @@ struct mdp_comp_info { u32 dts_reg_ofst; }; +struct mdp_comp_blend { + bool mod_aid; + enum mtk_mdp_comp_id mod_id; +}; + struct mdp_comp_data { struct mdp_comp_match match; struct mdp_comp_info info; + struct mdp_comp_blend blend; }; struct mdp_comp_ops;