dortania / bugtracker

Dortania Bugtracker
108 stars 7 forks source link

Ivy Bridge Power Management on Big Sur #165

Open jan2000 opened 3 years ago

jan2000 commented 3 years ago

I have a Dell laptop with an Intel i5-3337U. Power Management works correctly on Mojave with SMBIOS set to MacBookAir5,2 and SSDT-PM.aml generated by ssdtPRGen (I had to use the options -lfm 800 -c 2 otherwise the following panic happens: P-state Stepper Error 18 at Step 29 in context 2 on CPU 0).

To upgrade to Big Sur the SMBIOS MacBookAir5,2 is no longer valid. As there are no longer any laptop Ivy Bridge SMBIOS available I switched to the next closest: MacBookAir6,2 while still keeping SSDT-PM.aml. At first it seemed that Power Management was still working, IORegistryExplorer showed exactly as the "Power Management Working" screenshot (which contradict the caption "XCPM Present" as there is no xcpm for Ivy Bridge).

However, upon further inspection Power Management was not working correctly at all. In Intel Power Gadget the CORE AVG frequency was not (closely) following the CORE REQ frequency as it was before on Mojave with MacBookAir5,2. The CORE REQ frequency was stuck on the ~2.6 Ghz. But the biggest problem was that after waking from sleep performance was ~33% lower than before sleep. I tested this with WebGL Aquarium in Safari (5000 fish): after a fresh boot the fps was about ~24fps, after a sleep/wake it was ~15fps.

To fix Power Managent on Big Sur I used CPUFriend to inject the properties of MacBookAir5,2 while still retaining SMBIOS MacBookAir6,2. I used the ResourceConverter.sh from CPUFriend to convert the MacBookAir5,2 plist (/System/Library/Extensions/IOPlatformPluginFamily.kext/Contents/PlugIns/X86PlatformPlugin.kext/Contents/Resources/Mac-2E6FAB96566FE58C.plist) to cf-frequency-data and added this to SSDT-PM.aml. (I used Mojave as source for the plist, but later I saw that it was still available in Big Sur)

After this Power Managment is working correctly on Big Sur with SMBIOS MacBookAir6,2 like it was on Mojave with SMBIOS MacBookAir5,2.

I would suggest the following things for the guides:

jan2000 commented 3 years ago

One thing I only noticed later is that when using the MacBookAir5,2 properties file Mac-2E6FAB96566FE58C.plist idle sleep was no longer working. Thus manual sleep (by selecting sleep or closing the lid) was working, but leaving the laptop untouched for a few minutes would no longer result in sleep. In order to restore that I had to add UnifiedSleepSliderPref = true to the plist file before using ResourceConverter.sh (probably due to the new Battery settings panel in Big Sur).

    <dict>
      <key>pmspFile</key>
      <integer>3</integer>
      <key>IOPlatformPowerProfile</key>
      <dict>
+       <key>UnifiedSleepSliderPref</key>
+       <true/>
        <key>SilentRunning</key>
        <true/>
        <key>enabler</key>
        <true/>
        <key>AGPM</key>