cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Observer
Observer
284 Views
Registered: ‎07-30-2019

Xilinx MIPI CSI-2 IP Support Video Format

Jump to solution

Hi Xilinx,

I want to know Xilinx MIPI CSI-2 IP Support Video Format: The wiki and PG say it supports YUV422 8bit. But based on your linux driver, there are only formats as below:

{ XVIP_VF_YUV_422, 8, NULL, MEDIA_BUS_FMT_UYVY8_1X16,
 1, 16, V4L2_PIX_FMT_NV16, 2, 1, 1, 1 },
 { XVIP_VF_YUV_422, 8, NULL, MEDIA_BUS_FMT_UYVY8_1X16,
 1, 16, V4L2_PIX_FMT_NV16M, 2, 2, 1, 1 },
 { XVIP_VF_YUV_422, 8, NULL, MEDIA_BUS_FMT_UYVY8_1X16,
 2, 16, V4L2_PIX_FMT_YUYV, 1, 1, 2, 1 },
 { XVIP_VF_VUY_422, 8, NULL, MEDIA_BUS_FMT_UYVY8_1X16,
 2, 16, V4L2_PIX_FMT_UYVY, 1, 1, 2, 1 },

 

https://github.com/Xilinx/linux-xlnx/blob/master/drivers/media/platform/xilinx/xilinx-vip.c

 

The probelm is : the camera only supports MEDIA_BUS_FMT_UYVY8_2X8.  How to solve it?

 

4.15.3.4.1.1.3. Packed YUV Formats

Those data formats transfer pixel data as (possibly downsampled) Y, U and V components. Some formats include dummy bits in some of their samples and are collectively referred to as “YDYC” (Y-Dummy-Y-Chroma) formats. One cannot rely on the values of these dummy bits as those are undefined.

The format code is made of the following information.

  • The Y, U and V components order code, as transferred on the bus. Possible values are YUYV, UYVY, YVYU and VYUY for formats with no dummy bit, and YDYUYDYV, YDYVYDYU, YUYDYVYD and YVYDYUYD for YDYC formats.
  • The number of bits per pixel component. All components are transferred on the same number of bits. Common values are 8, 10 and 12.
  • The number of bus samples per pixel. Pixels that are wider than the bus width must be transferred in multiple samples. Common values are 0.5 (encoded as 0_5; in this case two pixels are transferred per bus sample), 1, 1.5 (encoded as 1_5) and 2.
  • The bus width. When the bus width is larger than the number of bits per pixel component, several components are packed in a single bus sample. The components are ordered as specified by the order code, with components on the left of the code transferred in the high order bits. Common values are 8 and 16.

For instance, a format where pixels are encoded as 8-bit YUV values downsampled to 4:2:2 and transferred as 2 8-bit bus samples per pixel in the U, Y, V, Y order will be named MEDIA_BUS_FMT_UYVY8_2X8.

 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Xilinx Employee
Xilinx Employee
174 Views
Registered: ‎03-30-2016

Hello @analoglamb 

Talking with our Embedded-Linux expert just now. This is his input:
===
If the camera is connected to MIPI rx (through MIPI bus), it’s likely the format should be MEDIA_BUS_UYVY8_1X16. That means, the format in camera driver better use MEDIA_BUS_UYVY8_1X16, instead of changing to MEDIA_BUS_UYVY8_2X8 in xilinx-vip.c. Some recent open source discussion as reference: https://lkml.org/lkml/2020/5/26/200

If xilinx-vip.c still has to change for some reason, the corresponding entry with XVIP_VF_YUV422 in the table can change to MEDIA_BUS_UYVY8_2X8. But for above case, it’s not correct.
===


Thanks & regards
Leo

View solution in original post

4 Replies
Highlighted
Xilinx Employee
Xilinx Employee
261 Views
Registered: ‎03-30-2016

Hello @analoglamb 

This is Embedded-Linux question. Next time, Could you please post your question on this board:
https://forums.xilinx.com/t5/Embedded-Linux/bd-p/ELINUX

>I want to know Xilinx MIPI CSI-2 IP Support Video Format: The wiki and PG say it supports YUV422 8bit.

I am assuming you are using MIPI CSI-2 RX Subsystem.
Yes, your understanding is correct that YUV422 8bit is supported Data Format since YUV422 8-bit is a Primary Data Format.
Primary_DT_support.png

>The probelm is : the camera only supports MEDIA_BUS_FMT_UYVY8_2X8. How to solve it?

If you need to use this Media Bus Format, you need to add the format descriptor in the driver.
See also this post:
https://forums.xilinx.com/t5/Embedded-Linux/V4L2-YUV-4-2-0-Support/td-p/629281

Regards
Leo

0 Kudos
Highlighted
Observer
Observer
230 Views
Registered: ‎07-30-2019

Do you mean I can add it by myself in the vip.c, right? 

But the vip.c only supports xxx_1X16, Is xxx_2X8 OK?

    { XVIP_VF_YUV_422, 8NULL, MEDIA_BUS_FMT_UYVY8_2X8,
      216, V4L2_PIX_FMT_YUYV, 1121"4:2:2, packed, YUYV" },
0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
175 Views
Registered: ‎03-30-2016

Hello @analoglamb 

Talking with our Embedded-Linux expert just now. This is his input:
===
If the camera is connected to MIPI rx (through MIPI bus), it’s likely the format should be MEDIA_BUS_UYVY8_1X16. That means, the format in camera driver better use MEDIA_BUS_UYVY8_1X16, instead of changing to MEDIA_BUS_UYVY8_2X8 in xilinx-vip.c. Some recent open source discussion as reference: https://lkml.org/lkml/2020/5/26/200

If xilinx-vip.c still has to change for some reason, the corresponding entry with XVIP_VF_YUV422 in the table can change to MEDIA_BUS_UYVY8_2X8. But for above case, it’s not correct.
===


Thanks & regards
Leo

View solution in original post

Highlighted
Observer
Observer
90 Views
Registered: ‎07-30-2019

Thanks for your reply, 

Confirmed with ZCU102 board, The MIPI CSI2 RX should be 1X16, if it is 2X8, yavta can get the correct data,but v4l2-ctl does not.