- Joined
- Jul 13, 2014
- Messages
- 284
Check the framebuffer in each. It has the setting for maximum PWM backlight clock.
In the event of something other than 0xad9, you'd have to modify the _BCL table (and other data) to match.
FYI: I'm working on some changes to this patch (and the HD3000/HD4000) where it will instead keep the max PWM clock at what BIOS sets (as an option), scaling the _BCL as required, and always setting the PWM registers (including max) to what the BIOS originally set. I think it is probably better to set it to what BIOS wants instead of what OS X wants. It will also have the side effect of fixing the problem you mention (not really a bug, but...) because the framebuffer's setting will always be short lived.
indeed, 000a max PWM is 5273Hz.
Is there a smart way to come up with the _BCL table? So far I've changed the initial store to LEVX to 0x14991499, and the upper XRGH range to 5273, but I do not know how to define the valid steps in _BCL.
(Sorry about the pesky questions while you're reworking the patch.. started changing this before I saw your edit )
Edit: Made a linear table with the script below. Seems to be working ok, even though the one in your original patch doesn't look linear. Probably related to how brightness changes are perceived?
Code:
#! /bin/sh
i="0"
a="29"
while [ $i -lt 64 ]
do
a=$[$a+82]
i=$[$i+1]
echo ' '$a',\\n'
done
Edit x2: I had to revert back to 0xa260006 since my backlight wouldn't turn back on after display sleep with 0xa26000a. Oh well, at least I learned something about how backlight dimming works