Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What are the basic components of Linux DRM

Shulou Source: shulou.com Published: 2022-06-01 21:12:41 10月03日 Update

This article introduces the relevant knowledge of "what are the basic components of Linux DRM". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

1. Basic components of DRM

The Linux kernel DRM framework includes: GEM and KMS. Cite web pictures to show the general framework of DRM:

1 、 GEM

GEM (Graphic Execution Manager): graphics execution manager, mainly for the management of FrameBuffer, such as memory request, release, sharing and synchronization (memory between GPU and CPU) mechanism.

Common Buffer for GEM includes:

1) Dumb Buffer: it is implemented based on cma api and only supports continuous physical memory. It is used in simple scenarios with low resolution.

2) Prime Buffer: buffer sharing mechanism based on dma-buf, which supports continuous and discontinuous physical memory, and is used in complex scenarios with large memory.

2 、 KMS

KMS (Kernel Mode Setting): kernel display mode settings, main elements: Framebuffer, Plane, CRTC, Encoder, Connector. See the following figure:

1) Framebuffer: the content of a single layer can be accessed by both the application layer and the kernel.

2) Plane: hardware layer, which can realize multi-layer composite display and connect FB and CRTC. Including: Primary, Overlay and Cursor, at least one Plane is implemented in the driver.

3) CRTC: scan the memory Buffer and convert it into LCDC Timing signal.

4) Encoder: convert the LCDC Timing timing of CRTC output into the interface timing required by the display screen.

5) Connector: corresponding display interface (HDMI, MIPI DSI, LVDS, etc.) driver and output device status information (EDID, hot plug, etc.).

The RockPI 4 DRM driver is actually about learning the implementation and usage of the above elements.

2. RockPI 4 DRM driver file

RockPI 4 veneer uses RK3399 chip.

Download the kernel code of Debian system at https://wiki.radxa.com/Rockpi4/dev/Debian.

RK3399 DRM follow file:

1. Kernel documentation

Path: Documentation/devicetree/bindings/display/rockchip.

2. Driver code

Path: drivers/gpu/drm/rockchip. The files and implementation functions involved are as follows:

1) driver file

Root@ubuntu:/home/run/code/rockchip-bsp/kernel/drivers/gpu/drm/rockchip# lsanalogix_dp-rockchip.c cdn-dp-reg.c inno_hdmi.c rk3066_hdmi.c rockchip_drm_backlight.h rockchip_drm_fbdev.c rockchip_drm_gem.h rockchip_drm_vop.h rockchip_vop_reg.ccdn-dp-core.c cdn-dp-reg.h inno_hdmi.h rk3066 _ hdmi.h rockchip_drm_drv.c rockchip_drm_fbdev.h rockchip_drm_tve.c rockchip_lvds.c rockchip_vop_reg.hcdn-dp-core.h dw_hdmi-rockchip.c Kconfig rk618 rockchip_drm_drv.h rockchip_drm_fb.h rockchip_drm_tve.h rockchip_lvds.hcdn-dp-link-training.c dw -mipi-dsi.c Makefile rockchip_drm_backlight.c rockchip_drm_fb.c rockchip_drm_gem.c rockchip_drm_vop.c rockchip_rgb.c

2) implement the function

Implement function file names Core Driverrockchip_drm_drv.cGEM Driverrockchip_drm_gem.cFramebuffer Driverrockchip_drm_fb.c, rockchip_drm_fbdev.cVOP Driverrockchip_drm_vop.c, rockchip_vop_reg.cHDMI Driverdw_hdmi-rockchip.cinno HDMI Driverinno_hdmi.cLVDS Driverrockchip_lvds.cMIPI Driverdw-mipi-dsi.cTVE Driverrockchip_drm_tve.ceDP Driveranalogix_dp-rockchip.cDP Drivercdn-dp-reg.c, cdn-dp-core.c, Cdn-dp-link-training.cRGB Driverrockchip_rgb.cBacklight Driverrockchip_drm_backlight.crk618 bridge Driverrk618/RK3066 HDMI Driverrk3066_hdmi.c

Note: Core, GEM, FB and VOP drivers are required. Choose the corresponding interface driver or backlight driver according to the interface type of the veneer connection screen.

At present, there is only the display screen of HDMI line and HDMI interface, and only the HDMI display driver is introduced later.

This is the end of the content of "what are the basic components of Linux DRM". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Driver kernel interface file memory component content function display screen output code element veneer scene timing more mechanism framework physics knowledge Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Docker Apple macOS Microsoft