The list of supported formats comes from helpers shared with the i.MX6 IPUv3 and is incorrect in multiple regards: - 10-, 12- and 14-bit Bayer formats are stored in memory as SBGGR10, SBGGR12 and SBGGR14 respectively (plus components permutations), not SBGGR16. Same thing for greyscale formats. - 16-bit RAW formats are not supported by the hardware. Fix the supported formats table. Signed-off-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx> --- drivers/staging/media/imx/imx7-media-csi.c | 106 ++++++++++++--------- 1 file changed, 61 insertions(+), 45 deletions(-) diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c index 0fb5e0c03396..1bb60f245861 100644 --- a/drivers/staging/media/imx/imx7-media-csi.c +++ b/drivers/staging/media/imx/imx7-media-csi.c @@ -846,56 +846,64 @@ static const struct imx7_csi_pixfmt pixel_formats[] = { .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_SRGGB8_1X8), .bpp = 8, }, { - .fourcc = V4L2_PIX_FMT_SBGGR16, - .codes = IMX_BUS_FMTS( - MEDIA_BUS_FMT_SBGGR10_1X10, - MEDIA_BUS_FMT_SBGGR12_1X12, - MEDIA_BUS_FMT_SBGGR14_1X14, - MEDIA_BUS_FMT_SBGGR16_1X16 - ), - .bpp = 16, - }, { - .fourcc = V4L2_PIX_FMT_SGBRG16, - .codes = IMX_BUS_FMTS( - MEDIA_BUS_FMT_SGBRG10_1X10, - MEDIA_BUS_FMT_SGBRG12_1X12, - MEDIA_BUS_FMT_SGBRG14_1X14, - MEDIA_BUS_FMT_SGBRG16_1X16 - ), - .bpp = 16, - }, { - .fourcc = V4L2_PIX_FMT_SGRBG16, - .codes = IMX_BUS_FMTS( - MEDIA_BUS_FMT_SGRBG10_1X10, - MEDIA_BUS_FMT_SGRBG12_1X12, - MEDIA_BUS_FMT_SGRBG14_1X14, - MEDIA_BUS_FMT_SGRBG16_1X16 - ), - .bpp = 16, - }, { - .fourcc = V4L2_PIX_FMT_SRGGB16, - .codes = IMX_BUS_FMTS( - MEDIA_BUS_FMT_SRGGB10_1X10, - MEDIA_BUS_FMT_SRGGB12_1X12, - MEDIA_BUS_FMT_SRGGB14_1X14, - MEDIA_BUS_FMT_SRGGB16_1X16 - ), + .fourcc = V4L2_PIX_FMT_SBGGR10, + .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_SBGGR10_1X10), + .bpp = 16, + }, { + .fourcc = V4L2_PIX_FMT_SGBRG10, + .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_SGBRG10_1X10), + .bpp = 16, + }, { + .fourcc = V4L2_PIX_FMT_SGRBG10, + .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_SGRBG10_1X10), + .bpp = 16, + }, { + .fourcc = V4L2_PIX_FMT_SRGGB10, + .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_SRGGB10_1X10), + .bpp = 16, + }, { + .fourcc = V4L2_PIX_FMT_SBGGR12, + .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_SBGGR12_1X12), + .bpp = 16, + }, { + .fourcc = V4L2_PIX_FMT_SGBRG12, + .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_SGBRG12_1X12), + .bpp = 16, + }, { + .fourcc = V4L2_PIX_FMT_SGRBG12, + .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_SGRBG12_1X12), + .bpp = 16, + }, { + .fourcc = V4L2_PIX_FMT_SRGGB12, + .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_SRGGB12_1X12), + .bpp = 16, + }, { + .fourcc = V4L2_PIX_FMT_SBGGR14, + .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_SBGGR14_1X14), + .bpp = 16, + }, { + .fourcc = V4L2_PIX_FMT_SGBRG14, + .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_SGBRG14_1X14), + .bpp = 16, + }, { + .fourcc = V4L2_PIX_FMT_SGRBG14, + .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_SGRBG14_1X14), + .bpp = 16, + }, { + .fourcc = V4L2_PIX_FMT_SRGGB14, + .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_SRGGB14_1X14), .bpp = 16, }, { .fourcc = V4L2_PIX_FMT_GREY, - .codes = IMX_BUS_FMTS( - MEDIA_BUS_FMT_Y8_1X8, - MEDIA_BUS_FMT_Y10_1X10, - MEDIA_BUS_FMT_Y12_1X12 - ), + .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_Y8_1X8), .bpp = 8, }, { .fourcc = V4L2_PIX_FMT_Y10, - .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_Y10_1X10), + .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_Y10_1X10), .bpp = 16, }, { .fourcc = V4L2_PIX_FMT_Y12, - .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_Y12_1X12), + .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_Y12_1X12), .bpp = 16, }, }; @@ -2015,10 +2023,18 @@ static int imx7_csi_pad_link_validate(struct v4l2_subdev *sd, case V4L2_PIX_FMT_SGBRG8: case V4L2_PIX_FMT_SGRBG8: case V4L2_PIX_FMT_SRGGB8: - case V4L2_PIX_FMT_SBGGR16: - case V4L2_PIX_FMT_SGBRG16: - case V4L2_PIX_FMT_SGRBG16: - case V4L2_PIX_FMT_SRGGB16: + case V4L2_PIX_FMT_SBGGR10: + case V4L2_PIX_FMT_SGBRG10: + case V4L2_PIX_FMT_SGRBG10: + case V4L2_PIX_FMT_SRGGB10: + case V4L2_PIX_FMT_SBGGR12: + case V4L2_PIX_FMT_SGBRG12: + case V4L2_PIX_FMT_SGRBG12: + case V4L2_PIX_FMT_SRGGB12: + case V4L2_PIX_FMT_SBGGR14: + case V4L2_PIX_FMT_SGBRG14: + case V4L2_PIX_FMT_SGRBG14: + case V4L2_PIX_FMT_SRGGB14: break; default: -- Regards, Laurent Pinchart