Contribute
Register

[Guide] Alternative to the minStolenSize patch with 32mb DVMT-prealloc

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,259
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
Overview

A common problem with Broadwell/Skylake/KabyLake is relatively small DVMT-prealloc setting by PC OEMs. The Apple framebuffer kexts generally assume 64mb or larger, and most PC OEMs use only 32mb. And often, there is no way to change it easily due to limited BIOS, locked down BIOS, etc.

Note: For more information regarding changing DVMT-prealloc, see FAQ.
https://www.tonymacx86.com/threads/faq-read-first-laptop-frequent-questions.164990/

And some of the techniques to change DVMT-prealloc, even if possible, can be dangerous and you may not want to risk it.

There is the minStolenSize patch, which can disable the check for adequate DVMT-prealloc, but that patch is likely to cause instability, glitches, or other strange behavior. There is likely good reason for the assertion in the framebuffer code.

Fortunately, it is possible to patch the framebuffer to fit within the 32mb DVMT-prealloc.


Details, Broadwell example

Of course, patching the framebuffer for an alternate DVMT-prealloc is a bit more involved than using the minStolenSize patch because the patch is specific both to the ig-platform-id you're using.

Let's take a look at the framebuffer data for a commonly used ig-platform-id on Broadwell, 0x16260006:

06002616 01030303 00002002 00005001

The 06002616 is just 0x19260006 byte reversed.
The 01030303 has to do with port and pipe counts.

The next two 32-bit items are the framebuffer memory size and the cursor bytes size (in WhateverGreen, these are referred to as framebuffer-stolenmem, and framebuffer-fbmem).
The sum of those two items must be less (or equal) than the DVMT-prealloc setting.

So, 0x02200000 is 34MB, and 0x01500000 is 21MB. The sum is 55MB. So, clearly it is not going to work with a DVMT-prealloc of 32MB.

We can change these values so only 32MB (actually a bit less) is required. For example, we know that on Haswell AppleIntelFramebufferAzul and ig-platform-id 0x0a260006 only require 32MB.

The AppleIntelFramebufferAzul kext has this in the header for 0xa260006:

0600260A 01030303 00000002 00003001 00006000

Byte reversing the values, we get 0x02000000 (32MB) for DVMT-prealloc requirement, 0x01300000 (19MB) for framebuffer size, and 0x00600000 (6MB) for cursor bytes. Of course we usually patch the 6MB to 9MB, otherwise there are glitches.

So... a patch for Broadwell 0x16260006:

Comment: 0x16260006, 32MB BIOS, 19MB framebuffer, 9MB cursor bytes (credit RehabMan)
Name: AppleIntelBDWGraphicsFramebuffer
Find: 06002616 01030303 00002002 00005001
Replace: 06002616 01030303 00003001 00009000

The above KextsToPatch patch results in ig-platform data that requires only 28MB.

You could also shorten the Find/Replace data such that it applies to more ig-platform-id values.

For example, this patch:
Comment: 0x16260006/etc, 32MB BIOS, 19MB framebuffer, 9MB cursor bytes (credit RehabMan)
Name: AppleIntelBDWGraphicsFramebuffer
Find: 01030303 00002002 00005001
Replace: 01030303 00003001 00009000

... would apply to the following: 0x19160002, 0x16160002, 0x16260002, 0x16220002, 0x162b0002, 0x16260005, 0x16260006.

These patches are much easier and more reliable (and less likely to stop working) using WhateverGreen.kext:
framebuffer-patch-enable=1
framebuffer-stolenmem=<00003001>
framebuffer-fbmem=<00009000>

Or, as it would look in Xcode (this example taken from guide plist config_HD615_620_630_640_650.plist):
32mb DVMT whatevergreen.png



Read here for more information on WhateverGreen.kext: https://www.tonymacx86.com/threads/guide-intel-framebuffer-patching-using-whatevergreen.256490/


Conclusion

There is no need to use the minStolenSize patch or change DVMT-prealloc... Instead, you can patch the framebuffer to match your BIOS configuration for DVMT-prealloc.

Patching the framebuffer to match your BIOS setting for DVMT-prealloc is likely to be more stable than the minStolenSize patch and with limited BIOS options, comes with less risk than changing DVMT-prealloc.
 
Last edited:
Joined
Jul 24, 2011
Messages
64
Motherboard
Lenovo G50-80
CPU
i5-5200U
Graphics
HD 5500 1920x1080
Mac
MacBook, Mac mini
Mobile Phone
Android
Great find! In my config I expanded the Broadwell 0x16260006 patch with a port limit patch (01030303 to 01030202). In combination with an HDMI audio port+port removal patch it seems to be working fine.
 
Joined
Apr 2, 2017
Messages
81
Motherboard
Lenovo IdeaPad 700-15ISK(Clover)
CPU
i5 6300hq
Graphics
HD530+950m(Disabled) 1920*1080
HD530 0X19160000 I removed minStolenSize patch, with 0x19160000/etc, 19MB framebuffer 9MB cursor bytes (credit RehabMan) patches perfect use
 
Last edited:
Joined
Apr 25, 2017
Messages
19
Mac
MacBook Pro
Mobile Phone
iOS
Overview

A common problem with Broadwell/Skylake/KabyLake is relatively small DVMT-prealloc setting by PC OEMs. The Apple framebuffer kexts generally assume 64mb or larger, and most PC OEMs use only 32mb. And often, there is no way to change it easily due to limited BIOS, locked down BIOS, etc.

