IMX7 CSI MIPI: RAW12 Support

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMX7 CSI MIPI: RAW12 Support

919 Views
sudarkb
Contributor II

Hi All,

We are trying to support the RAW12 MIPI Camera sensor in our custom board which has iMX7 processor. We were successful in RAW8 and RAW10 support but we are facing some data loss issues in the RAW12 support which causes some artefacts in the output image. We have tried playing with the PIXEL_BIT and TWO_8BIT_SENSOR bits but nothing seems to work. sample images are shown below.

Image 1Image 1Image 2Image 2

The Kernel snippet for the 12 Bit support is as below:

File: drivers/media/platform/mxc/subdev/mx6s_capture.c
+#define BIT_MIPI_DATA_FORMAT_RAW12 (0x2c << 25)
static struct mx6s_fmt formats[] = {
+{
+.name = "RAWRGB12 (SGRBG12)",
+.fourcc = V4L2_PIX_FMT_SGRBG12,
+.pixelformat = V4L2_PIX_FMT_SGRBG12,
+.mbus_code = MEDIA_BUS_FMT_SGRBG12_1X12,
+.bpp = 2,
+}

static int mx6s_configure_csi(struct mx6s_csi_dev *csi_dev)
+case V4L2_PIX_FMT_SGRBG12:
+width = pix->width * 2;
+break;

cr1 &= ~BIT_GCLK_MODE;
+cr1 |= BIT_PIXEL_BIT;

+case V4L2_PIX_FMT_SGRBG12:
+cr18 |= BIT_MIPI_DATA_FORMAT_RAW12;


File: drivers/media/platform/mxc/subdev/mxc_mipi_csi.c

csis_pix_format mipi_csis_formats[] =
{
+.code = MEDIA_BUS_FMT_SGRBG12_1X12,
+.fmt_reg = MIPI_CSIS_ISPCFG_FMT_RAW12,
+.data_alignment = 16,
+}

Kindly, guide me in solving this issue.

Regards,
Sudar.K.B.

Labels (1)
0 Kudos
Reply
1 Reply

841 Views
jimmychan
NXP TechSupport
NXP TechSupport

i think you may have read this. Seems you already have tried different settings.

https://community.nxp.com/t5/i-MX-Processors/Confirmed-support-for-RAW12-through-4-lane-CSI-2-sensor...

 

Which camera are you using? Maybe the noise is from the camera side.

 

0 Kudos
Reply