-
Notifications
You must be signed in to change notification settings - Fork 419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add proper AMD Integrated Graphics detection. #97
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does the current code break that you added hardcoded device identifiers, which are going to break far more often as new hardware revisions are released?
The old HDA detection code breaks for legacy systems somewhere down the line, AMD’s Device IDs and GC versions are pretty hardcoded in of themselves, you have to know what versions (GC) map to a device or get the APU flag set under AMDGPU There’s a handy reference list for GPUs on Techpowerup, other than that, it’s a guessing game of what IP versions exist on a certain GPU. |
I.e. this is entirely impossible to distinguish discrete PCI GPU from APU based on topology on AMD? |
Lilu/Sources/kern_devinfo.cpp
Outdated
uint32_t dev = 0; | ||
WIOKit::getOSDataValue(obj, "device-id", dev); | ||
dev = (dev & 0xFF00); | ||
if ((dev == 0x1600 || dev == 0x1500) || (dev == 0x9800 || dev == 0x1300) || (dev == 0x9900 || dev == 0x9600)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we end up having this code, these numbers must become named constants, so that it is clear which id belongs to which family.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for this, the &ing makes the Device ID range more generic so there isn’t a million cases.
0x1500 is commonly associated with AMD’s Raven line, 0x1600 catches devices from Renoir, Van Gogh and Rembrandt
0x1300 catches Kaveri (Spectre) and a certain Granite Ridge iGPU (0x13C0)
0x9800 catches Carrizo, Mullins (Godavari), Kabini (Kalindi) and Stoney
0x9600 and 0x9900 catch some of the legacy TeraScale iGPUs such as Trinity and Richland iirc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This information must be in the code, not in the comments to the review. Unnamed numeric literals are plain bad, make them named constants.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was going to do this already, got caught up in other things
pushed out the changes now
lmk if the names need changing at all
AFAIK, The only way to do it on the PCI device is by doing what I did. There is no ‘isAPU’ anywhere without having to use hardcoded values to my knowledge |
i lke the idea but why not use linux constants ? this would help in future updates. from amd_asic_type.h and from amdgpu_drv.c
(...) note that the flags also help cause we got AMD_IS_APU for proper devices |
the generic constants help to reduce complexity, but also Linux isn't a reliable source (for newer devices) since APU detection shifted to using the IP Discovery binary and marking the device as an APU from the GC version, see here devices such as Granite Ridge and Raphael aren't in the AMDGPU driver itself, leading to whoever wanting to find the Device ID to have to use external places, such as |
This reverts commit 8ae3167. The change breaks GCN 5 IGPU detection at least. references acidanthera/bugtracker#2424
As the title implies, it's a proper implementation for detecting the iGPU device.
This targets more "recent" iGPUs.
Notably those of the: