media: platform: mtk-mdp3: Split general definitions used in MDP3
authorMoudy Ho <moudy.ho@mediatek.com>
Mon, 27 Mar 2023 03:13:33 +0000 (11:13 +0800)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Tue, 11 Apr 2023 15:17:46 +0000 (17:17 +0200)
Separate the generic definitions used in MDP3 to avoid recursive includes
when splitting chip-related definitions in further.

Signed-off-by: Moudy Ho <moudy.ho@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/platform/mediatek/mdp3/mtk-img-ipi.h
drivers/media/platform/mediatek/mdp3/mtk-mdp3-type.h [new file with mode: 0644]

index c7f231f8ea3e74ff368e05324f0102c356b2504b..f5296994137a2689c935306c2976715e2fbe5e51 100644 (file)
@@ -8,7 +8,7 @@
 #ifndef __MTK_IMG_IPI_H__
 #define __MTK_IMG_IPI_H__
 
-#include <linux/types.h>
+#include "mtk-mdp3-type.h"
 
 /*
  * ISP-MDP generic input information
  *     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 (file)
index 0000000..ae03968
--- /dev/null
@@ -0,0 +1,53 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (c) 2023 MediaTek Inc.
+ * Author: Ping-Hsun Wu <ping-hsun.wu@mediatek.com>
+ */
+
+#ifndef __MTK_MDP3_TYPE_H__
+#define __MTK_MDP3_TYPE_H__
+
+#include <linux/types.h>
+
+#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__ */