imx8qm mipi csi raw12 Data Storage Problem

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

imx8qm mipi csi raw12 Data Storage Problem

3,701 Views
zoro_li
Contributor I

Now I can get the RAW12 data on IMX8QM

Use this way : sensor -> mipi csi (raw12) -> isi (raw16) -> user

But I found that data seems to have problems.

For example, Sensor raw data is 0x1234, but I get 0x3412,higher and low bytes have an interchange。

How can I modify to solve this problem?

 

0 Kudos
Reply
7 Replies

3,687 Views
joanxie
NXP TechSupport
NXP TechSupport

for imx8qm ISI, you need to shift,

• RAW10 {valid_data, 4’b0} . After right shift 4 bits, you will get the correct image.
• RAW12 {valid_data, 2'b0} . After right shift 2 bits, you will get the correct image.

 

0 Kudos
Reply

3,685 Views
zoro_li
Contributor I

hi  joanxie:

      Thanks for your replay.

      Now my way is to swap high and low bytes and then right shift 2 bits to get correct image.

      I don't know why I need to exchange high and low bytes of data here.

      I feel that there are some problems here.

0 Kudos
Reply

3,163 Views
chendd14
Contributor II

hi zoro_li,

I swaped the high and low bytes, and right shifted 2 bits, then I applied debayering with OpenCV cvtColor(..., ..., cv::COLOR_BayerBG2BGR). After that, I got a gray image., not a colorful one.

Would you please help me find out the problem?

Sensor: IMX577

0 Kudos
Reply

3,678 Views
joanxie
NXP TechSupport
NXP TechSupport

you need to set 16bits as format, then shift two bits to get correct data, ISI doesn't have exchange issue, you need check your source code

 

 

0 Kudos
Reply

3,676 Views
zoro_li
Contributor I

hi:

   My input and output configuration is as follows, is there any problem?

output:

 

 

       {
+               .name           = "SBGGR12",
+               .fourcc         = V4L2_PIX_FMT_SBGGR12,
+               .depth          = { 16 },
+               .color          = MXC_ISI_OUT_FMT_RAW16,
+               .memplanes      = 1,
+               .colplanes      = 1,
+               .mbus_code      = MEDIA_BUS_FMT_SBGGR12_1X12,
        }

 

 

input:

 

 

{
+ .name = "SBGGR12",
+ .fourcc = V4L2_PIX_FMT_SBGGR12,
+ .depth = { 16 },
+ .memplanes = 1,
+ .colplanes = 1,
}

 

 

 

0 Kudos
Reply

3,618 Views
joanxie
NXP TechSupport
NXP TechSupport

which file did you set this? is it the ISI file?

0 Kudos
Reply

3,536 Views
zoro_li
Contributor I

drivers/staging/media/imx/imx8-isi-cap.c

0 Kudos
Reply