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