Skip to content

Commit

Permalink
Fixed AMD Verde CAIL injection logic
Browse files Browse the repository at this point in the history
  • Loading branch information
vit9696 committed Dec 21, 2018
1 parent 2f37366 commit d35ea6d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ WhateverGreen Changelog
=======================
#### v1.2.6
- Added `-applbkloff` boot argument to termporarily disable `AppleBacklight` patching code
- Fixed AMD Verde CAIL injection logic

#### v1.2.5
- Added support for specifying `agpmod` in external GPU properties
Expand Down
23 changes: 10 additions & 13 deletions WhateverGreen/kern_rad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -707,21 +707,18 @@ OSObject *RAD::wrapGetProperty(IORegistryEntry *that, const char *aKey) {
prefix = "CFG,";
else if (!strcmp(aKey, "aty_properties"))
prefix = "PP,";
} else if (aKey[0] == 'c' && !strcmp(aKey, "cail_properties")) {
prefix = "CAIL,";
}
} else if (aKey[0] == 'c' && !strcmp(aKey, "cail_properties")) {
provider = OSDynamicCast(IOService, that->getParentEntry(gIOServicePlane));
DBGLOG("rad", "GetProperty got cail_properties %d, merging from %s", provider != nullptr,
provider ? safeString(provider->getName()) : "(null provider)");
if (provider) prefix = "CAIL,";
}

if (prefix && provider) {
DBGLOG("rad", "GetProperty discovered property merge request for %s", aKey);
auto newProps = OSDynamicCast(OSDictionary, props->copyCollection());
callbackRAD->mergeProperties(newProps, prefix, provider);
that->setProperty(aKey, newProps);
newProps->release();
obj = newProps;
if (prefix) {
DBGLOG("rad", "GetProperty discovered property merge request for %s", aKey);
auto newProps = OSDynamicCast(OSDictionary, props->copyCollection());
callbackRAD->mergeProperties(newProps, prefix, provider);
that->setProperty(aKey, newProps);
newProps->release();
obj = newProps;
}
}
}

Expand Down

0 comments on commit d35ea6d

Please sign in to comment.