Jump to content
Hervé

Enabling DVI/DP/HDMI and increasing VRAM with Intel Haswell/4th gen HD4200/4400/4600/etc. iGPU

Recommended Posts

Last updated: 27 Aug 2017
 
This guide is a follow-up to similar work previously posted by EmlyDinesh for HD3000 and HD4000. It is based on the excellent research work published by many other well-known Hackintosh gurus such as Pike R Alpha, Toleda, RampageDev, Rehabman and several others (whose name eludes me and for which I apologize) and for which they must be once again thanked. Their work is readily available through a Google search with keywords that include "Azul", "Framebuffer", "HD4x00", etc (brain usage is expected here). I did not do anything other than study this existing literature and experiment with the Intel HD4600 fitted to my Dell Latitude E6440 laptop (SMBIOS MBP11,1 Profile) in order to gain DVI output off an E-Port Plus/PRO2X docking station/port replicator, having previously obtained HDMI output through a binary patch handed over to me (a patch I wanted to understand). The E6440 comes fitted with a VGA port + a HDMI port. This being stated, the information below should be considered as that -experimentation results- and guidance for experimentations for those seeking to gain DVI, DP or HDMI video output on their Haswell GPU-based Hackintosh.

Haswell integrated GPUs include Intel HD (4th gen)/HD 4200/HD 4400/HD 4600/HD P4600/HD P4700/HD 5000 as well as Iris 5100/5200. In OS X, display ports are managed by the framebuffer (FB) kext and for the Haswell family, we're talking about AppleIntelFramebufferAzul.kext (Azul FB). The Azul FB binary file contains various tables associated with each layout, each being identified by its own id (layout-id/ig-platform-id/ etc.) and, usually, about 7 x 16bytes long (I'm not 100% certain of the specific table length and end for each layout). These FB layout ids are the values that most of us have to inject in DSDT or bootloader setup to obtain full graphics acceleration, for instance 0x0600260a for laptops or 0x0300220d for desktops.
 
1) Azul framebuffer analysis / layout ids
 
Let's look at a few tables of El Capitan 10.11.3 Azul FB kext (latest at time of writing), including those specific to the above 2 ids. Using a Hex editor, they're found at offsets 48xxx/49xxx. The 1st 4 x bytes identify the layout id and the rest includes data such as number of ports, VRAM allocation, framebuffer index, port index, connector types, activation delays, etc..
 
The layout details are available in the attached extract:
EC_10.11.03_AzulFB_layouts.zip
 
The 1st layout is found at Offset 48CD0:
0000 060C 0003 0303 0000 0004 0000 0001          layout id
0000 F000 0000 0040 9914 0000 9914 0000          VRAM allocation
0000 0000 0000 0000 0000 0800 0200 0000          framebuffer index / port number

3000 0000 0105 0900 0400 0000 0400 0000          ??? (priority?)
0204 0900 0008 0000 8200 0000 FF00 0000          connector-type
0100 0000 4000 0000 0400 0000 0000 0700          activation delay
0400 0000 0000 0000 0000 0000 0000 0000
...
...
...
 
At Offset 49130, we have:
0600 260A 0103 0303 0000 0002 0000 3001          layout id (usual layout for mobile HD4600 Hackintosh)
0000 6000 0000 0060 D90A 0000 D90A 0000          VRAM allocation
0000 0000 0000 0000 0000 0800 0200 0000          framebuffer index / port number

3000 0000 0105 0900 0004 0000 8700 0000          ??? (priority?)
0204 0900 0004 0000 8700 0000 FF00 0000          connector-type
0100 0000 4000 0000 0F00 0000 0101 0000          activation delay
0400 0000 0000 0000 0E00 0000 0000 0000
...
...
...
 
At Offset 492F0, we have:
0300 220D 0003 0303 0000 0002 0000 3001          layout id (usual layout for desktop HD4600 Hackintosh)
0000 0000 0000 0060 9914 0000 9914 0000          VRAM allocation
0000 0000 0000 0000 0105 0900 0004 0000          framebuffer index / port number

8700 0000 0204 0A00 0004 0000 8700 0000          ??? (priority?)
0306 0800 0004 0000 1100 0000 FF00 0000          connector-type
0100 0000 4000 0000 0204 0000 0101 0000          activation delay
0400 0000 0000 0000 0E00 0000 0000 0000
...
...
...
 
What interests us here, in the matter of display output ports, are the above highlighted parameters.
 
