AMDGPU Linux Driver To Overhaul Its Approach To Device Enumeration

Written by Michael Larabel in Radeon on 21 September 2021 at 05:00 PM EDT. 8 Comments
RADEON
AMD's open-source Linux graphics driver engineers are working to overhaul how the initial driver loading with device enumeration happens to ultimately make it more robust. In the process though PCI IDs become less important and in turn less of an avenue for exposing possible indicators of new graphics cards.

A set of 66 patches were sent out today that alter more than two thousand lines of code. The change is ultimately more about having the device enumeration and discovery of supported IP/hardware blocks rather than being tied explicitly to PCI device IDs. All recent AMD GPUs do contain an "IP discovery table" for noting the different graphics, video encode/decode, and other blocks on the hardware -- the AMDGPU kernel driver would basically use that for determining its code paths and what is supported, etc.

This is a nice evolution and makes things cleaner from the driver writing side with less hard-coded information and tie capabilities to specific PCI device IDs and other checks, assuming the discovery tables are accurate and reliable. Plus with not having to maintain that hard-coded information and a list of possible device IDs, another benefit from the AMD perspective is slightly less information being potentially leaked out via open-source, public driver patches ahead of hardware launch. Such as the recent big batch of new RDNA2 PCI IDs being added that seem to jive with rumors of an RDNA2 graphics card refresh coming as part of the Radeon RX 7000 series... Or the prior "blockchain SKU" addition and various other similar events in the past. Under the new device enumeration model, such indicators wouldn't be there moving forward as it ties into specific products/IDs while.

This being less dependent on PCI device IDs is also similar in nature to how the open-source NVIDIA "Nouveau" kernel driver handles things as well.

Longtime AMD Linux driver developer Alex Deucher who wrote most of the patches noted in the patch series the longer explanation of this change:
This patch set moves the driver to an IP driven discovery model rather than one tied to PCI device ids. This allows the GPU driver to claim all ATI PCI display class devices. The driver will then either load or not based on the IPs (GC, SDMA, DCN, VCN, etc.) that are enumerated on the device. All recent asics contain an IP discovery table which enumerates the number and version of all IPs on the board. This avoids the need to add new DIDs for new parts even if the driver would already otherwise support the new chip (i.e., support for all of the IPs are in place). It also better handles asics which have different numbers of instances of IPs. We can just use the IP discovery table rather than maintaining hardcoded information in the driver. Finally, we can avoid adding lots of asic type checks all over the driver to add a new asic if the IP version is already supported.

These patches are currently out on their mailing list awaiting further review while given the timing could be potentially mainlined as soon as the 5.16 kernel.
Related News
About The Author
Michael Larabel

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, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week