In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "what is the Linux DRM kernel code?". In the operation of actual cases, many people will encounter such a dilemma. Then 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!
Linux DRM kernel code path: drivers/gpu/drm. Use the ls command to view the directory as follows:
Root@ubuntu:/home/run/code/rockchip-bsp/kernel/drivers/gpu/drm# lsamd drm_atomic.c drm_crtc_internal.h drm_fb_cma_helper.c drm_internal.h drm_modes.c drm_rect.c exynos mga rcar-du ttmarmada drm_atomic_helper.c drm_debugfs.c drm_fb_helper.c Drm_ioc32.c drm_modeset_lock.c drm_scatter.c fsl-dcu mgag200 rockchip udlast drm_auth.c drm_dma.c drm_flip_work.c drm_ioctl.c drm_of.c drm_scdc_helper.c gma500 msm savage vc4ati_pcigart.c drm_bridge.c drm_dp _ helper.c drm_fops.c drm_irq.c drm_panel.c drm_sync_helper.c i2c nouveau shmobile vgematmel-hlcdc drm_bufs.c drm_dp_mst_topology.c drm_gem.c drm_legacy.h drm_pci.c drm_sysfs.c i810 omapdrm sis viabochs Drm_cache.c drm_drv.c drm_gem_cma_helper.c drm_lock.c drm_plane_helper.c drm_trace.h i915 panel sti virtiobridge drm_context.c drm_edid.c drm_global.c drm_memory.c drm_platform.c drm_trace_points.c imx Qxl tdfx vmwgfxcirrus drm_crtc.c drm_edid_load.c drm_hashtab.c drm_mipi_dsi.c drm_prime.c drm_vma_manager.c Kconfig r128 tegradrm_agpsupport.c drm_crtc_helper.c drm_encoder_slave.c drm_info.c drm_mm.c drm_probe_helper.c drm _ vm.c Makefile radeon tilcdc
In the Linux kernel, the DRM code is compiled with the cooperation of Makefile, Kconfig and * defconfig files corresponding to SOC vendors. In the DRM driver, the main files involved are:
Drivers/gpu/Makefile
You can see in Makefile: obj-y + = drm/, indicates that the drm directory is compiled directly.
a. Small knowledge points:
Obj-y and obj-m are Makefile variables. After assigning values to these variables in Makefile, Kbuild automatically compiles the objects into the kernel or into modules.
Obj-y: means compiled into the kernel; obj-m: means compiled into a module.
The Linux kernel Kbuild system will be introduced later.
Drivers/gpu/drm/Makefile 、 Kconfig
The compilation of DRM core and SOC DRM driver is distinguished in Makefile.
1) some files corresponding to DRM core
Drm-y: = drm_auth.o drm_bufs.o drm_cache.o\ drm_context.o drm_dma.o\ drm_fops.o drm_gem.o drm_ioctl.o drm_irq.o\ drm_lock.o drm_memory.o drm_drv.o drm_vm.o\ drm_scatter.o drm_pci.o\ Drm_platform.o drm_sysfs.o drm_hashtab.o drm_mm.o\ drm_crtc.o drm_modes.o drm_edid.o\ drm_info.o drm_debugfs.o drm_encoder_slave.o\ drm_trace_points.o drm_global.o drm_prime.o\ drm_rect.o drm_ Vma_manager.o drm_flip_work.o\ drm_modeset_lock.o drm_atomic.o drm_bridge.o\ drm_sync_helper.o drm_scdc_helper.o
2) some files corresponding to SOC DRM driver
Obj-$ (CONFIG_DRM_TTM) + = ttm/obj-$ (CONFIG_DRM_R128) + = r128 objmuri $(CONFIG_HSA_AMD) + = amd/amdkfd/obj-$ (CONFIG_DRM_RADEON) + = radeon/obj-$ (CONFIG_DRM_AMDGPU) + = amd/amdgpu/obj-$ (CONFIG_DRM_MGA) + = mga/obj-$ (CONFIG_DRM_I810) + = i810 objmuri $(CONFIG_DRM_I915) + = i915 objmuri $(CONFIG_DRM) _ MGAG200) + = mgag200/obj-$ (CONFIG_DRM_VC4) + = vc4/obj-$ (CONFIG_DRM_CIRRUS_QEMU) + = cirrus/obj-$ (CONFIG_DRM_SIS) + = sis/obj-$ (CONFIG_DRM_SAVAGE) + = savage/obj-$ (CONFIG_DRM_VMWGFX) + = vmwgfx/obj-$ (CONFIG_DRM_VIA) + = via/obj-$ (CONFIG_DRM_VGEM) + = vgem/obj-$ (CONFIG_DRM_NOUVEAU) + = nouveau/obj-$ (CONFIG_) DRM_EXYNOS) + = exynos/obj-$ (CONFIG_DRM_ROCKCHIP) + = rockchip/obj-$ (CONFIG_DRM_GMA500) + = gma500/obj-$ (CONFIG_DRM_UDL) + = udl/obj-$ (CONFIG_DRM_AST) + = ast/obj-$ (CONFIG_DRM_ARMADA) + = armada/obj-$ (CONFIG_DRM_ATMEL_HLCDC) + = atmel-hlcdc/obj-$ (CONFIG_DRM_RCAR_DU) + = rcar-du/obj-$ (CONFIG_DRM_SHMOBILE) + = shmobile/obj-$ (CONFIG_DRM_OMAP) + = omapdrm/obj-$ (CONFIG_DRM_QXL) + = qxl/obj-$ (CONFIG_DRM_BOCHS) + = bochs/obj-$ (CONFIG_DRM_VIRTIO_GPU) + = virtio/obj-$ (CONFIG_DRM_MSM) + = msm/obj-$ (CONFIG_DRM_TEGRA) + = tegra/obj-$ (CONFIG_DRM_STI) + = sti/obj-$ (CONFIG_DRM_IMX) + = imx/
You can see the functions implemented by the corresponding folder in the Kconfig file in each folder. Take RK3399 as an example, in drivers/gpu/drm/rockchip/Kconfig:
Config DRM_ROCKCHIP tristate "DRM Support for Rockchip" depends on DRM depends on RESET_CONTROLLER select DRM_KMS_HELPER select DRM_KMS_FB_HELPER select DRM_PANEL select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select VIDEOMODE_HELPERS help Choose this option if you have a Rockchip soc chipset. This driver provides kernel mode setting and buffer management to userspace. This driver does not provide 2D or 3D acceleration; acceleration is performed by other IP found on the SoC.
For a brief description of non-SOC DRM driver in drivers/gpu/drm/, see the table below.
About folder introduction bridge interface conversion driver i2cI2C interface encoder or transmitter chip driver ttmGEM and TTM are two sets of non-hardware supported GEM services of DRM's memory management subsystem vgem
Drivers/gpu/drm/rockchip/Makefile 、 Kconfig
In the Makefile file, the RK3399 DRM driver is distinguished from the RK3399 driver with various interfaces (hdmi, lvds, dp, mipi, etc.), for example:
Rockchipdrm-y: = rockchip_drm_drv.o rockchip_drm_fb.o\ rockchip_drm_gem.o rockchip_drm_vop.orockchipdrm-$ (CONFIG_DRM_FBDEV_EMULATION) + = rockchip_drm_fbdev.oobj-$ (CONFIG_ROCKCHIP_DW_HDMI) + = dw_hdmi-rockchip.oobj-$ (CONFIG_ROCKCHIP_CDN_DP) + = cdn-dp.ocdn-dp-objs: = cdn-dp-core.o cdn-dp-reg.o cdn-dp -link-training.oobj-$ (CONFIG_ROCKCHIP_DW_MIPI_DSI) + = dw-mipi-dsi.oobj-$ (CONFIG_ROCKCHIP_ANALOGIX_DP) + = analogix_dp-rockchip.oobj-$ (CONFIG_ROCKCHIP_INNO_HDMI) + = inno_hdmi.oobj-$ (CONFIG_ROCKCHIP_LVDS) + = rockchip_lvds.oobj-$ (CONFIG_ROCKCHIP_RGB) + = rockchip_rgb.oobj-$ (CONFIG_ROCKCHIP_DRM_BACKLIGHT) + = rockchip_drm_backlight.oobj-$ (CONFIG_DRM_ROCKCHIP) ) + = rockchip_vop_reg.o rockchipdrm.oobj-$ (CONFIG_ROCKCHIP_DRM_TVE) + = rockchip_drm_tve.oobj-$ (CONFIG_ROCKCHIP_RK3066_HDMI) + = rk3066_hdmi.oobj-$ (CONFIG_DRM_ROCKCHIP_RK618) + = rk618/
Arch/arm64/configs/rockchip_linux_defconfig
The rockchip_linux_defconfig file generates a .config file when the kernel starts compiling, and the macros defined in this file are compiled with 2 and 3. Example:
CONFIG_DRM=yCONFIG_DRM_LOAD_EDID_FIRMWARE=yCONFIG_DRM_DMA_SYNC=yCONFIG_DRM_ROCKCHIP=yCONFIG_ROCKCHIP_DW_HDMI=y
Note: when using DRM drivers from other SOC vendors, 3 and 4 select Makefile, Kconfig, and * _ defcofig under the corresponding SOC vendor directory.
b. Small knowledge points:
In the defconfig file, the values of the configuration macro are only y and m. If you do not define a configuration macro, use # CONFIG_* is not set.
As mentioned earlier, Linux DRM includes: DRM core and DRM Driver. DRM core provides the basic framework, provides a registration interface for different SOC DRM driver, and also provides a hardware-independent ioctl call to the user state. DRM driver implements the hardware-related part and is responsible for hardware-related ioctl calls. The next article begins to introduce RK3399 DRM driver
This is the end of "what is the Linux DRM kernel code?" 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!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.