* In terms of framebuffer indexes, they appear to range from 0 to 3, depending on mobile or desktop GPU version, 0 looking reserved for built-in LCDs. We also notice that each layout caters for 3 x ports only, each framebuffer/port-related line beginning with a similar form made of a pair of bytes:

  • 0000 ... for framebuffer #0 / port #0
  • 0105 ... for framebuffer #1 / port #5
  • 0204 ... for framebuffer #2 / port #6
  • 0306 ... for framebuffer #4 / port #7

* In terms of "priority", I've read that the byte right after the FB index apparently operates in conjunction with the activation delay: when 2 ports have an identical "priority" value, the port with the highest delay takes precedence, thereby disabling the other. If ports have their own unique "priority", they will be all enabled/available. I'll have to try to hook DVI + HDMI at the same time to confirm this behaviour.
 
* In terms of connector-type, there are several known values:

  • 0100 0000 for VGA
  • 0200 0000 for LVDS (built-in LCD of laptops)
  • 0400 0000 for eDP (built-in LCD of laptops)
  • 0002 0000 for DVI
  • 0004 0000 for DP
  • 0008 0000 for HDMI

 

When using the vanilla Azul FB kext, my E6440 reports the following in IOReg:
AppleIntelFramebuffer@0 (built-in LVDS display showing attached to this)

  • port-number: 0x0
  • connector-type: 02 00 00 00

AppleIntelFramebuffer@1

  • port-number: 0x5
  • connector-type: 04 00 00 00

AppleIntelFramebuffer@2

  • port-number: 0x6
  • connector type: 04 00 00 00

 

One could easily imagine a direct translation of the FB index + its adjacent byte in the layout tables with the display port number as reported in IOReg; that'd be incorrect, as stated in the existing literature. If, indeed, the layout id tables show pairs "00 00" for port #0 and "01 05" for port #5, one would quickly notice that pair "02 04" translate to port #6 and pair "03 06" to port #7.
 
 
2) HDMI and DVI display output
 
When experimenting with my mobile HD 4600-based Latitude E6440, no HDMI output was obtained OOB with the vanilla Azul FB kext. In fact, the laptop immediately crashed the moment a HDMI cable was hot-plugged. It would not even boot with a HDMI cable plugged in.

However, HDMI works perfectly after applying the binary patch to the kext where the hex string 01050900 00040000 87000000 is replaced by 01051200 00080000 87000000.
 
We can see that this patch modifies:
a) the (priority?) byte right after id
2) the connector type
 
In IOReg, the HDMI display showed attached to FB index #1 with port-number 0x5 and connector-type 0008 0000.

We can see that, in the vanilla kext, FB indexes #1 and #2 of layout id 0x0600260A use the same (priority?) byte after the id, the same activation delay and the same connector-type.
 
Building on the gathered technical information from the literature and the above observations, I tried to enable the DVI port off my docking station to use a 2nd DVI screen (lack of VGA support oblige). I first applied the following patch to layout id 0600260A located at offset 49130, keeping the above HDMI patch untouched.
before: 02040900 00040000 87000000 FF000000
after:   02040900 00020000 87000000 FF000000
 
This failed to enable DVI output off my E-Port Plus. I then tried to adjust other parameter such as (priority?) byte after id and activation delay, to no avail. Keeping in mind the availability of framebuffer index #3, I then applied the following patch, again leaving the HDMI patch untouched:
before: 02040900 00040000 87000000 FF000000
after:   03060900 00020000 87000000 FF000000
 
This proved successful and brought me DVI output off the E-Port Plus/PRO2X :). However, HDMI appeared broken as system froze as soon as HDMI cable got plugged in.
 
After several adjustments of the (priority?) byte after id, HDMI and DVI outputs are obtained when the byte is set to 12 for both ports. This makes for the following Azul FB binary patch:
 
At Offset 49130, patch vanilla table:
0600 260A 0103 0303 0000 0002 0000 3001
0000 6000 0000 0060 D90A 0000 D90A 0000
0000 0000 0000 0000 0000 0800 0200 0000     ; FB index #0/port #0, connector-type LVDS
3000 0000 0105 0900 0004 0000 8700 0000     ; FB index #1/port #5, connector-type DP
0204 0900 0004 0000 8700 0000 FF00 0000     ; FB index #2/port #6, connector-type DP
0100 0000 4000 0000 0F00 0000 0101 0000
0400 0000 0000 0000 0E00 0000 0000 0000
 
