fabc96e4221cacf26fa3f02baf21b5148fc0f744
[openwrt/staging/ldir.git] /
1 From b5c3cc7fd9fca73352310e61092fb445b56a362a Mon Sep 17 00:00:00 2001
2 From: Naushir Patuck <naush@raspberrypi.com>
3 Date: Tue, 10 Oct 2023 12:41:15 +0100
4 Subject: [PATCH] drivers: media: rp1_cfe: Remove PISP specific MBUS formats
5
6 Remove the MEDIA_BUS_FMT_PISP* format codcs entirely. For the image
7 pad formats, use the 16-bit Bayer format mbus codes instead. For the
8 config and stats pad formats, use MEDIA_BUS_FMT_FIXED.
9
10 Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
11 ---
12 .../media/platform/raspberrypi/rp1_cfe/cfe_fmts.h | 10 ++++++----
13 .../media/platform/raspberrypi/rp1_cfe/pisp_fe.c | 11 ++++-------
14 include/uapi/linux/media-bus-format.h | 14 --------------
15 3 files changed, 10 insertions(+), 25 deletions(-)
16
17 --- a/drivers/media/platform/raspberrypi/rp1_cfe/cfe_fmts.h
18 +++ b/drivers/media/platform/raspberrypi/rp1_cfe/cfe_fmts.h
19 @@ -215,25 +215,25 @@ static const struct cfe_fmt formats[] =
20 /* PiSP Compressed Mode 1 */
21 {
22 .fourcc = V4L2_PIX_FMT_PISP_COMP1_RGGB,
23 - .code = MEDIA_BUS_FMT_PISP_COMP1_RGGB,
24 + .code = MEDIA_BUS_FMT_SRGGB16_1X16,
25 .depth = 8,
26 .flags = CFE_FORMAT_FLAG_FE_OUT,
27 },
28 {
29 .fourcc = V4L2_PIX_FMT_PISP_COMP1_BGGR,
30 - .code = MEDIA_BUS_FMT_PISP_COMP1_BGGR,
31 + .code = MEDIA_BUS_FMT_SBGGR16_1X16,
32 .depth = 8,
33 .flags = CFE_FORMAT_FLAG_FE_OUT,
34 },
35 {
36 .fourcc = V4L2_PIX_FMT_PISP_COMP1_GBRG,
37 - .code = MEDIA_BUS_FMT_PISP_COMP1_GBRG,
38 + .code = MEDIA_BUS_FMT_SGBRG16_1X16,
39 .depth = 8,
40 .flags = CFE_FORMAT_FLAG_FE_OUT,
41 },
42 {
43 .fourcc = V4L2_PIX_FMT_PISP_COMP1_GRBG,
44 - .code = MEDIA_BUS_FMT_PISP_COMP1_GRBG,
45 + .code = MEDIA_BUS_FMT_SGRBG16_1X16,
46 .depth = 8,
47 .flags = CFE_FORMAT_FLAG_FE_OUT,
48 },
49 @@ -283,10 +283,12 @@ static const struct cfe_fmt formats[] =
50 /* Frontend formats */
51 {
52 .fourcc = V4L2_META_FMT_RPI_FE_CFG,
53 + .code = MEDIA_BUS_FMT_FIXED,
54 .flags = CFE_FORMAT_FLAG_META_OUT,
55 },
56 {
57 .fourcc = V4L2_META_FMT_RPI_FE_STATS,
58 + .code = MEDIA_BUS_FMT_FIXED,
59 .flags = CFE_FORMAT_FLAG_META_CAP,
60 },
61 };
62 --- a/drivers/media/platform/raspberrypi/rp1_cfe/pisp_fe.c
63 +++ b/drivers/media/platform/raspberrypi/rp1_cfe/pisp_fe.c
64 @@ -404,7 +404,7 @@ static int pisp_fe_init_cfg(struct v4l2_
65
66 fmt = v4l2_subdev_get_pad_format(sd, state, FE_CONFIG_PAD);
67 *fmt = cfe_default_meta_format;
68 - fmt->code = MEDIA_BUS_FMT_PISP_FE_CONFIG;
69 + fmt->code = MEDIA_BUS_FMT_FIXED;
70
71 fmt = v4l2_subdev_get_pad_format(sd, state, FE_OUTPUT0_PAD);
72 *fmt = cfe_default_format;
73 @@ -416,7 +416,7 @@ static int pisp_fe_init_cfg(struct v4l2_
74
75 fmt = v4l2_subdev_get_pad_format(sd, state, FE_STATS_PAD);
76 *fmt = cfe_default_meta_format;
77 - fmt->code = MEDIA_BUS_FMT_PISP_FE_STATS;
78 + fmt->code = MEDIA_BUS_FMT_FIXED;
79
80 return 0;
81 }
82 @@ -443,12 +443,9 @@ static int pisp_fe_pad_set_fmt(struct v4
83
84 break;
85
86 - case FE_CONFIG_PAD:
87 - format->format.code = MEDIA_BUS_FMT_PISP_FE_CONFIG;
88 - break;
89 -
90 case FE_STATS_PAD:
91 - format->format.code = MEDIA_BUS_FMT_PISP_FE_STATS;
92 + case FE_CONFIG_PAD:
93 + format->format.code = MEDIA_BUS_FMT_FIXED;
94 break;
95 }
96
97 --- a/include/uapi/linux/media-bus-format.h
98 +++ b/include/uapi/linux/media-bus-format.h
99 @@ -175,18 +175,4 @@
100 /* Sensor ancillary metadata formats - next is 0x7002 */
101 #define MEDIA_BUS_FMT_SENSOR_DATA 0x7002
102
103 -/* PiSP Formats */
104 -#define MEDIA_BUS_FMT_PISP_COMP1_RGGB 0x8001
105 -#define MEDIA_BUS_FMT_PISP_COMP1_GRBG 0x8002
106 -#define MEDIA_BUS_FMT_PISP_COMP1_GBRG 0x8003
107 -#define MEDIA_BUS_FMT_PISP_COMP1_BGGR 0x8004
108 -#define MEDIA_BUS_FMT_PISP_COMP2_RGGB 0x8005
109 -#define MEDIA_BUS_FMT_PISP_COMP2_GRBG 0x8006
110 -#define MEDIA_BUS_FMT_PISP_COMP2_GBRG 0x8007
111 -#define MEDIA_BUS_FMT_PISP_COMP2_BGGR 0x8008
112 -
113 -#define MEDIA_BUS_FMT_PISP_FE_CONFIG 0x8100
114 -#define MEDIA_BUS_FMT_PISP_FE_STATS 0x8101
115 -#define MEDIA_BUS_FMT_PISP_BE_CONFIG 0x8200
116 -
117 #endif /* __LINUX_MEDIA_BUS_FORMAT_H */