AMD Navi Support Makes It Into DRM-Next For Linux 5.3, AMDGPU Hits Two Million Lines
Written by Michael Larabel in Radeon on 27 June 2019 at 09:31 AM EDT. 29 Comments
RADEON --
With the Linux kernel driver support for the upcoming "Navi" graphics cards only having been sent out last week for AMDGPU/AMDKFD, given it was more than 450 patches and more than 400 thousand lines of code (granted much of that automated header files), there was some risk it could be postponed given the imminent cut-off of new material to DRM-Next for Linux 5.3 given the rigid release cycle. Fortunately, that pull request has been honored.

So assuming Linus Torvalds has no objections to the code, this AMDGPU Navi support will be present in Linux 5.3. The Navi addition did regress earlier support, but fortunately that bug was quickly spotted and resolved. DRM co-maintainer David Airlie was content enough with pulling in the big AMDGPU code update overnight to DRM-Next.

AMDGPU has already been the biggest driver within the Linux kernel but curiosity got the best of me for seeing just how large the AMDGPU driver stack within the kernel (including the compute components, PowerPlay, etc) is 1,752,237 lines of code, 196,991 lines of comments, and 89,569 blank lines. That combined 2,038,797 lines is spread currently across 1,179 files. Of course, this is just counting the AMDGPU (not Radeon DRM) kernel driver code and not counting the multiple user-space components, such as their OpenGL and Vulkan drivers.

So with the addition of Navi support, the AMDGPU DRM code is now solidly above two million lines. For perspective, the Linux kernel state in DRM-Next was 51,793 code files with 18,355,485 lines of code detected and another 3,331,980 lines of comments and 3,291,932 blank lines. Or a grand total of 21,979,397 lines as of writing.

The modern AMD graphics kernel driver amounts to just over 9% of the total code-base of the Linux kernel! Though this is quite lean for the AMD graphics driver. I haven't heard any numbers in recent times, but a few years back was told their proprietary driver (Catalyst, at the time) was north of ten or twenty million lines of code in total for both kernel/user components.
Related News
About The Author
Author picture

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter or contacted via MichaelLarabel.com.

Popular News This Week