to:
0600 260A 0103 0303 0000 0002 0000 3001
0000 6000 0000 0060 D90A 0000 D90A 0000
0000 0000 0000 0000 0000 0800 0200 0000     ; FB index #0/port #0, connector-type LVDS
3000 0000 0105 1200 0008 0000 8700 0000     ; sets connector-type to HDMI
0306 1200 0002 0000 8700 0000 FF00 0000     ; sets FB index to 3/port #7 and connector-type to DVI
0100 0000 4000 0000 0F00 0000 0101 0000
0400 0000 0000 0000 0E00 0000 0000 0000
 

E6440_DVI_output.jpg 
 
That exact same patch is also applicable to Yosemite and Mavericks as well as Sierra.

 

Edit: 14-May-2018

  • removed 10.13's vanilla + patched Azul kext attachments since some people kept trying to use those in other OS X/macOS versions (unsuccessfully of course...).
  • Like 6

Share this post


Link to post
Share on other sites

For DP output, framebuffer #2 (port #6) should be kept (as expected). The prority (?) byte just needs to be set to 12.

 

The patch is as follows:

0600 260A 0103 0303 0000 0002 0000 3001
0000 6000 0000 0060 D90A 0000 D90A 0000
0000 0000 0000 0000 0000 0800 0200 0000     ; FB index #0/port #0, connector-type LVDS
3000 0000 0105 1200 0008 0000 8700 0000     ; sets connector-type to HDMI

0204 1200 0004 0000 8700 0000 FF00 0000     ; sets DP priority(?) to 12
0100 0000 4000 0000 0F00 0000 0101 0000
0400 0000 0000 0000 0E00 0000 0000 0000

  • Like 1

Share this post


Link to post
Share on other sites

You can patch the Sierra kext in the exact same way for HDMI. However, I must warn that I've noticed that, since 10.12.3 (can't say for earlier Sierra versions), the DVI patch no longer seems to work for DVI secondary output. My DVI connected screen remains undetected after startup (repeated behaviour off 2 x different types of docking station/port extender). I can only get DVI output by booting my laptop with lid closed, i.e. with single display output to DVI.

 

Of course, you can experiment Sierra with pre-patched kexts from El Capitan but, having never tested this, I cannot state whether this is likely to work or not. I believe you'll probably meet dependancies issues. As such, exert all usual and obvious precautionary steps.

 

Edit: 05 Sep2018

DVI output recovered in Sierra and High Sierra with AppleGraphicsDevicePolicy kext patch as described on p5.

Share this post


Link to post
Share on other sites

@Hervé

Sir,What about hd4400 mobile (laptop) VGA support.I only have a VGA output with my vostro 3546 hackintosh sierra.I plan to buy a led with VGA .Is there patch for VGA connector possible or only DVI.Thanks

Share this post


Link to post
Share on other sites

No official support for VGA output on HD4600 & family and no known working patches either. That's why VGA is not even mentioned in the title of the thread.

 

However, I've heard & seen a couple of HD4400 laptops for which VGA output worked OOB. From memory, these were dual-GPU models (Haswell Intel HD + NVidia). You'll find related topics at InsanelyMac. If you're up to it, feel free to experiment with VGA patches yourself using the information above.

Share this post


Link to post
Share on other sites

Further to fresh experiments with VRAM allocation, I can confirm that the 8th byte of the 2nd line of Azul framebuffers/layouts as displayed above (in 8 groups of 4 bytes per line) is for VRAM allocation and can be set as follows:

  • 40 -> 1024MB
  • 60 -> 1536MB
  • 80 -> 2048MB

 

In my case, changing the Azul FB #12/layout 0x0a260006 from this:

0600 260A 0103 0303 0000 0002 0000 3001

0000 6000 0000 0060 D90A 0000 D90A 0000

 

to this:

0600 260A 0103 0303 0000 0002 0000 3001

0000 6000 0000 0080 D90A 0000 D90A 0000

 

increased VRAM from 1536MB to 2048MB.

Share this post


Link to post
Share on other sites

@Hervé

Is there a kexttopatch to increase vram.

Is this gonna help at somewhere ,i mean with such subperformance gpu ,is it worthy more vram ?

Share this post


Link to post
Share on other sites

I don't believe I fully understand your 1st question. If you're asking about the Clover patch, I can only invite you to derive it from your own layout. I'm not going to list the full binary patch for all 16 layouts! I've posted all the necessary info in post #8 to implement the required binary patch as per usual methods. If you've read post #1, I assume you could not possibly be asking which kext is to patch...

 

Is it worth it? I doubt it, I'm pretty sure all systems run fine with default allocation. But someone asked about the increase...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×