Contribute
Register

What does this patch do to AppleGraphicsDevicePolicy?

Joined
Dec 5, 2013
Messages
57
Motherboard
ASUS ROG Maximus IX Hero
CPU
I7-7700K
Graphics
RX 580
Mac
  1. iMac
  2. MacBook Air
Mobile Phone
  1. iOS
I noticed an issue recently when I started using my monitors in portrait for work. After cold boot the orientation of the screens was messed up. The main screen window is correctly set up because the cursor appears in the right position, but the underlying desktop screen was in landscape and at at vertical edges creating huge black bezels. I found this issue unresolved in the forums as well (there is also a picture of the issue):


I did a little search and found someone suggesting a patch:

Code:
Name: com.apple.driver.AppleGraphicsDevicePolicy
Find: BA000000 00
Replace: BA050000 00

Before applying the patch I searched for more information about it, but couldn't find any. In fact I found that there is a similar patch ghosting through the web, where the hex values from above are simply switched:

Code:
Name: com.apple.driver.AppleGraphicsDevicePolicy
Find: BA050000 00
Replace: BA000000 00

Okay then, I though, let's try the most common patch. Added, rebooted, nothing, didn't helped. Then I switched the values as originally suggested. Rebooted again, (\) instead of the Apple logo. I thought it didn't worked, force rebooted again but I didn't turn off the patch in clover to verify the failure a second time. Interestingly enough my system booted just find the rotation issue is gone.

Long story short, I'm really happy that I found this fix. However I would like to know what I actually did patch in my system and what it does to it and why? I'd appreciate if someone with more insights of that area could shortly explain the patch to me.

---

P.S: My system is running the very latest Mojave version and clover and lilu & friends kext's are updated.
 
Joined
Nov 5, 2010
Messages
469
Motherboard
MSI TRX40 Creator
CPU
AMD Threadripper 3970X
Graphics
Radeon VII / RX 6800 XT
Mac
  1. Mac Pro
Mobile Phone
  1. iOS
I noticed an issue recently when I started using my monitors in portrait for work. After cold boot the orientation of the screens was messed up. The main screen window is correctly set up because the cursor appears in the right position, but the underlying desktop screen was in landscape and at at vertical edges creating huge black bezels. I found this issue unresolved in the forums as well (there is also a picture of the issue):


I did a little search and found someone suggesting a patch:

Code:
Name: com.apple.driver.AppleGraphicsDevicePolicy
Find: BA000000 00
Replace: BA050000 00

Before applying the patch I searched for more information about it, but couldn't find any. In fact I found that there is a similar patch ghosting through the web, where the hex values from above are simply switched:

Code:
Name: com.apple.driver.AppleGraphicsDevicePolicy
Find: BA050000 00
Replace: BA000000 00

Okay then, I though, let's try the most common patch. Added, rebooted, nothing, didn't helped. Then I switched the values as originally suggested. Rebooted again, (\) instead of the Apple logo. I thought it didn't worked, force rebooted again but I didn't turn off the patch in clover to verify the failure a second time. Interestingly enough my system booted just find the rotation issue is gone.

Long story short, I'm really happy that I found this fix. However I would like to know what I actually did patch in my system and what it does to it and why? I'd appreciate if someone with more insights of that area could shortly explain the patch to me.

---

P.S: My system is running the very latest Mojave version and clover and lilu & friends kext's are updated.
In order to understand what AppleGraphicsDevicePolicy patch does you need to understand what AppleGraphicsDevicePolicy does first. When using a SMBIOS that uses AppleGraphicsDevicePolicy it tells the OS what graphics configuration to use, which then in tells the OS what graphics power management settings to use. Some configurations load AGPM (Apple Graphics Power Management) and some don't. From your system specs in your profile I am assuming you are using iMac18,3 SMBIOS because you are running Z270 and i7-7700K CPU which uses Config 3 of AGDP as you can see in the screenshot of AGDP Info.plist below.
3HveeW3.png

These are the different feature controls that your iGPU and GFX0 will use if AGDP is loaded.

What the AGDP patch does it by-pass the check for your SMBIOS and stops AGDP from loading or makes the AGDP to always use the default profile which is similar to the MacPro5,1 profile. The MacPro5,1 profile is the closest profile to a Desktop PC setup.
 
Joined
Oct 26, 2013
Messages
1,049
Motherboard
MSI B250M PRO-VHD
CPU
i3-7100
Graphics
RX 570
Common AGDP disable patch for below conditions, WEG boot flags agdpmod=vit9696 or agdpmod=pikera or adgpmod=ignore may also work.
389301


1, Enable multi monitors support, like SMBIOS MacMini, iMac17,1 do not have multi monitors support, need disable AGDP.

2, Prevent black screen on some SMBIOSs, some ports may not work on some SMBIOSs, DP or HDMI or DVI, probably due to output ports are remapped for MST protocol.

3, Enable VGA port for SKL and up, from SKL up, VGA port is native supported, but need match ig-platform-id and AGDP must be disabled, VGA port normally link to port 7 0306, so SKL need ig-platform-id 0x193B0005, KBL need ig-platform-id 0X59120000 to enable port 7, AGDP patch can used for skip VGA port check.

4, Some SMBIOSs may have special EDID for 5K MST monitors or 4K older MST monitors, disable AGDP can fix half display resolution issue (like 2560 x 2880 or 1920 x 2160) but MST monitor will not work properly.
 
