MIPI CSI2 RAW10 which V4L2 pixel format?

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

MIPI CSI2 RAW10 which V4L2 pixel format?

5,617 Views
joachimjaehn
Contributor III

I have a gray scale Image Sensor with SubLVDS. I use e Lattis FPGA to convert the SubLVDS to MIPI CSI2. The MIPI signal is connected to an imx6. I configure the sensor to 10Bit and the FPGA to RAW10. Now i write a V4L2 modul.

I configure the MIPI with "mipi_csi2_set_datatype(mipi_csi2_info,MIPI_DT_RAW10);" to RAW10. 

In Userspace i need image Data with 10 bit gray scale saved in 16bit Array.

there is a chapter "40.5.15 RAW10 Data Reception" in IMX6DQRM.pdf

http://cache.freescale.com/files/32bit/doc/ref_manual/IMX6DQRM.pdf

"The RAW10 data format the byte to 32-bit memory word mapping follows the generic
CSI-2 rule."

Which Pixelformat i need for "sensor_data.pix.pixelformat" to get correct data from MIPI CSI2?

how i can convert the image data? 

Labels (4)
0 Kudos
Reply
2 Replies

3,033 Views
joachimjaehn
Contributor III

Hi Igor,

i fond this Pixelformats in videodev2.h:

/* 10bit raw bayer packed, 5 bytes for every 4 pixels */
#define V4L2_PIX_FMT_SBGGR10P v4l2_fourcc('p', 'B', 'A', 'A')
#define V4L2_PIX_FMT_SGBRG10P v4l2_fourcc('p', 'G', 'A', 'A')
#define V4L2_PIX_FMT_SGRBG10P v4l2_fourcc('p', 'g', 'A', 'A')
#define V4L2_PIX_FMT_SRGGB10P v4l2_fourcc('p', 'R', 'A', 'A')

and the bit order at this Link 

V4L2_PIX_FMT_SRGGB10P ('pRAA'), V4L2_PIX_FMT_SGRBG10P ('pgAA'), V4L2_PIX_FMT_SGBRG10P ('pGAA'), V4L2... 

this is the right bit order. now i have a problem. There is no implementations of 10bit raw bayer packed in my kernel files. 

mxc_v4l2_capture.c

/*!
* Indicates whether the palette is supported.
*
* @param palette V4L2_PIX_FMT_RGB565, V4L2_PIX_FMT_BGR24 or V4L2_PIX_FMT_BGR32
*
* @return 0 if failed
*/
static inline int valid_mode(u32 palette)
{
return (
(palette == V4L2_PIX_FMT_RGB565) ||
(palette == V4L2_PIX_FMT_BGR24) ||
(palette == V4L2_PIX_FMT_RGB24) ||
(palette == V4L2_PIX_FMT_BGR32) ||
(palette == V4L2_PIX_FMT_RGB32) ||
(palette == V4L2_PIX_FMT_YUV422P) ||
(palette == V4L2_PIX_FMT_UYVY) ||
(palette == V4L2_PIX_FMT_YUYV) ||
(palette == V4L2_PIX_FMT_YUV420) ||
(palette == V4L2_PIX_FMT_YVU420) ||
(palette == V4L2_PIX_FMT_NV12)) ||
(palette == V4L2_PIX_FMT_GREY) || /* Enabling the 8-bit greyscale pixelformat*/
(palette == V4L2_PIX_FMT_Y10); /* Enabling the 10-bit greyscale pixelformat*/
}

0 Kudos
Reply

3,033 Views
igorpadykov
NXP Employee
NXP Employee

Hi joachim

IPU can receive bayer format from CSI port as generic data, but
IPU don't make Bayer conversion and IPU (IC, DP, DC and etc) doesn't
recognize bayer as a valid image format.
You will need to use some graphics library/API like gstreamer, ffmpeg and
others to make this conversion using the CPU. Please also check
https://community.nxp.com/thread/357122

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------