Skip to content

Commit

Permalink
Added applbkl aliases to IORegistry (data, 32-bit)
Browse files Browse the repository at this point in the history
  • Loading branch information
vit9696 committed Nov 20, 2019
1 parent a502c8b commit 9a0a169
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Expand Up @@ -6,6 +6,7 @@ WhateverGreen Changelog
- Added `-wegtree` boot argument to force device renaming
- Fixed FairPlay DRM playback patches on 10.15
- Added `shikigva` and `shiki-id` aliases in IORegistry
- Added `applbkl` aliases to IORegistry (data, 32-bit)

#### v1.3.4
- Added support for disabled AppleGraphicsDevicePolicy in AMD drivers on 10.15.1
Expand Down
16 changes: 11 additions & 5 deletions WhateverGreen/kern_weg.cpp
Expand Up @@ -234,11 +234,8 @@ void WEG::processKernel(KernelPatcher &patcher) {
resetFramebuffer = FB_COPY;
}

// Note, disabled Optimus will make videoExternal 0, so this case checks for active IGPU only.
if (appleBacklightPatch == APPLBKL_DETECT && (devInfo->videoBuiltin == nullptr || extNum > 0)) {
// Either a builtin IGPU is not available, or some external GPU is available.
kextBacklight.switchOff();
}
if (appleBacklightPatch == APPLBKL_DETECT && devInfo->videoBuiltin != nullptr)
WIOKit::getOSDataValue(devInfo->videoBuiltin, "applbkl", appleBacklightPatch);

for (size_t i = 0; i < extNum; i++) {
auto &v = devInfo->videoExternal[i];
Expand All @@ -247,6 +244,15 @@ void WEG::processKernel(KernelPatcher &patcher) {
// Assume that AMD GPU is the boot display.
if (v.vendor == WIOKit::VendorID::ATIAMD && resetFramebuffer == FB_DETECT)
resetFramebuffer = FB_ZEROFILL;

if (appleBacklightPatch == APPLBKL_DETECT)
WIOKit::getOSDataValue(v.video, "applbkl", appleBacklightPatch);
}

// Note, disabled Optimus will make videoExternal 0, so this case checks for active IGPU only.
if (appleBacklightPatch == APPLBKL_DETECT && (devInfo->videoBuiltin == nullptr || extNum > 0)) {
// Either a builtin IGPU is not available, or some external GPU is available.
kextBacklight.switchOff();
}

if ((graphicsDisplayPolicyMod & AGDP_DETECT) && isGraphicsPolicyModRequired(devInfo))
Expand Down

0 comments on commit 9a0a169

Please sign in to comment.