Jump to content
PayPal donations: [email protected] ×
EMlyDinEsH

Guide for enabling VGA, DVI, DP and HDMI in Intel HD4000 GPU

Recommended Posts

The mobile HiRes framebuffer 0x01660004 only carries 1 x output port by default (LVDS). It must therefore be patched to support additional video outputs and HDMI audio:
 
In the case of Sierra 10.12, the vanilla framebuffer 0x01660004 is defined as follows:

04006601 01030101 00000002     // 1 x display output port
00000001 00000060 10070000
10070000 00000000 60290400
00000000 00000000 00000000
05030000 02000000 30020000     // LVDS port
00000000 01000000 40000000
00000000 01000000 40000000
00000000 01000000 40000000
00000000 00000000 00000000

and, building on the patch for LoRes FB 0x01660003, it can be patched to this:

04006601 01020402 00000004     // /!\ patch: 4 x display output port
00000001 00000060 10070000     // *** unmodified ***
10070000 00000000 60290400     // *** unmodified ***
00000000 00000000 00000000     // *** unmodified ***
05030000 02000000 30020000     // *** unmodified *** LVDS
02050000 00080000 07040000     // /!\ patch: HDMI (for audio)
03040000 00040000 81000000     // /!\ patch: DP/DVI (untested)
04060000 00040000 81000000     // /!\ patch: DP/DVI (untested)
00000000 00020011 00000000     // /!\ patch

:excl: The patch is not a mirror copy or copy/paste of the contents of the LoRes FB. In particular, it's critical to leave the LVDS port definition unchanged (code line starting with 05030000...).
 
In a nutshell, the AppleIntelFramebufferCapri patch consists of:

Find:    040066010103010100000002
Replace: 040066010102040200000004

+

Find:    0503000002000000300200000000000001000000400000000000000001000000400000000000000001000000400000000000000000000000
Replace: 0503000002000000300200000205000000080000070400000304000000040000810000000406000000040000810000000000000000020011
  • Like 1

Share this post


Link to post
Share on other sites

Toleda's scripts were for Desktop layouts. But feel free to adapt the perl commands. But this is off-topic since the whole essence of this guide was to explain how to patch the Capri framebuffer.

Share this post


Link to post
Share on other sites

Better later than never... As explained in past system/model-specific threads, there are further patches that may be used to modify the framebuffer memory size (useful on Latitude E6x30) and the VRAM allocation (nice to increase).

 

Those parameters are defined in the 2nd line of the sample Capri layouts we've illustrated throughout this thread (bearing in mind the reversed byte order of kexts' binary code). For instance:

  • LoRes mobile layout 0x01660003:
03006601 01020402 00000004
00000001 00000060 10070000
  • HiRes mobile layout 0x01660004:
04006601 01030101 00000002
00000001 00000060 10070000
  • Desktop layout 0x0166000a:
0A006601 00020302 00000002
00000001 00000060 10070000
  • Desktop layout 0x0166000b:
0B006601 00020302 00000002
00000001 00000060 10070000

 

1) Framebuffer memory size:

This is defined in the 4th 32bit parameter of the layouts. Default value is 0x01000000 (reversed code 00000001), i.e. 16777216 in decimal which, when divided by 1024*1024 (=1MBytes), equates to 16MB. Some laptops such as the Dell Latitude E6x30 models suffer from corrupt/garbled display on screen unless this value is reduced to 8MB, i.e. 0x00800000. The patch required to change this is:

Find:   xxxxxxxx [...] xxxxxxxx 00000001 xxxxxxxx [...] xxxxxxxx
Replace xxxxxxxx [...] xxxxxxxx 00008000 xxxxxxxx [...] xxxxxxxx

For instance, to reduce the FB mem. size of layout 0x01660003 to 8MB, use this patch:

                                     \/\/
Find:    03006601010204020000000400000001
Replace: 03006601010204020000000400008000
                                     /\/\

 

2) VRAM allocation:

This is defined in the 5th 32bit parameter of the layouts. In most recent versions of OS X/macOS, the default value usually is 0x60000000 (reversed code 00000060), i.e. 1610612736 in decimal which, when divided by 1024*1024 (=1MBytes), equates to 1536MB (i.e. 1.5GB). This is shared memory and systems with, say, 8GB of RAM, may want to increase this. The patch required to do this is:

Find:   xxxxxxxx [...] xxxxxxxx 00000060 xxxxxxxx [...] xxxxxxxx
Replace xxxxxxxx [...] xxxxxxxx 000000YY xxxxxxxx [...] xxxxxxxx    -> where YY = desired VRAM Qty

Reminder:

  •   256MB = 1000 0000 in hex
  •   384MB = 1800 0000 in hex 
  •   512MB = 2000 0000 in hex
  •   768MB = 3000 0000 in hex
  • 1024MB = 4000 0000 in hex
  • 1536MB = 6000 0000 in hex
  • 1792MB = 7000 0000 in hex
  • 2048MB = 8000 0000 in hex

 

For instance, to increase VRAM allocation of layout 0x01660003 to 2048MB (i.e. 2GB), use this patch:

                                               \/
Find:    0300660101020402000000040000000100000060
Replace: 0300660101020402000000040000000100000080
                                               /\

     

    Naturally, those framebuffer modifications can be combined in a single patch. For instance, to reduce FB mem. size to 8MB and increase VRAM to 2GB, layout 0x01660003 is patched as follows:

                                         \/\/      \/
    Find:    030066010102040200000004000000010000006010070000
    Replace: 030066010102040200000004000080000000008010070000
                                         /\/\      /\

     

    • Like 2

    Share this post


    Link to post
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Reply to this topic...

    ×   Pasted as rich text.   Restore formatting

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    Loading...

    ×
    ×
    • Create New...