Note: For more information regarding changing DVMT-prealloc, see FAQ.
https://www.tonymacx86.com/threads/faq-read-first-laptop-frequent-questions.164990/
I use the Hp870-076 desktop
Igpu: HD530
Gpu:R9390x

my ami bios no igpu vram option! my god

try install Sierra 10.12.4

first ,i disable Igpu,try many methods,R9390x dont boot.
so find others posts: enable igpu to primary
but i cant set the hd530 pre-os share memory ,because bios no that option.i already flash the bios with hp support.
the hd530 dont boot too!

so ,i try minStolenSize patch like below:

<key>Find</key>
<data>
4139c4762a
</data>
<key>Name</key>
<string>AppleIntelSKLGraphicsFramebuffer</string>
<key>Replace</key>
<data>
4139c4eb2a
</data>

follow,work this post method :

<key>Comment</key>
<string>0x19120000, 19MB framebuffer 9MB cursor bytes (credit RehabMan)</string>
<key>Disabled</key>
<false/>
<key>Name</key>
<string>AppleIntelSKLGraphicsFramebuffer</string>
<key>Find</key>
<data>AQMDAwAAIAIAAFAB</data>
<key>Replace</key>
<data>AQMDAwAAMAEAAJAA</data>

but dont work too,boot always like this:
IMG_0405.JPG
how can i continue ? for two weeks try
 

Attachments

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,259
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
so ,i try minStolenSize patch like below:

<key>Find</key>
<data>
4139c4762a
</data>
<key>Name</key>
<string>AppleIntelSKLGraphicsFramebuffer</string>
<key>Replace</key>
<data>
4139c4eb2a
</data>
Wrong.
<data> items must be in base64.
Use a plist editor to avoid being confused...

follow,work this post method :

<key>Comment</key>
<string>0x19120000, 19MB framebuffer 9MB cursor bytes (credit RehabMan)</string>
<key>Disabled</key>
<false/>
<key>Name</key>
<string>AppleIntelSKLGraphicsFramebuffer</string>
<key>Find</key>
<data>AQMDAwAAIAIAAFAB</data>
<key>Replace</key>
<data>AQMDAwAAMAEAAJAA</data>

but dont work too,boot always like this:
View attachment 254170
how can i continue ? for two weeks try
The config.plist with that patch shows Graphics/Inject/Intel=false. Must be true.
And as per post #1, you must first boot with an invalid ig-platform-id (0x12345678), then rebuild cache, then boot with the valid ig-platform-id.
Read post #1. Carefully.
 
Joined
Apr 25, 2017
Messages
19
Mac
MacBook Pro
Mobile Phone
iOS
Wrong.
<data> items must be in base64.
Use a plist editor to avoid being confused...



The config.plist with that patch shows Graphics/Inject/Intel=false. Must be true.
And as per post #1, you must first boot with an invalid ig-platform-id (0x12345678), then rebuild cache, then boot with the valid ig-platform-id.
Read post #1. Carefully.
thanks point my mistakes.
I correct config.plist like
<key>Comment</key>
<string>minStolenSize patch</string>
<key>Find</key>
<data>
QTnEdio=
</data>
<key>Name</key>
<string>AppleIntelSKLGraphicsFramebuffer</string>
<key>Replace</key>
<data>
QTnE6yo=
</data>
but , still reboot like before.


then , I try this post method, first invalid ig-platforn-id 0x12345678,reboot,change 0x19120000,reboot
still not work.


Interestingly, when use 0x12345678, can into the install process like below:

IMG_0409.JPGIMG_0410.JPGIMG_0412.JPG
when install complete,try above every methods,cannot boot the installed sierra,always various boot panic crash :IMG_0416.JPG
 

Attachments

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,259
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
thanks point my mistakes.
I correct config.plist like
<key>Comment</key>
<string>minStolenSize patch</string>
<key>Find</key>
<data>
QTnEdio=
</data>
<key>Name</key>
<string>AppleIntelSKLGraphicsFramebuffer</string>
<key>Replace</key>
<data>
QTnE6yo=
</data>
but , still reboot like before.


then , I try this post method, first invalid ig-platforn-id 0x12345678,reboot,change 0x19120000,reboot
still not work.


Interestingly, when use 0x12345678, can into the install process like below:

View attachment 254608View attachment 254612View attachment 254615
when install complete,try above every methods,cannot boot the installed sierra,always various boot panic crash :View attachment 254617
You cannot use this patch for the installer.
This is a post-install task.
 
Joined
Apr 25, 2017
Messages
19
Mac
MacBook Pro
Mobile Phone
iOS
i install completely use the only way with invalid id 0x12345678 in installer.
no other methods make the installer into the install process picture.

now ,it's post-install. but no way boot up,always panic.
 
Joined
Apr 25, 2017
Messages
19
Mac
MacBook Pro
Mobile Phone
iOS
You cannot use this patch for the installer.
This is a post-install task.
i install completely use the only way with invalid id 0x12345678 in installer.
no other methods make the installer into the install process picture.

now ,it's post-install. but no way boot up,always panic.
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,259
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
i install completely use the only way with invalid id 0x12345678 in installer.
no other methods make the installer into the install process picture.
As expected.

now ,it's post-install. but no way boot up,always panic.
In post-install, must boot with invalid ig-platform-id, then rebuild cache, then reboot with patch active.
Make sure you're using an invalid ig-platform-id, not an invalid FakeID (the two are not the same).
Must rebuild cache with Terminal (see FAQ).
 
Top