Skip to content

Commit

Permalink
fix(fb): fix pwm value calculation
Browse files Browse the repository at this point in the history
[why]
the brightness turns off on raven as soon as it's turned down
[how]
calculate pwm value correctly (0xff * 0x101) as in linux
  • Loading branch information
VisualEhrmanntraut committed Aug 19, 2024
1 parent 2e8b1e8 commit 46a569b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion NootedRed/X6000FB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ IOReturn X6000FB::wrapSetAttributeForConnection(IOService *framebuffer, IOIndex
return kIOReturnSuccess;
}
} else {
UInt32 pwmValue = percentage >= 100 ? 0x1FF00 : ((percentage * 0xFF) / 100) << 8U;
UInt32 pwmValue = (percentage * 0xFFFF) / 100;
DBGLOG("X6000FB", "setAttributeForConnection: New PWM brightness: 0x%X", pwmValue);

if (callback->orgDcLinkSetBacklightLevel(callback->embeddedPanelLink, pwmValue, 0)) { return kIOReturnSuccess; }
Expand Down

0 comments on commit 46a569b

Please sign in to comment.