I have an iMac 5K. In macOS, the maximum resolution was 5120 x 2880, displayed as 2560 x 1440 HiDPI.
I've installed Ubuntu 16.04 Desktop, dual-booting using rEFInd. However, rEFInd displays at 3840 x 2160 resolution, and both Ubuntu and macOS as loaded by rEFInd are limited to this resolution as well.
Clearing the iMac's NVRAM reverts back to the standard Apple boot manager which loads macOS at 5120 x 2880 again, but doesn't recognise Ubuntu as an option. Clearing just the display-options key from NVRAM keeps rEFInd booting, but doesn't increase the resolution.
I tried setting a new resolution in rEFInd's configuration, but the only available mode reported is 3840 x 2160.
This discussion indicates that rEFInd isn't necessarily to blame, so I've tried Frankenstein-ing in the CsmVideoDxe.efi driver from Clover, which supposedly increases the available range of resolutions but it had no noticeable effect.
I'm afraid to go any deeper on my own as I don't want to end up with an unbootable iMac. What can I try next?
Edit: Tried two further things. 1) Clearing NVRAM to use Apple default boot loader then running GRUB from Ubuntu Live USB still limited the resolution, so it's definitely not rEFInd. 2) Setting the spoof_osx_version property in rEFInd's configuration to either 10.9 or 10.12 also had no effect.