Just a hunch but the issue in IntelBacklight could be this:
Code:
// setup BAR1 address...
m_baseMap = m_provider->mapDeviceMemoryWithRegister(kIOPCIConfigBaseAddress0);
No.
IntelBacklight.kext actually works when the methods within are called.
Brightness by bergdesign works with IntelBacklight.kext.
But the brightness slider in SysPrefs->Displays does not (it never calls into the kext to change brightness).
Something has changed in a framework somewhere, that makes the SysPrefs stuff fail, but evidently Brightness by bergdesign doesn't use the same framework or the same calls within anway.
I don't pretend to understand how PNLF works nor can I confidently read ACPI code. If FB kexts write to these registers (as they do) in places like AppleIntelFramebufferController::hwSetBacklight how does PNLF work at all? PNLF writes to the registers directly right?
On previous architectures, the kexts are setting the backlight duty during brightness changes and the freq/max on wake from sleep. They are set to the values expected for the given ig-platform-id (as coded in ig-platform table).
But aren't you fighting against the FB kext that also writes to these registers? My thought was your PNLF somehow overrides it.
No.
_INI methods in ACPI are called very early in ACPI initialization, then never called again.
Using the formula BACKLIGHT_LEVEL * PWM_FREQ / 0xFFFF to set max 0xFFFF * 0x1d4c0 / 0xFFFF = 0x1d4c0. Same as the default not smaller.
But then there is no change at all. As we already know, FREQ and DUTY are already both 0x1d4c0.
The entire goal of the _INI code is simply to set the state of the backlight registers (at boot only) to the values that are used by Apple products of the same architecture/same ig-platform-id. If people want only the part of SSDT-PNLF.aml that triggers AppleBacklight to load, they can strip it down or set RMCF.BKLT=0.
Are you sure you don't want to have a few people try it out first? Or do you not think a PNLF-only solution is possible now? Do you think the fix should be rolled into AppleBacklightFixup or just left in WEG for now?
I will leave the SSDT-PNLF code as is. If people want to try it, or attempt modifications of it, that's fine... have at 'er.
The fix that you have should stay in WEG, I think. At least for now.