Skip to content

Commit

Permalink
Added support for modern AMD device scanning by @AlGreyy, closes #49
Browse files Browse the repository at this point in the history
  • Loading branch information
vit9696 committed Jan 27, 2019
1 parent 2782cc9 commit 5f147cf
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
2 changes: 2 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Lilu Changelog
==============
#### v1.3.3
- Added support for modern AMD device scanning by @AlGreyy

#### v1.3.2
- Extended supported firmware vendor list
Expand Down
6 changes: 3 additions & 3 deletions Lilu.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@
MODULE_NAME = as.vit9696.Lilu;
MODULE_START = kern_start;
MODULE_STOP = kern_stop;
MODULE_VERSION = 1.3.2;
MODULE_VERSION = 1.3.3;
OTHER_CFLAGS = (
"-mmmx",
"-msse",
Expand Down Expand Up @@ -970,7 +970,7 @@
MODULE_NAME = as.vit9696.Lilu;
MODULE_START = kern_start;
MODULE_STOP = kern_stop;
MODULE_VERSION = 1.3.2;
MODULE_VERSION = 1.3.3;
OTHER_CFLAGS = (
"-mmmx",
"-msse",
Expand Down Expand Up @@ -1082,7 +1082,7 @@
MODULE_NAME = as.vit9696.Lilu;
MODULE_START = kern_start;
MODULE_STOP = kern_stop;
MODULE_VERSION = 1.3.2;
MODULE_VERSION = 1.3.3;
OTHER_CFLAGS = (
"-mmmx",
"-msse",
Expand Down
1 change: 1 addition & 0 deletions Lilu/Headers/kern_iokit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ namespace WIOKit {
struct VendorID {
enum : uint16_t {
ATIAMD = 0x1002,
AMDZEN = 0x1022,
NVIDIA = 0x10de,
Intel = 0x8086
};
Expand Down
10 changes: 8 additions & 2 deletions Lilu/Sources/kern_devinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ void DeviceInfo::grabDevicesFromPciRoot(IORegistryEntry *pciRoot) {
// Strip interface, as we only care about class and subclass
code &= WIOKit::ClassCode::PCISubclassMask;

if (!gotVendor || !gotClass || (vendor != WIOKit::VendorID::Intel && vendor != WIOKit::VendorID::ATIAMD))
if (!gotVendor || !gotClass || (vendor != WIOKit::VendorID::Intel && vendor != WIOKit::VendorID::ATIAMD && vendor != WIOKit::VendorID::AMDZEN))
continue;

if (vendor == WIOKit::VendorID::Intel && (code == WIOKit::ClassCode::DisplayController || code == WIOKit::ClassCode::VGAController)) {
Expand Down Expand Up @@ -272,10 +272,16 @@ void DeviceInfo::grabDevicesFromPciRoot(IORegistryEntry *pciRoot) {
safeString(pciobj->getName()), safeString(name), pcivendor);
v.video = pciobj;
v.vendor = pcivendor;
} else if (pcicode == WIOKit::ClassCode::HDADevice) {
} else if (pcicode == WIOKit::ClassCode::HDADevice && pcivendor != WIOKit::VendorID::AMDZEN) {
DBGLOG("dev", "found HDAU device %s at %s by %04X",
safeString(pciobj->getName()), safeString(name), pcivendor);
v.audio = pciobj;
} else if (pcicode == WIOKit::ClassCode::HDADevice) {
// On modern AMD platforms built-in audio devices sits on a PCI bridge just any other device.
// Luckily it has a distinct device-id for the time being.
DBGLOG("dev", "found AMD HDEF device %s at %s by %04X",
safeString(pciobj->getName()), safeString(name), pcivendor);
audioBuiltinAnalog = pciobj;
}
}
}
Expand Down

0 comments on commit 5f147cf

Please sign in to comment.