AnsweredAssumed Answered

i.MX8M Mini MIPI CSI RGB888

Question asked by Bernhard Wörndl-Aichriedler on Apr 28, 2020
Latest reply on Jul 7, 2020 by Joan Xie

Hi guys,

 

I'm just working on a project, that requires support for RGB888 video data over the i.MX8's CSI interface.

 

Unfortunately the current drivers don't support RGB888 data, so I tried to add support to the kernel.

 

What I did:
1. Modified mx6s_capture.c to add support for  RGB888

, {
        .name       = "RGB24 (RGB24)",
        .fourcc     = V4L2_PIX_FMT_RGB24,
        .pixelformat    = V4L2_PIX_FMT_RGB24,
        .mbus_code  = MEDIA_BUS_FMT_RBG888_1X24,
        .bpp        = 3,
    }

...

    case V4L2_PIX_FMT_YUV32:
    case V4L2_PIX_FMT_SBGGR8:
    case V4L2_PIX_FMT_RGB24:
        width = pix->width;
        break;

...

        case V4L2_PIX_FMT_RGB24:
            cr18 |= BIT_MIPI_DATA_FORMAT_RGB888;
            break;

 

2.Modified mxc_mipi_csi.c to add format support

, {
        .code = MEDIA_BUS_FMT_RBG888_1X24,
        .fmt_reg = MIPI_CSIS_ISPCFG_FMT_RGB24,
        .data_alignment = 32,
    }

 

With the 24bit RGB888 format, the MIPI CSI controller should switch to 32-bit mode, using a 32bit databus instead of a 16bit bus between MIPI CSI and the CSI bridge. 

 

Unfortunately this doesn't seem work and I fail to get all the bytes correctly.
Either I get complete bs or in some constellations the green channel is correct, while blue and red are messed up.

 

Here is a quick example:

Transmitted:    55CCF0 AA330F 55CCF0 AA330F ...
Received:        EA3343 EA3343  EA3343 EA3343 ...

 

Has anybody used the RGB888 24-bit mode of the CPU or any compatible CPU?

Outcomes