Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Analysis of display driver of Quan Zhi T3 Linux

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

1. Overall architecture

The display framework of the Quanzhi T3 processor is based on the standard Linux frame buffer architecture, and its structure is shown in figure 1.1. The driver architecture of the display controller DE is shown in figure 1.2. it includes a display management abstraction layer shielding differences, as well as display layer drivers, display device drivers, backlight drivers, enhance drivers and capture drivers.

Figure 1.1 frame buffer device driver structure

Figure 1.2 shows the controller driver architecture

2. Key data structures

The overall structure of the display driver information disp_drv_info is shown in listing 2.1.It contains all the relevant information about the display driver.

Program listing 2.1

Typedef struct {struct device * dev; uintptr_t reg_ BaseDISP _ MOD_NUM]; U32 irq_ no [DISP _ MOD_NUM]; struct clk * MCLK [DISP _ MOD_NUM]; disp_init_para disp_init; struct disp_manager * MGR [DISP _ SCREEN_NUM] Struct disp_eink_manager * eink_manager [1]; struct proc_list sync_proc_list; struct proc_list sync_finish_proc_list; struct ioctl_list ioctl_extend_list; struct ioctl_list compat_ioctl_extend_list; struct standby_cb_list stb_cb_list; struct mutex mlock Struct work_struct resume_ work [DISP _ SCREEN_NUM]; struct work_struct start_work; U32 exit_mode;//0:clean all 1:disable interrupt bool bounded lcd _ enabled [DISP _ SCREEN_NUM]; bool inited / / indicate driver if init disp_bsp_init_para para;#if defined (CONFIG_ION_SUNXI) struct ion_client * client; struct ion_handle * handle;#endif} disp_drv_info

Struct disp_manager is the data structure of the management abstraction layer, and you can see the relevant operation interfaces including device driver, smbl driver, enhance driver, cptr driver, layer driver and management layer driver, and disp_drv_info contains members of struct disp_manager type.

Program listing 2.2

Struct disp_manager {/ * data fields * / char name [32]; U32 disp; U32 num_chns; U32 num_layers; struct disp_device * device; struct disp_smbl * smbl; struct disp_enhance * enhance; struct disp_capture * cptr; struct list_head lyr_list; # ifdef SUPPORT_WB wait_queue_head_t write_back_queue U32 write_back_finish; # endif / * function fields * / S32 (* enable) (struct disp_manager * mgr); S32 (* sw_enable) (struct disp_manager * mgr); S32 (* disable) (struct disp_manager * mgr); S32 (* is_enabled) (struct disp_manager * mgr); S32 (* blank) (struct disp_manager * mgr, bool blank) / * init: clock init & & reg init & & register irq * exit: clock exit & & unregister irq * / S32 (* init) (struct disp_manager * mgr); S32 (* exit) (struct disp_manager * mgr); S32 (* set_back_color) (struct disp_manager * mgr, struct disp_color * bk_color) S32 (* get_back_color) (struct disp_manager * mgr, struct disp_color * bk_color); S32 (* set_color_key) (struct disp_manager * mgr, struct disp_colorkey * ck); S32 (* get_color_key) (struct disp_manager * mgr, struct disp_colorkey * ck); S32 (* get_screen_size) (struct disp_manager * mgr, U32 * width, U32 * height) S32 (* set_screen_size) (struct disp_manager * mgr, U32 width, U32 height); S32 (* get_clk_rate) (struct disp_manager * mgr); / * layer mamage * / S32 (* check_layer_zorder) (struct disp_manager * mgr, struct disp_layer_config * config, U32 layer_num) S32 (* set_layer_config) (struct disp_manager * mgr, struct disp_layer_config * config, unsigned int layer_num); S32 (* force_set_layer_config) (struct disp_manager * mgr, struct disp_layer_config * config, unsigned int layer_num); S32 (* force_set_layer_config_exit) (struct disp_manager * mgr) S32 (* get_layer_config) (struct disp_manager * mgr, struct disp_layer_config * config, unsigned int layer_num); S32 (* extend_layer_config) (struct disp_manager * mgr, struct disp_layer_config * info, unsigned int layer_num); S32 (* set_output_color_range) (struct disp_manager * mgr, U32 color_range); S32 (* get_output_color_range) (struct disp_manager * mgr) S32 (* update_color_space) (struct disp_manager * mgr); S32 (* apply) (struct disp_manager * mgr); S32 (* force_apply) (struct disp_manager * mgr); S32 (* update_regs) (struct disp_manager * mgr); S32 (* sync) (struct disp_manager * mgr); S32 (* tasklet) (struct disp_manager * mgr) / * debug interface, dump manager info * / S32 (* dump) (struct disp_manager * mgr, char * buf);}

3. Display driver initialization process

The overall initialization process of the display driver is shown in figure 3.1. therefore, for the platform device registered as Linux, the initialization entry is disp_probe. In disp_probe, we first get some parameters related to the display driver from dtb, such as register base address, interrupt number, clock and so on, and then call the disp_init interface. Disp_init interface mainly initializes some system-related parameters and interfaces, display controller DE driver initialization (bsp_disp_init), LCD device initialization, fb cache initialization, and finally starts the display through start_process.

Figure 3.1 shows the overall process of driver initialization

Figure 3.2 shows controller driver initialization

Bsp_disp_init completes the driver initialization of the display controller DE, and the main actions are shown in figure 3.2:

Initialize the init_para parameter in the global variable gdisp

Initialize the default parameters for the display controller DE

Tasklet handling function in hanging interrupt handling

Set the display print level

Initialize the abstract layer driver of the display controller DE

Initialize the lcd device abstract driver for the display controller DE

Initialize the management driver of the display controller DE

Initialize the enhance driver for the display controller DE

Initialize the backlight control driver of the display controller DE

Initialize the capture driver for the display controller DE

The management layer driver is associated with abstract layer, lcd device driver, enhance driver, backlight control driver and capture driver.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report