From patchwork Thu Nov 24 12:38:58 2022 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: 25499 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3371432wrr; Thu, 24 Nov 2022 04:41:13 -0800 (PST) X-Google-Smtp-Source: AA0mqf6ijzUvjE5GlRmfTl6oVqdnLhz6pSXfiPpv3XqCDGOE0vXBaK4K4U6FRR3oSvNvD2EAmCqF X-Received: by 2002:a63:5a13:0:b0:477:8fed:8122 with SMTP id o19-20020a635a13000000b004778fed8122mr12638608pgb.346.1669293672807; Thu, 24 Nov 2022 04:41:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669293672; cv=none; d=google.com; s=arc-20160816; b=rcWUzktA5lXJTHuE7mV1FT6iX0l91cXBd00v+c2sYyfZzi0vUJYCHrCFVzTT8WfoYJ pCulYCeTbOxn6umTICRCt1SOjsMrn5Bo9eks9iLURraRQaipLyQXtKYQfzQvGwrvWKs4 vui25rqQXEAknrZsnySQYlbcEoDtY5AL95Uew3cB5/YlbIv0qx69RDimfrhDpKdkNtiC hZbFcrNLE/Utz1sFENzxOVm19U+QkCIblUqbz0AZegk6UyMjodqxdJhMNNX/5lIrNWv4 pAXPgZF2CE+hlS8TiLW5nemNqMU3udxWGbHR4+ktg0v/mWBJi8ecKXiPzPeMYW/oucw0 UWRQ== 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=6xF/zeCCVLyEJ+xAWRxshxuUk+t638QqKQjpL5e1kXQ=; b=pkTa59mNmsYbc6QdDZJcGGmcp5hbucflwsqb8RmCpagUJtQ04ONUlhsOOAP6Oh3fDL O15x/wfZCyuh9aJwdEJzMqAXm4oooLXO9buos/ysvEWdehHaU0umQxUmw8GsLbZ/ey9n b0xIeYWgNg7xLVR5z93N/8kxWN5wYk3g4Kdo+LHmp7GCgsQpzAvHX7ZFmoIKhL2I2H6C pF3GtFFLtXE3JOQhgBfRaL8TdSTosV0n2QxSnzg/Qzz2JZywVY7/DKzd9sK2MZtLdId6 ddMXwHYL4uRyuTuCrtJcz2R4b/osrHVEr1LEoRRHLSm+IONC8oRaQUg4rNAsxjM7A8tL UZBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=BiCVU0LF; 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 p7-20020a634f47000000b0046fd05d55e0si1196565pgl.567.2022.11.24.04.41.00; Thu, 24 Nov 2022 04:41:12 -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=BiCVU0LF; 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 S229840AbiKXMj1 (ORCPT + 99 others); Thu, 24 Nov 2022 07:39:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229770AbiKXMjM (ORCPT ); Thu, 24 Nov 2022 07:39:12 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD5268B84B; Thu, 24 Nov 2022 04:39:10 -0800 (PST) X-UUID: 9fcab5ec7df24bc8ab457738e2d46792-20221124 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=6xF/zeCCVLyEJ+xAWRxshxuUk+t638QqKQjpL5e1kXQ=; b=BiCVU0LFJ5Q7bqBu9sXCj16AQUZKS4dOZetnq2R/lDukQ6ZFs1jG9fXJ/GmnquvTYoRwZL4db+7Hm/XrJGYeHAEOdKlPdhHEa2bt8s2XLTKXnkEF2bn6x5fGt6+GCqwxzHaBtVPh7XAdHoNxeQJYSvKqIzCMyAaNdPJ73nI1cGo=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.14,REQID:a5e7dc6f-0276-47f3-a452-1bcedcc3af13,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.14,REQID:a5e7dc6f-0276-47f3-a452-1bcedcc3af13,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:dcaaed0,CLOUDID:081c37f9-3a34-4838-abcf-dfedf9dd068e,B ulkID:221124203904USZ2PJMV,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 X-UUID: 9fcab5ec7df24bc8ab457738e2d46792-20221124 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1871204616; Thu, 24 Nov 2022 20:39:02 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) 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.792.15; Thu, 24 Nov 2022 20:39:02 +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; Thu, 24 Nov 2022 20:39:02 +0800 From: Moudy Ho To: Mauro Carvalho Chehab , Matthias Brugger , Hans Verkuil CC: Chun-Kuang Hu , , , , , Moudy Ho Subject: [PATCH v4 8/9] media: platform: mtk-mdp3: Split general definitions used in MDP3 Date: Thu, 24 Nov 2022 20:38:58 +0800 Message-ID: <20221124123859.24395-9-moudy.ho@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20221124123859.24395-1-moudy.ho@mediatek.com> References: <20221124123859.24395-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?1750381281998799481?= X-GMAIL-MSGID: =?utf-8?q?1750381281998799481?= 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 | 45 +--------------- .../platform/mediatek/mdp3/mtk-mdp3-type.h | 53 +++++++++++++++++++ 2 files changed, 54 insertions(+), 44 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..239578f9ff96 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-img-ipi.h +++ b/drivers/media/platform/mediatek/mdp3/mtk-img-ipi.h @@ -9,6 +9,7 @@ #define __MTK_IMG_IPI_H__ #include +#include "mtk-mdp3-type.h" /* * ISP-MDP generic input information @@ -16,12 +17,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 +66,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 +130,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 +237,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..37cd7b27548f --- /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) 2022 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__ */