Encountered a problem using transparent background OSD in DRM driver

Description

I use LVGL on the ARM LINUX development board, and the graphics driver is DRM. On my hardware platform, DRM has two display planes, and LVGL has been successfully displayed on the upper plane. I want to display the video on the lower plane, so I need the LVGL on the upper plane to have a transparent background. But I cannot achieve this effect.

The display is correct without using a transparent background. If you use a transparent background, you will not be able to see the lower layer of the screen. The static controls of LVGL itself will also flash once when starting, and then disappear. Only dynamic controls (such as Spinner) will be displayed incompletely. Remember to try V8.3.6 version to see the lower layer of the screen, but the static controls still cannot be displayed. Simultaneously, the edge color of the dynamic control is abnormal

What MCU/Processor/Board and compiler are you using?

ROCKCHIP RV1126

What LVGL version are you using?

V8.3.10

What do you want to achieve?

The LVGL displayed on the upper layer has a transparent background。

What have you tried so far?

I have verified using the modetest tool that images can be displayed separately on two planes of DRM. I tried configuring it:

  • Set the screen’s opacity to LV_OPA_TRANSP e.g. with lv_obj_set_style_bg_opa(lv_scr_act(), LV_OPA_TRANSP, LV_PART_MAIN)

  • Set the display opacity to LV_OPA_TRANSP with lv_disp_set_bg_opa(NULL, LV_OPA_TRANSP);

LV_ COLOR_ DEPTH=32
LV_ COLOR_ SCREEN_ TRANSP=1

Code to reproduce

Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.

The code block(s) should be formatted like:

/*You code here*/

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.


DRM show two layers by modetest tool

无标题视频——使用Clipchamp制作

The problem has been resolved

modify drm_drivers

#define DRM_FOURCC DRM_FORMAT_XRGB8888 >>> DRM_FORMAT_ARGB8888

Discovering new faults

Transparent OSD layers can only use static UI. I have added dynamic UI (Spinner) and enabled FPS and memory display, which will cause the static UI to flash briefly during startup and then not display, and the dynamic UI will flash irregularly (sometimes not displayed)

Transparent OSD layer display UI requires a timer to refresh the entire SCREEN in real time, otherwise dynamic UI will not be displayed. And the UI response is very slow, probably caused by global refresh

lv_hal_disp.c
driver->screen_transp = 0; >> driver->screen_transp = 1;