openwrt/target/linux/bcm27xx/patches-6.1/950-1020-drivers-media-rp1_cfe-Remove-PISP-specific-MBUS-form.patch

118 lines
3.7 KiB
Diff
Raw Normal View History

From b5c3cc7fd9fca73352310e61092fb445b56a362a Mon Sep 17 00:00:00 2001
From: Naushir Patuck <naush@raspberrypi.com>
Date: Tue, 10 Oct 2023 12:41:15 +0100
Subject: [PATCH] drivers: media: rp1_cfe: Remove PISP specific MBUS formats
Remove the MEDIA_BUS_FMT_PISP* format codcs entirely. For the image
pad formats, use the 16-bit Bayer format mbus codes instead. For the
config and stats pad formats, use MEDIA_BUS_FMT_FIXED.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
---
.../media/platform/raspberrypi/rp1_cfe/cfe_fmts.h | 10 ++++++----
.../media/platform/raspberrypi/rp1_cfe/pisp_fe.c | 11 ++++-------
include/uapi/linux/media-bus-format.h | 14 --------------
3 files changed, 10 insertions(+), 25 deletions(-)
--- a/drivers/media/platform/raspberrypi/rp1_cfe/cfe_fmts.h
+++ b/drivers/media/platform/raspberrypi/rp1_cfe/cfe_fmts.h
@@ -215,25 +215,25 @@ static const struct cfe_fmt formats[] =
/* PiSP Compressed Mode 1 */
{
.fourcc = V4L2_PIX_FMT_PISP_COMP1_RGGB,
- .code = MEDIA_BUS_FMT_PISP_COMP1_RGGB,
+ .code = MEDIA_BUS_FMT_SRGGB16_1X16,
.depth = 8,
.flags = CFE_FORMAT_FLAG_FE_OUT,
},
{
.fourcc = V4L2_PIX_FMT_PISP_COMP1_BGGR,
- .code = MEDIA_BUS_FMT_PISP_COMP1_BGGR,
+ .code = MEDIA_BUS_FMT_SBGGR16_1X16,
.depth = 8,
.flags = CFE_FORMAT_FLAG_FE_OUT,
},
{
.fourcc = V4L2_PIX_FMT_PISP_COMP1_GBRG,
- .code = MEDIA_BUS_FMT_PISP_COMP1_GBRG,
+ .code = MEDIA_BUS_FMT_SGBRG16_1X16,
.depth = 8,
.flags = CFE_FORMAT_FLAG_FE_OUT,
},
{
.fourcc = V4L2_PIX_FMT_PISP_COMP1_GRBG,
- .code = MEDIA_BUS_FMT_PISP_COMP1_GRBG,
+ .code = MEDIA_BUS_FMT_SGRBG16_1X16,
.depth = 8,
.flags = CFE_FORMAT_FLAG_FE_OUT,
},
@@ -283,10 +283,12 @@ static const struct cfe_fmt formats[] =
/* Frontend formats */
{
.fourcc = V4L2_META_FMT_RPI_FE_CFG,
+ .code = MEDIA_BUS_FMT_FIXED,
.flags = CFE_FORMAT_FLAG_META_OUT,
},
{
.fourcc = V4L2_META_FMT_RPI_FE_STATS,
+ .code = MEDIA_BUS_FMT_FIXED,
.flags = CFE_FORMAT_FLAG_META_CAP,
},
};
--- a/drivers/media/platform/raspberrypi/rp1_cfe/pisp_fe.c
+++ b/drivers/media/platform/raspberrypi/rp1_cfe/pisp_fe.c
@@ -404,7 +404,7 @@ static int pisp_fe_init_cfg(struct v4l2_
fmt = v4l2_subdev_get_pad_format(sd, state, FE_CONFIG_PAD);
*fmt = cfe_default_meta_format;
- fmt->code = MEDIA_BUS_FMT_PISP_FE_CONFIG;
+ fmt->code = MEDIA_BUS_FMT_FIXED;
fmt = v4l2_subdev_get_pad_format(sd, state, FE_OUTPUT0_PAD);
*fmt = cfe_default_format;
@@ -416,7 +416,7 @@ static int pisp_fe_init_cfg(struct v4l2_
fmt = v4l2_subdev_get_pad_format(sd, state, FE_STATS_PAD);
*fmt = cfe_default_meta_format;
- fmt->code = MEDIA_BUS_FMT_PISP_FE_STATS;
+ fmt->code = MEDIA_BUS_FMT_FIXED;
return 0;
}
@@ -443,12 +443,9 @@ static int pisp_fe_pad_set_fmt(struct v4
break;
- case FE_CONFIG_PAD:
- format->format.code = MEDIA_BUS_FMT_PISP_FE_CONFIG;
- break;
-
case FE_STATS_PAD:
- format->format.code = MEDIA_BUS_FMT_PISP_FE_STATS;
+ case FE_CONFIG_PAD:
+ format->format.code = MEDIA_BUS_FMT_FIXED;
break;
}
--- a/include/uapi/linux/media-bus-format.h
+++ b/include/uapi/linux/media-bus-format.h
@@ -175,18 +175,4 @@
/* Sensor ancillary metadata formats - next is 0x7002 */
#define MEDIA_BUS_FMT_SENSOR_DATA 0x7002
-/* PiSP Formats */
-#define MEDIA_BUS_FMT_PISP_COMP1_RGGB 0x8001
-#define MEDIA_BUS_FMT_PISP_COMP1_GRBG 0x8002
-#define MEDIA_BUS_FMT_PISP_COMP1_GBRG 0x8003
-#define MEDIA_BUS_FMT_PISP_COMP1_BGGR 0x8004
-#define MEDIA_BUS_FMT_PISP_COMP2_RGGB 0x8005
-#define MEDIA_BUS_FMT_PISP_COMP2_GRBG 0x8006
-#define MEDIA_BUS_FMT_PISP_COMP2_GBRG 0x8007
-#define MEDIA_BUS_FMT_PISP_COMP2_BGGR 0x8008
-
-#define MEDIA_BUS_FMT_PISP_FE_CONFIG 0x8100
-#define MEDIA_BUS_FMT_PISP_FE_STATS 0x8101
-#define MEDIA_BUS_FMT_PISP_BE_CONFIG 0x8200
-
#endif /* __LINUX_MEDIA_BUS_FORMAT_H */