From patchwork Mon Mar 27 03:13:33 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: 75180 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1243571vqo; Sun, 26 Mar 2023 20:15:30 -0700 (PDT) X-Google-Smtp-Source: AKy350b8pHQ+IoKphAe5km+W93IIyY3RMJCY3lHOwyIi/NMIJoJLen5WoSF8w0k/xCspj9FZvn1h X-Received: by 2002:a17:90b:3a8f:b0:240:3ee4:d2d1 with SMTP id om15-20020a17090b3a8f00b002403ee4d2d1mr11257684pjb.13.1679886930393; Sun, 26 Mar 2023 20:15:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679886930; cv=none; d=google.com; s=arc-20160816; b=BWhCMgoPOkPWsWi2Tzro+C14lvq0WngvSg7BkgvMF0FIaY36iZxnqklYGIx3iQYK+I M9OsZy3MDcmo5QbHSXoTGk2YpKHDZMRJ4FFNMEhZZpUbhcGadmZWK8x1RXgHc49IAtpK d6iUofM60pGGB5Ck74FHc+lEpLwn7LY8fXlHtUsS8oWyHxy5lNos6d3+Av7VokSF3qCP KcEmBqb6FjH138g7Xt0+4A3SYLAhhauU6qKryGGqwODyeV6qt//IZMgV211L2OQl1Tkb YCAGefq8APajL0w2/o+FbGAiZvePp+ARd4RA7w6kYcObfjdAkNft182vnwLqbqpgf6DM ajJg== 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=KpS7zOQiS8xm+MgSXF0zo7YlE8zlcISMKY7OkefTdQ8=; b=HEB/OF0bh3Vy2HDni4zByzG1xf1g/WUR5D3LfS4gvbYPz3taO0+v2WA2AcZydAFkFL /N6biSX08LXTqeSuFTiSd+jqHyXrskN/hXpMvKT1a2VQFlKcXUCBsVwvPcF3XYEBDI1T BPvMHd0R/AHyXlqAUhOXVhEkCsa2n1qUlE5qRkP+uS0XTsNFWeRQkvzKRL7BS2G3c8B1 Fxrgg/M/iePVljrRl0zrQ7lG6pMRTsdxBiMQEwDfxyGFLtFrZrs5TjxpZfSiRO2IkDLH uaQFfVSMB8fui7NdkdaClgR2jrA7sOMsP5+IQgnuvTXa7tGE/0JOJw5mX2noP0qBH+7u SR2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=LiSVo88o; 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 b7-20020a656687000000b00513234112a8si6736688pgw.884.2023.03.26.20.15.16; Sun, 26 Mar 2023 20:15:30 -0700 (PDT) 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=LiSVo88o; 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 S232224AbjC0DOd (ORCPT + 99 others); Sun, 26 Mar 2023 23:14:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232215AbjC0DN6 (ORCPT ); Sun, 26 Mar 2023 23:13:58 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08D9F5589; Sun, 26 Mar 2023 20:13:45 -0700 (PDT) X-UUID: 5def37f4cc4d11edb6b9f13eb10bd0fe-20230327 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=KpS7zOQiS8xm+MgSXF0zo7YlE8zlcISMKY7OkefTdQ8=; b=LiSVo88otfiZLIsH6j3xwIVh5vgqzIcqPlCxFeyKGcWZaCUtye1tKOQPOMUqqJU9NA80Y/RsXdOnPGdM2/2WzImix8EnzRUpY1wXl/05/l44Q/lyKxB1GqrwYPGIdekmnjkdAEjfs8AKjw1MekwNZJESQkn4XVMQRT5O7AiFd58=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:9f1b5251-3baf-4810-915d-4a004a9f1c44,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.22,REQID:9f1b5251-3baf-4810-915d-4a004a9f1c44,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:120426c,CLOUDID:b9f870b4-beed-4dfc-bd9c-e1b22fa6ccc4,B ulkID:230327111339EGEJ7AOR,BulkQuantity:0,Recheck:0,SF:38|29|28|17|19|48,T C:nil,Content:0,EDM:-3,IP:nil,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 ,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-UUID: 5def37f4cc4d11edb6b9f13eb10bd0fe-20230327 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 277477412; Mon, 27 Mar 2023 11:13:37 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.108) by mtkmbs13n1.mediatek.inc (172.21.101.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Mon, 27 Mar 2023 11:13:37 +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.25 via Frontend Transport; Mon, 27 Mar 2023 11:13:37 +0800 From: Moudy Ho To: Mauro Carvalho Chehab , Matthias Brugger , Hans Verkuil , Ping-Hsun Wu CC: , , , , , Moudy Ho Subject: [PATCH v7 10/12] media: platform: mtk-mdp3: Split general definitions used in MDP3 Date: Mon, 27 Mar 2023 11:13:33 +0800 Message-ID: <20230327031335.9663-11-moudy.ho@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230327031335.9663-1-moudy.ho@mediatek.com> References: <20230327031335.9663-1-moudy.ho@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, UNPARSEABLE_RELAY autolearn=unavailable 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?1761489117665454186?= X-GMAIL-MSGID: =?utf-8?q?1761489117665454186?= Separate the generic definitions used in MDP3 to avoid recursive includes when splitting chip-related definitions in further. Signed-off-by: Moudy Ho --- .../platform/mediatek/mdp3/mtk-img-ipi.h | 46 +--------------- .../platform/mediatek/mdp3/mtk-mdp3-type.h | 53 +++++++++++++++++++ 2 files changed, 54 insertions(+), 45 deletions(-) create mode 100644 drivers/media/platform/mediatek/mdp3/mtk-mdp3-type.h diff --git a/drivers/media/platform/mediatek/mdp3/mtk-img-ipi.h b/drivers/media/platform/mediatek/mdp3/mtk-img-ipi.h index c7f231f8ea3e..f5296994137a 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-img-ipi.h +++ b/drivers/media/platform/mediatek/mdp3/mtk-img-ipi.h @@ -8,7 +8,7 @@ #ifndef __MTK_IMG_IPI_H__ #define __MTK_IMG_IPI_H__ -#include +#include "mtk-mdp3-type.h" /* * ISP-MDP generic input information @@ -16,12 +16,6 @@ * 6da52bdcf4bf76a0983b313e1d4745d6 */ -#define IMG_MAX_HW_INPUTS 3 - -#define IMG_MAX_HW_OUTPUTS 4 - -#define IMG_MAX_PLANES 3 - #define IMG_IPI_INIT 1 #define IMG_IPI_DEINIT 2 #define IMG_IPI_FRAME 3 @@ -71,17 +65,6 @@ struct img_image_buffer { #define IMG_SUBPIXEL_SHIFT 20 -struct img_crop { - s32 left; - s32 top; - u32 width; - u32 height; - u32 left_subpix; - u32 top_subpix; - u32 width_subpix; - u32 height_subpix; -} __packed; - #define IMG_CTRL_FLAG_HFLIP BIT(0) #define IMG_CTRL_FLAG_DITHER BIT(1) #define IMG_CTRL_FLAG_SHARPNESS BIT(4) @@ -146,20 +129,6 @@ struct img_comp_frame { u32 out_total_width; } __packed; -struct img_region { - s32 left; - s32 right; - s32 top; - s32 bottom; -} __packed; - -struct img_offset { - s32 left; - s32 top; - u32 left_subpix; - u32 top_subpix; -} __packed; - struct img_comp_subfrm { u32 tile_disable; struct img_region in; @@ -267,19 +236,6 @@ struct img_compparam { }; } __packed; -#define IMG_MAX_COMPONENTS 20 - -struct img_mux { - u32 reg; - u32 value; - u32 subsys_id; -} __packed; - -struct img_mmsys_ctrl { - struct img_mux sets[IMG_MAX_COMPONENTS * 2]; - u32 num_sets; -} __packed; - struct img_config { struct img_compparam components[IMG_MAX_COMPONENTS]; u32 num_components; diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-type.h b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-type.h new file mode 100644 index 000000000000..ae0396806152 --- /dev/null +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-type.h @@ -0,0 +1,53 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) 2023 MediaTek Inc. + * Author: Ping-Hsun Wu + */ + +#ifndef __MTK_MDP3_TYPE_H__ +#define __MTK_MDP3_TYPE_H__ + +#include + +#define IMG_MAX_HW_INPUTS 3 +#define IMG_MAX_HW_OUTPUTS 4 +#define IMG_MAX_PLANES 3 +#define IMG_MAX_COMPONENTS 20 + +struct img_crop { + s32 left; + s32 top; + u32 width; + u32 height; + u32 left_subpix; + u32 top_subpix; + u32 width_subpix; + u32 height_subpix; +} __packed; + +struct img_region { + s32 left; + s32 right; + s32 top; + s32 bottom; +} __packed; + +struct img_offset { + s32 left; + s32 top; + u32 left_subpix; + u32 top_subpix; +} __packed; + +struct img_mux { + u32 reg; + u32 value; + u32 subsys_id; +} __packed; + +struct img_mmsys_ctrl { + struct img_mux sets[IMG_MAX_COMPONENTS * 2]; + u32 num_sets; +} __packed; + +#endif /* __MTK_MDP3_TYPE_H__ */