Contribute
Register

What does this patch do to AppleGraphicsDevicePolicy?

Status
Not open for further replies.
Joined
Dec 5, 2013
Messages
56
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.
 
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:
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:
@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.
 
@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?
 
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.
 
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
 
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.
 
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?
 
Status
Not open for further replies.
Back
Top