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
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.
10 Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
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(-)
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 */
22 .fourcc = V4L2_PIX_FMT_PISP_COMP1_RGGB,
23 - .code = MEDIA_BUS_FMT_PISP_COMP1_RGGB,
24 + .code = MEDIA_BUS_FMT_SRGGB16_1X16,
26 .flags = CFE_FORMAT_FLAG_FE_OUT,
29 .fourcc = V4L2_PIX_FMT_PISP_COMP1_BGGR,
30 - .code = MEDIA_BUS_FMT_PISP_COMP1_BGGR,
31 + .code = MEDIA_BUS_FMT_SBGGR16_1X16,
33 .flags = CFE_FORMAT_FLAG_FE_OUT,
36 .fourcc = V4L2_PIX_FMT_PISP_COMP1_GBRG,
37 - .code = MEDIA_BUS_FMT_PISP_COMP1_GBRG,
38 + .code = MEDIA_BUS_FMT_SGBRG16_1X16,
40 .flags = CFE_FORMAT_FLAG_FE_OUT,
43 .fourcc = V4L2_PIX_FMT_PISP_COMP1_GRBG,
44 - .code = MEDIA_BUS_FMT_PISP_COMP1_GRBG,
45 + .code = MEDIA_BUS_FMT_SGRBG16_1X16,
47 .flags = CFE_FORMAT_FLAG_FE_OUT,
49 @@ -283,10 +283,12 @@ static const struct cfe_fmt formats[] =
50 /* Frontend formats */
52 .fourcc = V4L2_META_FMT_RPI_FE_CFG,
53 + .code = MEDIA_BUS_FMT_FIXED,
54 .flags = CFE_FORMAT_FLAG_META_OUT,
57 .fourcc = V4L2_META_FMT_RPI_FE_STATS,
58 + .code = MEDIA_BUS_FMT_FIXED,
59 .flags = CFE_FORMAT_FLAG_META_CAP,
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_
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;
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_
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;
82 @@ -443,12 +443,9 @@ static int pisp_fe_pad_set_fmt(struct v4
87 - format->format.code = MEDIA_BUS_FMT_PISP_FE_CONFIG;
91 - format->format.code = MEDIA_BUS_FMT_PISP_FE_STATS;
93 + format->format.code = MEDIA_BUS_FMT_FIXED;
97 --- a/include/uapi/linux/media-bus-format.h
98 +++ b/include/uapi/linux/media-bus-format.h
100 /* Sensor ancillary metadata formats - next is 0x7002 */
101 #define MEDIA_BUS_FMT_SENSOR_DATA 0x7002
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
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
117 #endif /* __LINUX_MEDIA_BUS_FORMAT_H */