From patchwork Mon Jan 16 03:21:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?TW91ZHkgSG8gKOS9leWul+WOnyk=?= X-Patchwork-Id: 43935 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp999661wrn; Sun, 15 Jan 2023 19:22:53 -0800 (PST) X-Google-Smtp-Source: AMrXdXs8re6CxBuCwEm0KhPRFz55g9ukL5goVS3zaP96fKPr2XRsZcWzwrd4hb2DQCL3Stqr3SUF X-Received: by 2002:a05:6a20:158b:b0:af:7b32:4deb with SMTP id h11-20020a056a20158b00b000af7b324debmr124249560pzj.4.1673839372757; Sun, 15 Jan 2023 19:22:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673839372; cv=none; d=google.com; s=arc-20160816; b=LEEFjR9x+fuH8EapIKylhU/U8sQUap+Ta4elmXzwzdzo4JMcMQsKv+9VHGshWIT3YS ATfPgES7XM6Qx8G/FBdqRs5AvnaTYBNI+WQxL8hG/FgHPlvG0kp5daJFlBtSpCraIEuK dNTgUIO2RNq0qlzJCmrdwo0Ziwb76JWfBqZj+h+lnLuNMDIokezOiR9QnWG03jSe4iSI +amNLB8ApLlFxBH2v3Zr1I+Gqpfz6DhJ/y83zuhyTSbosxQ71XnT1RMnhYD7NOuK18rp zcSRcvPIhy2VBy4Va70cuBqdTIIevkaV4GVtUQyUO+p1L2Gym1tsGyYM/wEBHY9dIjF6 C9cA== 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=vZgR6XrcQdfRcjoVZjERFvas8vDe9zTI0Gm4QdyJhqc=; b=zJcaQ1+W2pTHyT/Fywt100mqeJBX/CMZvIJWUI1c73/g6z82+IDRCaybQqPqMds5qP rSazsWx8ZoUsoVGLrWE10Wb/fm3xlAu6Zkn7l4NwcvB7CtTRSYKMpoR50NmzdzzhVdJk RcpBTXfNBCUpyORSiFnmwWT+xOUtup4eauat/LsmtZRHjwKWOHaTig0xpjQ/5OgeFBQM ZzvTNEHeM/Tk6rq5KO91om2jffukADkvpYUIvla+lfBcwHT3YbKi79VGz159w677cH7Z N2mPQgzpKVE41ncgZVEcYYOMtQv+FpgtszZeT78o5IiyH6NIkcsOec0Yq8kn/5cntoiR o7Yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=OdsrWDtZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k184-20020a6384c1000000b004bec17d1700si4394256pgd.725.2023.01.15.19.22.41; Sun, 15 Jan 2023 19:22:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=OdsrWDtZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231887AbjAPDWQ (ORCPT + 99 others); Sun, 15 Jan 2023 22:22:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231809AbjAPDWE (ORCPT ); Sun, 15 Jan 2023 22:22:04 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37E3C7AA6; Sun, 15 Jan 2023 19:21:59 -0800 (PST) X-UUID: eaecb61e954c11ed945fc101203acc17-20230116 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=vZgR6XrcQdfRcjoVZjERFvas8vDe9zTI0Gm4QdyJhqc=; b=OdsrWDtZQgZ89d3z9NNQus9mdQJOlABssnNzfciRH+c1veEM/V/QI2xOMT9dkzV4RbVfvF/SgUkAA3NjfJwCQl9yg9PGCCQemsf91BV5azPRaW3rrermVia75RHI75L+0GeUij7cjs0R7FFHwlndhsJ2VmMxLcnmTGtrSThlvEE=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.17,REQID:d61169c4-754b-4c3a-b980-63e0bec086ea,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:543e81c,CLOUDID:3ff6558c-8530-4eff-9f77-222cf6e2895b,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 X-CID-BVR: 0 X-UUID: eaecb61e954c11ed945fc101203acc17-20230116 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1614832561; Mon, 16 Jan 2023 11:21:50 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) 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.792.15; Mon, 16 Jan 2023 11:21:49 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Mon, 16 Jan 2023 11:21:49 +0800 From: Moudy Ho To: Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Matthias Brugger CC: , , , , , , Moudy Ho Subject: [RESEND v3 09/13] media: platform: mtk-mdp3: add the blend of component in MUTEX MOD Date: Mon, 16 Jan 2023 11:21:43 +0800 Message-ID: <20230116032147.23607-10-moudy.ho@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230116032147.23607-1-moudy.ho@mediatek.com> References: <20230116032147.23607-1-moudy.ho@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,RDNS_NONE, SPF_HELO_PASS,SPF_PASS,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755147794168290514?= X-GMAIL-MSGID: =?utf-8?q?1755147794168290514?= 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 72b5dc4cb3b1..f21dfce9098e 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c @@ -122,6 +122,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); @@ -133,6 +134,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 d9442679cf53..c91d87359b17 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;