Last edited:
Joined
Sep 22, 2011
Messages
1,081
Motherboard
HP EliteDesk 800 G4 Mini
CPU
I7-8700
Graphics
UHD 630
Mac
  1. Mac mini
Mobile Phone
  1. iOS
1, Enable multi monitors support, like SMBIOS MacMini, iMac17,1 do not have multi monitors support, need disable AGDP.

Great tip! Your AGDP patch enabled multiple displays on my MacMini8,1 (HP EliteDesk 800 G4 / I7-8700T / UHD 630 / 3 x DP). Thank you.
 
Last edited:
Joined
Jul 13, 2016
Messages
2,716
Motherboard
Gigabyte Z370 Gaming 5
CPU
I9 9900k
Graphics
Vega 64
Mac
  1. Mac mini
  2. Mac Pro
Mobile Phone
  1. iOS
@Pavo I used the Black Screen Patch for a really long time and it allowed me to not use WEG. However, with Big Sur, the patch no longer works.

Code:
               <key>Find</key>
                <data>Ym9hcmQtaWQ=</data>
                <key>Name</key>
                <string>AppleGraphicsDevicePolicy</string>
                <key>Replace</key>
                <data>Ym9hcmQtaXg=</data>
                <key>Disabled</key>
                <false/>
                <key>Comment</key>
                <string>Black Screen Patch Vega 56/64, RX580 etc. (c)Pike R. Alpha</string>

Any idea how to make it work again? I use iMac Pro, 1,1 SM, I tried using Mac Pro 7,1 for a min but it seems like it crashes a lot.
 
Joined
Sep 13, 2020
Messages
3
Motherboard
Skylake
CPU
Skylake
Graphics
620
@Pavo I used the Black Screen Patch for a really long time and it allowed me to not use WEG. However, with Big Sur, the patch no longer works.

Code:
               <key>Find</key>
                <data>Ym9hcmQtaWQ=</data>
                <key>Name</key>
                <string>AppleGraphicsDevicePolicy</string>
                <key>Replace</key>
                <data>Ym9hcmQtaXg=</data>
                <key>Disabled</key>
                <false/>
                <key>Comment</key>
                <string>Black Screen Patch Vega 56/64, RX580 etc. (c)Pike R. Alpha</string>

Any idea how to make it work again? I use iMac Pro, 1,1 SM, I tried using Mac Pro 7,1 for a min but it seems like it crashes a lot.
You can open a ticket at their bugtracker. Or manually patch the binary and set it to next boot with the apfs_snapshot -r “” method from asenbot

are u using opencore or clover?
 
Joined
Jul 13, 2016
Messages
2,716
Motherboard
Gigabyte Z370 Gaming 5
CPU
I9 9900k
Graphics
Vega 64
Mac
  1. Mac mini
  2. Mac Pro
Mobile Phone
  1. iOS
You can open a ticket at their bugtracker. Or manually patch the binary and set it to next boot with the apfs_snapshot -r “” method from asenbot

are u using opencore or clover?

It is probably not a bug and I would guess that Apple changed something and that is why it does not work. I use Open core but it worked in both open core and clover before Big Sur. It was included in Open core Configurator for some time but then it was removed not sure exactly when. However, he patch works still in Catalina in both OC and Clover.
 
Joined
Sep 13, 2020
Messages
3
Motherboard
Skylake
CPU
Skylake
Graphics
620
It is probably not a bug and I would guess that Apple changed something and that is why it does not work. I use Open core but it worked in both open core and clover before Big Sur. It was included in Open core Configurator for some time but then it was removed not sure exactly when. However, he patch works still in Catalina in both OC and Clover.
Do you have a picture/log of when the patch is run? I like to search for the terms they use and see where it is in the source code.

I think in the future it would use Lilu kext patch (like with night shift patch or coredisplayfix, or 5k fix.. but thats diffuclt to understand)

Also does anyone know how/where Extensions cache (not prekernel ones..) are loaded? the cache they talk about is always the prekernelcache, but how about the ones like for framebuffers,etc? I tried to binary patch a file but it does not load my version. Haven't seen anywhere discuss about it. thx
 
Joined
Jul 13, 2016
Messages
2,716
Motherboard
Gigabyte Z370 Gaming 5
CPU
I9 9900k
Graphics
Vega 64
Mac
  1. Mac mini
  2. Mac Pro
Mobile Phone
  1. iOS
Do you have a picture/log of when the patch is run? I like to search for the terms they use and see where it is in the source code.

I think in the future it would use Lilu kext patch (like with night shift patch or coredisplayfix, or 5k fix.. but thats diffuclt to understand)

Also does anyone know how/where Extensions cache (not prekernel ones..) are loaded? the cache they talk about is always the prekernelcache, but how about the ones like for framebuffers,etc? I tried to binary patch a file but it does not load my version. Haven't seen anywhere discuss about it. thx

The point of the black screen patch is that it is not reliant on lilu or anything else it patches Apples

AppleGraphicsDevicePolicy

I am guessing it made the OS load a different video configuration as @Pavo described above but it does not work with Big Sur. Maybe it will not work because the System Disk is read-only and I merely just need to unlock it.
 
Joined
Sep 22, 2011
Messages
1,081
Motherboard
HP EliteDesk 800 G4 Mini
CPU
I7-8700
Graphics
UHD 630
Mac
  1. Mac mini
Mobile Phone
  1. iOS
I was using the binary patch enabled in Clover (r5122) config.plist and switched to the boot-arg igfxagdc=0 (with Lilu/WhateverGreen). I haven't yet tried this boot-arg with BS. Maybe someone else can test it?
 
Top