RK3588 MIPIRX receives RGB888/RGB565/RGB666 debugging

This article shares the debugging experience of using the RK3588 platform to receive RGB data through the MIPI interface.

(1 Introduction

The MIPIRX of RK3588 is generally used in MIPI camera scenarios, but there are also requirements for HDMIIN or DPIN. You can use an adapter chip to convert HDMI into MIPI or DP signals into MIPI for the MIPIRX interface of RK3588 to realize the function of HDMIIN in camera scenarios. The more commonly used ones are RAW data input or YUV422 input. The adapter chip scene generally uses the YUV422 format. However, if the source image is RGB888, the adapter chip converts it into YUV422 and feeds it to the RK3588. There is a downsampling process, which is possible. It will cause the loss of UV color and cause some color shift problems. It is not friendly to some applications with relatively high color and image quality requirements. Therefore, it is necessary to consider the RGB source input to the adapter chip, and the adapter chip directly BYPASS to RK3588, RK3588 Whether image data can be received.

(2) RK3588 MIPIRX support capability

The VICAP module of RK3588 supports image storage. Because it is not raw data, it does not need to be processed by ISP, so you can directly use the VICAP module to store image data. VICAP specification support is as follows:

From the above, we can see that the VICAP of RK3588 does not support RGB888 input, but in terms of software processing, it can be received and stored as RAW8, but the output can only be BYPASS, and conversion or reorder operations cannot be performed.

(3) Driver adaptation and DTS configuration

①Adapter chip driver adaptation

For adapter chip or sensor drivers, you can refer to other sensor drivers, which are implemented based on the V4L2 framework. The main focus is:

1) Format configuration

The image format configuration is as follows. RGB888 needs to be configured as MEDIA_BUS_FMT_RGB888_1X24. Note here that the CSI format is generally BGR, and DSI is RGB.

2) Lane number configuration:

3) MIPI CLK configuration:

②MIPI-CSI configuration

It should be noted here that the MIPI-CSI HOST of RK3588 has its own DSI function, so it supports receiving DSI data, so it is necessary to distinguish whether it is DSI or CSI mode. Different modes require different configurations:

③VICAP configuration

1)data type

In VICAP driver configuration, you mainly need to pay attention to DSI or CSI. The data type corresponding to DSI needs to be configured differently. Configure the VICAP driver as follows:

2) Configuration of buf size, virtual width, etc.:

Configure according to RAW8:

(3) Capture and debug

Debugging command, use the following debugging command to capture RGB888 images, and use software such as 7YUV to preview.

v4l2-ctl --verbose -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat='RGB3' --stream-mmap=4

Guess you like

Origin blog.csdn.net/qq_34341546/article/details/132740761