Show Your Support: This site is primarily supported by advertisements. Ads are what have allowed this site to be maintained on a daily basis for the past 18+ years. We do our best to ensure only clean, relevant ads are shown, when any nasty ads are detected, we work to remove them ASAP. If you would like to view the site without ads while still supporting our work, please consider our ad-free Phoronix Premium.
AMD's Modern Graphics Driver In Linux 5.14 Exceeds 3.3 Million Lines Of Code
Curiosity got the best of me with the ballooning size of AMDGPU so when running cloc on the "drivers/gpu/drm/amd" off Linux 5.14-rc1, it's now measuring in at 3.32 million lines of code. AMDGPU continues to by far be the largest driver within the mainline Linux kernel. That 3.3 million lines is made up of 2.86 million lines of "code", 332k lines of comments, and some 127k blank lines across 1,715 files.
Of course, as longtime Phoronix readers will know, much of the ballooning size of AMDGPU is due to automated register header files that are added to the tree with each new GPU being supported. Those automatically generated header files based on AMD's internal documentation lead to the explosive growth and is sort of AMD's form of public documentation these days. Thankfully unused portions of these header files are eliminated by the compiler at build time. As measured by cloc, within the gpu/drm/amd code there is some 2.4 million lines of header files and then 427k lines of code detected C code.
Meanwhile there is also the "Radeon" DRM driver within the kernel too for the older graphics processors. That Radeon DRM driver amounts to just under 200k lines of code in total.
As another comparison metric, Intel's current DRM kernel graphics driver (i915) comes in at roughly 313k lines of code.
The entire size of the Linux 5.14-rc1 source tree comes in at roughly 29.7 million lines via some 22 million lines of detected code, another 3.7 million lines of comments, and 3.9 million blank lines. Or in other words, more than 10% of the Linux kernel source tree amounts to within the AMD Direct Rendering Manager graphics/display code.
For those wondering what is new with this forthcoming kernel, see my Linux 5.14 feature overview. On the AMDGPU front the increasing size is due to the additions for the Yellow Carp and Beige Goby GPUs. AMDGPU also has hot unplugging code now working well, PCIe ASPM being enabled by default, AMD Smart Shift support, and various other AMD graphics improvements. Linux 5.14 stable should be out by early September.