Skip to content

Commit

Permalink
fix(fb): Add missing check for Raven in backlight logic
Browse files Browse the repository at this point in the history
Fixes #314
  • Loading branch information
VisualEhrmanntraut committed Oct 19, 2024
1 parent fd580fe commit f9b7759
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions NootedRed/X6000FB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,8 @@ IOReturn X6000FB::wrapSetAttributeForConnection(IOService *framebuffer, IOIndex

callback->curPwmBacklightLvl = static_cast<UInt32>(value);

if ((NRed::callback->attributes.isBigSurAndLater() && callback->panelCntlPtr == nullptr) ||
if ((NRed::callback->attributes.isBigSurAndLater() && NRed::callback->attributes.isRaven() &&
callback->panelCntlPtr == nullptr) ||
callback->embeddedPanelLink == nullptr) {
return kIOReturnNoDevice;
}
Expand All @@ -416,7 +417,7 @@ IOReturn X6000FB::wrapSetAttributeForConnection(IOService *framebuffer, IOIndex
// dc_link_set_backlight_level_nits doesn't print the new backlight level, so we'll do it
DBGLOG("X6000FB", "%s: New AUX brightness: %d millinits (%d nits)", __FUNCTION__, auxValue, (auxValue / 1000));
callback->orgDcLinkSetBacklightLevelNits(callback->embeddedPanelLink, true, auxValue, 15000);
} else if (NRed::callback->attributes.isRaven() && NRed::callback->attributes.isBigSurAndLater()) {
} else if (NRed::callback->attributes.isBigSurAndLater() && NRed::callback->attributes.isRaven()) {
// XX: Use the old brightness logic for now on Raven
// until I can find out the actual problem with DMCU.
UInt32 pwmValue = percentage >= 100 ? 0x1FF00 : ((percentage * 0xFF) / 100) << 8U;
Expand Down

0 comments on commit f9b7759

Please sign in to comment.