diff mbox series

[v3,6/7] media: imx: imx-mipi-csis: Add BGR888

Message ID 20220221110436.45419-7-jacopo@jmondi.org (mailing list archive)
State New, archived
Headers show
Series media: imx: Destage imx7-mipi-csis | expand

Commit Message

Jacopo Mondi Feb. 21, 2022, 11:04 a.m. UTC
Add support for the BGR888_1X24 image formats.

No existing media bus codes describe exactly the way data is transferred
on the CSI-2 bus. This is not a new issue, the CSI-2 YUV422 8-bit format
is described by MEDIA_BUS_FMT_UYVY8_1X16 which is an arbitrary
convention and not an exact match. Use the MEDIA_BUS_FMT_BGR888_1X24 to
follow the same convention, based on the order in which bits are
transmitted over the CSI-2 bus.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/media/platform/imx/imx-mipi-csis.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Laurent Pinchart Feb. 21, 2022, 11:53 a.m. UTC | #1
Hi Jacopo,

Thank you for the patch.

On Mon, Feb 21, 2022 at 12:04:35PM +0100, Jacopo Mondi wrote:
> Add support for the BGR888_1X24 image formats.

s/formats/format/

> No existing media bus codes describe exactly the way data is transferred
> on the CSI-2 bus. This is not a new issue, the CSI-2 YUV422 8-bit format
> is described by MEDIA_BUS_FMT_UYVY8_1X16 which is an arbitrary
> convention and not an exact match. Use the MEDIA_BUS_FMT_BGR888_1X24 to
> follow the same convention, based on the order in which bits are
> transmitted over the CSI-2 bus.
> 
> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  drivers/media/platform/imx/imx-mipi-csis.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/media/platform/imx/imx-mipi-csis.c b/drivers/media/platform/imx/imx-mipi-csis.c
> index 46055b5f8412..a05ab151bebc 100644
> --- a/drivers/media/platform/imx/imx-mipi-csis.c
> +++ b/drivers/media/platform/imx/imx-mipi-csis.c
> @@ -365,6 +365,10 @@ static const struct csis_pix_format mipi_csis_formats[] = {
>  		.code = MEDIA_BUS_FMT_RGB565_1X16,
>  		.data_type = MIPI_CSI2_DATA_TYPE_RGB565,
>  		.width = 16,
> +	}, {
> +		.code = MEDIA_BUS_FMT_BGR888_1X24,
> +		.data_type = MIPI_CSI2_DATA_TYPE_RGB888,
> +		.width = 24,
>  	},
>  	/* RAW (Bayer and greyscale) formats. */
>  	{
diff mbox series

Patch

diff --git a/drivers/media/platform/imx/imx-mipi-csis.c b/drivers/media/platform/imx/imx-mipi-csis.c
index 46055b5f8412..a05ab151bebc 100644
--- a/drivers/media/platform/imx/imx-mipi-csis.c
+++ b/drivers/media/platform/imx/imx-mipi-csis.c
@@ -365,6 +365,10 @@  static const struct csis_pix_format mipi_csis_formats[] = {
 		.code = MEDIA_BUS_FMT_RGB565_1X16,
 		.data_type = MIPI_CSI2_DATA_TYPE_RGB565,
 		.width = 16,
+	}, {
+		.code = MEDIA_BUS_FMT_BGR888_1X24,
+		.data_type = MIPI_CSI2_DATA_TYPE_RGB888,
+		.width = 24,
 	},
 	/* RAW (Bayer and greyscale) formats. */
 	{