Contribute
Register

Adding/Using HiDPI custom resolutions

RehabMan

Moderator
Joined
May 3, 2012
Messages
186,689
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
What is nonsense about this?

Scaling to 2x only to scale back to 1x is nonsense.

I don't need the UI to appear larger I just want it to make use of retina assets ..

Such retina assets cannot be displayed properly on your non-retina display (not without making them twice as large...).
 
Last edited:
Joined
Nov 20, 2016
Messages
1
Hi,
I follow the instructions strictly and everything goes smooth but the last one, or say I couldn't get what it should be.
In SwitchResX, under the custom resolutions, the status of my custom items are just like this, System - only, invalid. I repeated the instructions many times but still couldn't get out 1920*1080 hidpi. Could somebody help me? Really appreciate!
By the way, I use Mac Pro 3,1 with ATI Radeon HD5770. I wonder is the issue related with graphics card or sth?
 
Joined
Jul 17, 2015
Messages
50
Motherboard
P6T Deluxe V2
CPU
Core i7 920 @3,6GHz
Graphics
Palit GeForce GTX 980 Ti Jetstream
Mobile Phone
  1. iOS
Hey, Rehabman,

Thx, has worked for ma as intended!
But as someone mentioned before, I had to change the path under Sierra to /System/Library/Displays/Contents/Resources/Overrides instead of /System/Library/Displays/Overrides.


Hi,
I follow the instructions strictly and everything goes smooth but the last one, or say I couldn't get what it should be.
In SwitchResX, under the custom resolutions, the status of my custom items are just like this, System - only, invalid. I repeated the instructions many times but still couldn't get out 1920*1080 hidpi. Could somebody help me? Really appreciate!
By the way, I use Mac Pro 3,1 with ATI Radeon HD5770. I wonder is the issue related with graphics card or sth?

Why should it be under custom resolutions in SwitchResX?

If u created the file "DisplayProductID-XXX" and moved it in the right directory it should be listed under available resolution and not under custom resolution in SwitchResX.
Hopefully I got you right what you have meaned!
 
Last edited:
Joined
Dec 1, 2016
Messages
1
Motherboard
ASUS Z97-E/USB3.1
CPU
i5-4590
Graphics
GTX 960 SSC 4GB
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 friends 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:
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.

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:

View attachment 93897

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:
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:
<?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:
<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:
<00000aac 00000600 00000001>

With these two entries, it looks like this in the xcode plist editor:
View attachment 93898

You can test this plist now by copying it and rebooting:
Code:
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:
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:
View attachment 93900

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:
<?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

Hey! I went through this guide in macOS Sierra. I have an LG Ultrawide monitor at 2560x1080. I wanted to downscale it to 2048x864, but everything looks blurry even after I followed this guide, and added that resolution and double that (4096x1728) in the plist. It doesn't say 2048x864 HiDPI, it just says that 1280x540 is HiDPI. Any help please?
 
Joined
Nov 21, 2016
Messages
15
I used this guide to add custom HiDPI resolutions with no issues. I have a 2560x1440 screen. In 10.11, I was able to switch to 1920x1080 HiDPI, 1600x900 HiDPI, and 1281x720 HiDPI, no problems at all. However, in 10.12, I am only able to use 1281x720 HiDPI. If I use either 1920x1080 or 1600x900, it will switch properly, but the screen will be garbled and unusable upon wake from sleep. Has anyone encountered a similar issue in Sierra?
 
Joined
Sep 30, 2011
Messages
320
Motherboard
z68x-ud5-b3
CPU
i7 2600k@4,4ghz
Graphics
SLI zotac geforce 570 amp!
Mac
  1. MacBook Pro
Classic Mac
Mobile Phone
  1. iOS
I used this guide to add custom HiDPI resolutions with no issues. I have a 2560x1440 screen. In 10.11, I was able to switch to 1920x1080 HiDPI, 1600x900 HiDPI, and 1281x720 HiDPI, no problems at all. However, in 10.12, I am only able to use 1281x720 HiDPI. If I use either 1920x1080 or 1600x900, it will switch properly, but the screen will be garbled and unusable upon wake from sleep. Has anyone encountered a similar issue in Sierra?
Sadly this procedure stopped working for me since 10.8.3 :(
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
186,689
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
Sadly this procedure stopped working for me since 10.8.3 :(

Nonsense.

It still works, but the display override location changed in 10.11+.
I originally wrote this guide when I was running Mavericks.
 
Joined
Sep 30, 2011
Messages
320
Motherboard
z68x-ud5-b3
CPU
i7 2600k@4,4ghz
Graphics
SLI zotac geforce 570 amp!
Mac
  1. MacBook Pro
Classic Mac
Mobile Phone
  1. iOS
Nonsense.

It still works, but the display override location changed in 10.11+.
I originally wrote this guide when I was running Mavericks.
Sorry I didn't meant this specific guide. I meant display overrides. I could up until 10.8.3 get 1920*1080 in HiDPI (3840*2160), but after apple updated the nvidia graphics drivers and iokit with more restrictions it didn't work. Up until 10.8.5 I could revert the graphics drivers, but after 10.9 it stopped fully.
I know the new location too.
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
186,689
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
Sorry I didn't meant this specific guide. I meant display overrides. I could up until 10.8.3 get 1920*1080 in HiDPI (3840*2160), but after apple updated the nvidia graphics drivers and iokit with more restrictions it didn't work. Up until 10.8.5 I could revert the graphics drivers, but after 10.9 it stopped fully.
I know the new location too.

My tests were with Intel graphics, not Nvidia.
This thread is in the laptop forum where Intel integrated graphics are the graphics device that is commonly used.
Desktop questions here are off-topic.
 

the-braveknight

Moderator
Joined
Nov 24, 2015
Messages
1,222
Motherboard
Lenovo Legion Y520 (Clover)
CPU
i7-7700HQ
Graphics
HD 630 (1920x1080) + Nvidia GTX 1060
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
I could not add the 1600x900 HiDPI resolution no matter how many times I tried...
My native resolution is 1920x1080, and I already have the 1600x900 resolution option, but I would like to use HiDPI.
 
Top