Adding/Using HiDPI custom resolutions

Discussion in 'Mavericks Laptop Support' started by RehabMan, May 25, 2014.

  1. RehabMan

    RehabMan Moderator

    Joined:
    May 3, 2012
    Messages:
    180,811
    Motherboard:
    Intel DH67BL
    CPU:
    Core i7-2600K
    Graphics:
    Intel HD 3000
    Mac:
    MacBook Air
    Mobile Phone:
    iOS
    May 25, 2014 at 5:40 PM #1
    RehabMan

    RehabMan Moderator

    Joined:
    May 3, 2012
    Messages:
    180,811
    Motherboard:
    Intel DH67BL
    CPU:
    Core i7-2600K
    Graphics:
    Intel HD 3000
    Mac:
    MacBook Air
    Mobile Phone:
    iOS
    I've tried to do this quite a few times. My 4540s has a 15" 1920x1080p monitor. Most of the time, I can work close enough to the display such that the text is not too small. But sometimes, it would be useful to work at 1600x900. Unfortunately, if you use a normal scaled resolution at 1600x900 the text is not as crisp. It would be great to use Apple's HiDPI tech to get better scaling.

    Same thing goes for my Lenovo u430 with 1600x900 14" display. Sometimes it would be great to use 1440x810 instead. The result is not retina clarity, but it isn't bad... This post will use my Lenovo u430 as an example.

    I've tried a number of methods as documented in the following threads, but they've always come up short and don't really work. The problem is they rely on SwitchResX to add the resolutions which is fairly buggy and will not add all resolutions consistently. SwitchResX works great for selecting modes not available in SysPrefs->Displays, but not so good for adding custom resolutions.

    http://forums.macrumors.com/showthread.php?t=1568657
    http://www.tonymacx86.com/graphics/...na-hidpi-resolution-your-desktop-display.html
    http://www.insanelymac.com/forum/to...na-hidpi-resolution-for-your-desktop-display/

    In addition, they have you extracting EDID and other unnecessary tasks...

    The other day, I borrowed a friend's MacBookPro11,2 with retina display. I did a little poking around, and in particular, I grabbed the display override plist for the built-in retina display. Looking at that file and experimenting with it gave me the information needed to add your own custom resolutions to our own display plist. There are some quirks, but it works...

    First step is you must enable HiDPI mode:
    Code (Text):

    sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool YES
    sudo defaults delete /Library/Preferences/com.apple.windowserver DisplayResolutionDisabled
     
    Note: I did not have to do the second one.

    Note: For 10.11.0 and later, the location of the display overrides have changed. They are now at
    /System/Library/Displays/Contents/Resources/Overrides. If you are running 10.11 or later, make sure you substitute the new path as appropriate.

    Next, determine your vendor-id and product-id of your display. This is available from ioreg. Using IORegistryExplorer, look under your display under your graphics device:

    Screen Shot 2014-05-25 at 9.09.18 AM.png

    Your ids are DisplayVendorID and DisplayProductID. The hex values here determine where in /System/Library/Displays/Overrides, you create the directory/plist file. If the file already exists, you should edit the existing file (copy it to your Desktop for editing).

    In my case, the vendor-id is 0xdae, so I need to create a directory (it may already be present):
    Code (Text):

    sudo mkdir /System/Library/Displays/Overrides/DisplayVendorID-dae
     
    Next, create your plist file. I create it on my desktop and then copy it to the overrides folder later. the file name should be named after your product id. In my case the product-id is 0x1482, so the name will be DisplayProductID-1482.plist. I name it with extension plist to make it easy to open the file. The starting contents should look like this:
    Code (Text):

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>DisplayProductName</key>
        <string>Lenovo u430 Display</string>
        <key>DisplayProductID</key>
        <integer>5250</integer>
        <key>DisplayVendorID</key>
        <integer>3502</integer>
        <key>scale-resolutions</key>
        <array>
        </array>
    </dict>
    </plist>
     
    The DisplayProductName can be whatever you like. Note that DisplayProductID and DisplayVendorID must be converted from hex to decimal for the plist.

    Next step is to add your custom resolution(s). Open the plist that is now on your desktop in a plist editor (I use xcode), and then add your custom resolutions under scale-resolutions.

    You must add two resolutions for each custom resolution you'd like. My native display on this laptop is 1600x900, so I'm going to add two custom resolutions 1366x768 and 1440x810. Note how the resolutions are carefully chosen to reflect a 16:9 aspect ratio. Custom resolutions are array entries under scale-resolutions that have type Data and have two 32-bit values. The values are in natural byte-order (big-endian/Motorola byte-order, not little-endian or Intel byte order). 1366x768 would be:
    Code (Text):

    <00000556 00000300>
     
    Note that the value you enter here are in hex. 0x556 is 1366 and 0x300 is 768.

    In order to make it HiDPI capable, you must also add another scaled resolution at twice the custom resolution above, so... 2732x1536. Converted to Data hex format:
    Code (Text):

    <00000aac 00000600 00000001>
     
    With these two entries, it looks like this in the xcode plist editor:
    Screen Shot 2014-05-25 at 9.25.54 AM.png

    You can test this plist now by copying it and rebooting:
    Code (Text):

    cd ~/Desktop
    sudo cp DisplayProductID-1482.plist /System/Library/Displays/Overrides/DisplayVendorID-dae/DisplayProductID-1482
     
    Note that the destination in Displays/Overrides does not have a plist extension.

    After that you can restart:
    Code (Text):

    sudo reboot
     
    You can now access the HiDPI resolution of 1366x768 in SysPrefs->Displays.

    Curious things start to happen if you add multiple new HiDPI resolutions. There seems to be some filtering going on in SysPrefs->Displays. Resolutions which are 'close' to each other are filtered out and only one is shown if they are close (eg. 1366x768 either/or 1440x810).

    On the Probook (1080p native), if you add 1440x810, it will override the 1366x768, but on the Lenovo u430 (900p native), the 1366x768 seems to override 1440x810:
    Screen Shot 2014-05-25 at 9.30.17 AM.png

    If you run SwitchResX with both installed you'll be able to select either one and activate it even though both are not available in SysPrefs->Displays. SysPrefs->Displays is filtering the resolutions in a way that SwitchResX is not. Note that using SwitchResX to add these resolutions does not work most of the time. You must edit the plist directly.

    On my 4540s I was able to add both 1600x900 and 1440x810 (or 1366x768). In that case, the system showed both 1600x900 and the 1440x810 (or 1366x768) but not the 1440x810 and 1366x768 at the same time. Thus why I say the system is filtering resolutions that are close to each other.

    Just for clarification, this is what my plist looks like (in text) for both 1366x768 and 1440x810 (Data values are encoded base64):
    Code (Text):

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>DisplayProductName</key>
        <string>Lenovo u430 Display</string>
        <key>DisplayProductID</key>
        <integer>5250</integer>
        <key>DisplayVendorID</key>
        <integer>3502</integer>
        <key>scale-resolutions</key>
        <array>
            <data>AAALQAAABlQ=</data>
            <data>AAAFoAAAAyo=</data>
            <data>AAAKrAAABgA=</data>
            <data>AAAFVgAAAwA=</data>
        </array>
    </dict>
    </plist>
     
    Adding custom HiDPI resolutions should prove very useful for screens which have very high resolution (retina class) or even moderate resolution on small screens (1080p on 13" or under).

    You will notice some performance degradation when running a scaled resolution like this. This is because the system is rendering to the high-resolution frame buffer (at twice the size), then scaling down to the native resolution of the display (that part is probably done in hardware).

    Automatic tool

    I have not tried this tool, but there is a web based program that can generate a display override plist for you.

    Refer to the post (#222) in this thread for a link: http://www.tonymacx86.com/threads/adding-using-hidpi-custom-resolutions.133254/page-23#post-1271885
     
    Lexstar, cbm64 and GhostHitWall like this.
    Last edited: Jan 11, 2017
  2. Side.Step.Society

    Side.Step.Society

    Joined:
    Dec 8, 2013
    Messages:
    2
    Jan 29, 2015 at 7:05 AM #2
    Side.Step.Society

    Side.Step.Society

    Joined:
    Dec 8, 2013
    Messages:
    2
    Why am I the first person to reply to this thread?! This is beautiful!

    So glad to not have to use SwitchResX. Wonderful guide, RehabMan! The only issue I ran into was my HiDPI resolution wasn't appearing in Display preferences. I instead used RDM to show me all available HiDPI resolutions and was in the money!

    Thanks a bunch! :thumbup:

    [​IMG]
     
    firecall likes this.
  3. RehabMan

    RehabMan Moderator

    Joined:
    May 3, 2012
    Messages:
    180,811
    Motherboard:
    Intel DH67BL
    CPU:
    Core i7-2600K
    Graphics:
    Intel HD 3000
    Mac:
    MacBook Air
    Mobile Phone:
    iOS
    Jan 29, 2015 at 3:52 PM #3
    RehabMan

    RehabMan Moderator

    Joined:
    May 3, 2012
    Messages:
    180,811
    Motherboard:
    Intel DH67BL
    CPU:
    Core i7-2600K
    Graphics:
    Intel HD 3000
    Mac:
    MacBook Air
    Mobile Phone:
    iOS
    Hold Option down when you click "Scaled" and more resolutions show up.
     
  4. Side.Step.Society

    Side.Step.Society

    Joined:
    Dec 8, 2013
    Messages:
    2
    Jan 30, 2015 at 5:09 AM #4
    Side.Step.Society

    Side.Step.Society

    Joined:
    Dec 8, 2013
    Messages:
    2
    Tried that previously and no luck. :(
     
  5. siddsimac

    siddsimac

    Joined:
    May 5, 2013
    Messages:
    325
    Motherboard:
    Sony VAIO E Series SVE15127CNB(Clover)
    CPU:
    i5-3210M
    Graphics:
    HD 7650M
    Mac:
    MacBook Pro
    Mobile Phone:
    iOS
    Jan 30, 2015 at 5:40 AM #5
    siddsimac

    siddsimac

    Joined:
    May 5, 2013
    Messages:
    325
    Motherboard:
    Sony VAIO E Series SVE15127CNB(Clover)
    CPU:
    i5-3210M
    Graphics:
    HD 7650M
    Mac:
    MacBook Pro
    Mobile Phone:
    iOS
    RehabMan yes u r right performance degrades if i use Display Override file !
    I was having gradient issue, i solved it using Custom EDID(80 -> 90).

    So which is better !
    Kext or Override File, coz in ioreg its still showing the native edid but Gradient is solved.
    while using kext it shows the Modified EDID !
     
  6. RehabMan

    RehabMan Moderator

    Joined:
    May 3, 2012
    Messages:
    180,811
    Motherboard:
    Intel DH67BL
    CPU:
    Core i7-2600K
    Graphics:
    Intel HD 3000
    Mac:
    MacBook Air
    Mobile Phone:
    iOS
    Jan 30, 2015 at 6:36 AM #6
    RehabMan

    RehabMan Moderator

    Joined:
    May 3, 2012
    Messages:
    180,811
    Motherboard:
    Intel DH67BL
    CPU:
    Core i7-2600K
    Graphics:
    Intel HD 3000
    Mac:
    MacBook Air
    Mobile Phone:
    iOS
    More will show up, but perhaps not all.
     
  7. RehabMan

    RehabMan Moderator

    Joined:
    May 3, 2012
    Messages:
    180,811
    Motherboard:
    Intel DH67BL
    CPU:
    Core i7-2600K
    Graphics:
    Intel HD 3000
    Mac:
    MacBook Air
    Mobile Phone:
    iOS
    Jan 30, 2015 at 6:37 AM #7
    RehabMan

    RehabMan Moderator

    Joined:
    May 3, 2012
    Messages:
    180,811
    Motherboard:
    Intel DH67BL
    CPU:
    Core i7-2600K
    Graphics:
    Intel HD 3000
    Mac:
    MacBook Air
    Mobile Phone:
    iOS
    Not sure what you mean "kext or override file"?

    You can inject EDID with DSDT. No need to use a kext or override...
     
  8. siddsimac

    siddsimac

    Joined:
    May 5, 2013
    Messages:
    325
    Motherboard:
    Sony VAIO E Series SVE15127CNB(Clover)
    CPU:
    i5-3210M
    Graphics:
    HD 7650M
    Mac:
    MacBook Pro
    Mobile Phone:
    iOS
    Jan 30, 2015 at 7:23 AM #8
    siddsimac

    siddsimac

    Joined:
    May 5, 2013
    Messages:
    325
    Motherboard:
    Sony VAIO E Series SVE15127CNB(Clover)
    CPU:
    i5-3210M
    Graphics:
    HD 7650M
    Mac:
    MacBook Pro
    Mobile Phone:
    iOS
    Generic with EDID Patch !
     
  9. RehabMan

    RehabMan Moderator

    Joined:
    May 3, 2012
    Messages:
    180,811
    Motherboard:
    Intel DH67BL
    CPU:
    Core i7-2600K
    Graphics:
    Intel HD 3000
    Mac:
    MacBook Air
    Mobile Phone:
    iOS
    Jan 30, 2015 at 8:21 AM #9
    RehabMan

    RehabMan Moderator

    Joined:
    May 3, 2012
    Messages:
    180,811
    Motherboard:
    Intel DH67BL
    CPU:
    Core i7-2600K
    Graphics:
    Intel HD 3000
    Mac:
    MacBook Air
    Mobile Phone:
    iOS
    Yes, that is the patch in my repo ... "Generic with EDID" to inject EDID (and other graphics properties) via DSDT. What is the question?
     
  10. siddsimac

    siddsimac

    Joined:
    May 5, 2013
    Messages:
    325
    Motherboard:
    Sony VAIO E Series SVE15127CNB(Clover)
    CPU:
    i5-3210M
    Graphics:
    HD 7650M
    Mac:
    MacBook Pro
    Mobile Phone:
    iOS
    Jan 30, 2015 at 8:28 AM #10
    siddsimac

    siddsimac

    Joined:
    May 5, 2013
    Messages:
    325
    Motherboard:
    Sony VAIO E Series SVE15127CNB(Clover)
    CPU:
    i5-3210M
    Graphics:
    HD 7650M
    Mac:
    MacBook Pro
    Mobile Phone:
    iOS
    Where to insert EDID in DSDT !
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice