Linux AMDGPU driver to review its approach to device enumeration
AMD’s open-source Linux graphics driver engineers are working hard to overhaul how initial driver loading with device enumeration ultimately makes it more robust. In the process, PCI IDs become less important and in turn less of a way to expose possible indicators of new graphics cards.
A set of 66 fixes were sent today that modify over two thousand lines of code. The change is ultimately more about device enumeration and discovery of supported IP / hardware blocks rather than being tied explicitly to PCI device IDs. All recent AMD GPUs contain an “IP discovery table” for noting the various graphics, video encoding / decoding and other blocks on the hardware – the AMDGPU kernel driver would essentially use it to determine its code paths and what is taken. in charge, etc. .
This is a nice development that makes things cleaner on the driver write side with less hard-coded information and capabilities related to specific PCI device IDs and other checks, such as assuming that the discovery tables are accurate and reliable. Also, without having to keep this hard-coded information and a list of possible device IDs, another advantage from AMD’s point of view is a little less information potentially leaked through open source public driver fixes before. the launch of the material. Such as the recent jackpot of new added RDNA2 PCI IDs that seem to match rumors of an RDNA2 graphics card refresh that is part of the Radeon RX 7000 series … Or the previous addition of “blockchain SKU” and various others similar events in the past. Under the new device enumeration model, such metrics would not be there in the future as they are tied to specific products / IDs.
This being less dependent on PCI device IDs is also similar in nature to how the NVIDIA “New” open source kernel driver also handles things.
Alex Deucher, longtime AMD Linux driver developer who wrote most of the fixes, noted in the patch set the longest explanation for this change:
This patch set moves the driver to an IP-driven discovery model rather than a PCI device ID-related model. This allows the GPU driver to claim all PCI ATI display class devices. The driver will then load or not depending on the IP addresses (GC, SDMA, DCN, VCN, etc.) listed on the device. All recent asics contain an IP discovery table that lists the number and version of all IPs on the card. This avoids having to add new DIDs for new parts even though the driver would already support the new chip (i.e. all IP support is in place). It also better handles asics that have different number of IP address instances. We can just use the IP discovery table rather than keeping some hard-coded information in the driver. Finally, we can avoid adding a lot of asic type checks on the whole driver to add a new asic if the IP version is already supported.
These fixes are currently on their mailing list awaiting further consideration, as the schedule could potentially be in place as early as kernel 5.16.