RAW8/GREY image from MIPI CSI sensor has displacements to right

cancel
Showing results for 
Search instead for 
Did you mean: 

RAW8/GREY image from MIPI CSI sensor has displacements to right

461 Views
greivin_fallas
Contributor II

Hi all,
I am facing a bit strange issue while capturing on RAW8 i.MX6Quad.
Actually, I am working with a Dart i.MX6 Evaluation Kit board and 2 sensors (OV5640 and OV9281) both cameras on RAW8 mode.

At first, I got timeout issues when trying to capture but that message was fixed after adding support to V4L2_PIX_FMT_GREY and IPU_PIX_FMT_GREY on IPU/v4l2_capture related files according to some post on this forum. Currently using V4L2_PIX_FMT_GREY format on the drivers to manage the RAW8 data, for some reason I still get the timeout message if I try to use BAYER data format V4L2_PIX_FMT_SRGGB8.

I can get a constant 60fps with OV9281 and 30 FPS with OV5640 using V4L2 utils but the images have a strange displacement of 64 extra bytes each 5 lines (for OV9281)  and each 14 lines (for OV5640).

I am not sure why this is happening, the MIPI was configured to 2 lanes, RAW8 data type and MIPI CLK range for 400 Mhz.

This is the issue on OV9281

ov9281-1280x800.png

This is the test pattern.

ov9281-test-pattern.png

Any help to understand this issue will be really appreciated.
Just in case, I am working with kernel version 4.9.88 Yocto Sumo.

Thanks.

Labels (3)
0 Kudos
2 Replies

160 Views
greivin_fallas
Contributor II

Hi all,

After contacting OmniVision's support, the issue was related to a register configuration that was not properly set on the RAW8 table mode.

160 Views
jamesbone
NXP TechSupport
NXP TechSupport

In capture driver mx6s_capture.c, RAW8 data can be captured. see below. But the data with RAW8 is not handled. so your image was not normally displayed.

 

static int mx6s_configure_csi(struct mx6s_csi_dev *csi_dev)

{

....

    if (csi_dev->csi_mipi_mode == true) {
        cr1 = csi_read(csi_dev, CSI_CSICR1);
        cr1 &= ~BIT_GCLK_MODE;
        csi_write(csi_dev, cr1, CSI_CSICR1);

        cr18 = csi_read(csi_dev, CSI_CSICR18);
        cr18 &= ~BIT_MIPI_DATA_FORMAT_MASK;
        cr18 |= BIT_DATA_FROM_MIPI;

        switch (csi_dev->fmt->pixelformat) {
        case V4L2_PIX_FMT_UYVY:
        case V4L2_PIX_FMT_YUYV:
            cr18 |= BIT_MIPI_DATA_FORMAT_YUV422_8B;
            break;
        case V4L2_PIX_FMT_SBGGR8:
            cr18 |= BIT_MIPI_DATA_FORMAT_RAW8;

            break;
        default:
            pr_debug("   fmt not supported\n");
            return -EINVAL;
        }

      csi_write(csi_dev, cr18, CSI_CSICR18);

....

}

0 Kudos