drivers: media: rp1_cfe: Remove PISP specific MBUS formats
authorNaushir Patuck <naush@raspberrypi.com>
Tue, 10 Oct 2023 11:41:15 +0000 (12:41 +0100)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:35:05 +0000 (11:35 +0000)
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>
drivers/media/platform/raspberrypi/rp1_cfe/cfe_fmts.h
drivers/media/platform/raspberrypi/rp1_cfe/pisp_fe.c
include/uapi/linux/media-bus-format.h

index 972336d..adc2ced 100644 (file)
@@ -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,
        },
 };
index 31fb860..9b5531d 100644 (file)
@@ -404,7 +404,7 @@ static int pisp_fe_init_cfg(struct v4l2_subdev *sd,
 
        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_subdev *sd,
 
        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 v4l2_subdev *sd,
 
                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;
        }
 
index 99e6a14..7fbeb5a 100644 (file)
 /* 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 */