Supporting RGB888 CSI source

I have CSI source of RGB888 with pixel order R, G and B (the original source is DSI that I convert it to CSI, in DSI the pixel order is R, G and B and not B, G and R like in CSI)
I’ve managed to output the video from the CSI source to a display using V4L2 that automatically converts it to AR24.
My problem id that the blue and red color are swapped because of the difference of the pixel order of the RGB888.
Is there a way to send the data to display with swapping the pixel order to R, G, B
Aharon Shpigel

Looks like there’s no this kind of convert. You may implement from by software by yourself.

Getting into details I have added (in camera_common.c)

And (in sensor_common.c).
else if (strncmp(pixel_t, “rgb3”, size) == 0)
*format = V4L2_PIX_FMT_RGB24;
else if (strncmp(pixel_t, “bgr3”, size) == 0)
*format = V4L2_PIX_FMT_BGR24;

In the dtsi file when choosing rgb3 or bgr3 , the results are the same …
Any suggestion on what and where could/should be changes to “swap” between R and B…

What’s if configure the output source from RGB to BGR?

How to do it?

I don’t know you need to configure with the device vendor.

Now I understand you meant to change it at the CSI source.
I cant do it.
My question is where in the SW (at the Xavier) I need to change in order to do the swap

The VI driver(vi5_fops.c) will send cfg to rtcpu firmware to configure the REG VI_CHn PIXFMT_FORMAT_0

You can check the REG from TRM download from download center.

Can you please elaborate on that ?

  1. looked at the file vi5_fops.c
  2. did no find anything related to REG VI_CHn PIXFMT_FORMAT_0

You can check the REG from TRM download from download center

Can you please point me out in a direction… this is to vague for me…

As I said vi5_fops.c send msg to rtcpu to configure those REG. You just need to confirm the pixel format value in the msg.

Looking at vi5.formats.h
I saw

TEGRA_VIDEO_FORMAT(RGB888, 24, RGB888_1X24, 4, 1, T_A8R8G8B8,
RGB888, ABGR32, “BGRA-8-8-8-8”),
TEGRA_VIDEO_FORMAT(RGB888, 24, BGR888_1X24, 4, 1, T_A8B8G8R8,
RGB888, ABGR32, “BGRA-8-8-8-8”),

So how can I choose one or the other ?

You can check the REG from TRM download from download center.

Again can you point me out here … how to check/ where is TRM ?

Download it from the download center.

Can you please be more specific … ( a URL for example will be nice ).
Again What do you mean by sayin TRM ?
Where in the download center to download what ?
Can you point me something to read ?

Download it from the download center.

What is “it” a url will be nice , I will understand what it refers to …

Xavier Series SoC Technical Reference Manual