From patchwork Fri Jan 13 09:03:17 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: 43080 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp162861wrt; Fri, 13 Jan 2023 01:04:25 -0800 (PST) X-Google-Smtp-Source: AMrXdXusJUJQMA1o00ZetxbQzikvfCqamtCGdqOIks7PzBxGxwuUaxdvXM/T9vsBnBRLeszWynlz X-Received: by 2002:a17:903:328a:b0:194:706c:d05d with SMTP id jh10-20020a170903328a00b00194706cd05dmr1198565plb.13.1673600665191; Fri, 13 Jan 2023 01:04:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673600665; cv=none; d=google.com; s=arc-20160816; b=CSBpp6d9AGhe96oFbw/Ef1AGD6a3FyxA7og9+BTJUyQroVJTdZJVNC3o5bD2RY2oW7 OXP20ixEW39l7NCjJ75XjN5RWUOtTKU9qjbhMVKtkNcybVVGKZSH4xK3SpiFCWwLunSH E/LUsKqhMAhrm1Ts5ed9ph6eu/8OBQxxk8c23+N1Lp2/HrSjqy0oVreekt7Uo3XVkr+i cGlAuS3ln3wWbZV3pgsjHbAuFgLAdeCHgbKmccRuigdQ9wCK7h+LqyIUfxpGruAn2bba BpzL6OUSkkzfmLNA5RxU1okPZFC8lJphJS2xkucFJ7Guoc99OQTw3LVpNZ59zInajAUG CcoA== 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=SfUBszp4dO84vq2nYKyY0IHmqBqG0KnML6VZd+caUoqtTswOp/SkIG9UnHbfY+XxmB AWzvnpijEInxkpJWPzZCYpRKhKeZfZB015KK7IpX1QhNYVRXPpIcm/ISrDhj/UYl7vUn NEN0G3TUmnJUoqWPNvpx0zyztAJIsZApQHWOrC1bGEsEHbURPA9vw7xztu1wt053A+L2 TmWYDVFff+Mb474S1We+15yY2RrHeeRqqGqNNF7/49L7Ux2rjWTo0XTX5FSyTxVqqoIx ZiiD56CVO892rGxOpnhDAz63qAeezbtxWQ/Aw++XUGsA+8yXOSI9zstW7FMJtVQGtG1P 2YCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=XDVTnyhI; 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 u9-20020a170903124900b0017a0f71990dsi21022387plh.141.2023.01.13.01.04.12; Fri, 13 Jan 2023 01:04:25 -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=XDVTnyhI; 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 S233650AbjAMJDs (ORCPT + 99 others); Fri, 13 Jan 2023 04:03:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236680AbjAMJDb (ORCPT ); Fri, 13 Jan 2023 04:03:31 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD5275F92C; Fri, 13 Jan 2023 01:03:30 -0800 (PST) X-UUID: 22eea1b8932111eda06fc9ecc4dadd91-20230113 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=XDVTnyhIxtXvjh+IQhS3uwwBcxEvW9979NeB1dnex407cN/AlzPj2VdoI6FVrHZwXNt09EBs8ONWZHjXgxyt/t6jl2FwNHNVgWR0iyRtk/t56ZxtIjL0Y8cCl3gfrEZmHQ3uFyfWTbbbea8Ku2Boz4/0oGltvB4RK9Yx3MB8VoI=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.17,REQID:cb0ca602-5b58-43ec-82af-a5706f03cbb2,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:95 X-CID-INFO: VERSION:1.1.17,REQID:cb0ca602-5b58-43ec-82af-a5706f03cbb2,IP:0,URL :0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTION :quarantine,TS:95 X-CID-META: VersionHash:543e81c,CLOUDID:f7979054-dd49-462e-a4be-2143a3ddc739,B ulkID:2301131703280JYSY1HV,BulkQuantity:0,Recheck:0,SF:38|28|17|19|48,TC:n il,Content:0,EDM:-3,IP:nil,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OS I:0,OSA:0 X-CID-APTURL: Status:success,Category:nil,Trust:0,Unknown:0,Malicious:0 X-CID-BVR: 0 X-UUID: 22eea1b8932111eda06fc9ecc4dadd91-20230113 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 2092236139; Fri, 13 Jan 2023 17:03:24 +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; Fri, 13 Jan 2023 17:03:23 +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; Fri, 13 Jan 2023 17:03:23 +0800 From: Moudy Ho To: Mauro Carvalho Chehab , Matthias Brugger , Hans Verkuil CC: Chun-Kuang Hu , , , , , Moudy Ho Subject: [PATCH v3 09/13] media: platform: mtk-mdp3: add the blend of component in MUTEX MOD Date: Fri, 13 Jan 2023 17:03:17 +0800 Message-ID: <20230113090321.25128-10-moudy.ho@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230113090321.25128-1-moudy.ho@mediatek.com> References: <20230113090321.25128-1-moudy.ho@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY autolearn=ham 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?1754897491166677066?= X-GMAIL-MSGID: =?utf-8?q?1754897491166677066?= 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;