Q:

Screen resolution messed up when upgrading to latest Macbook Air

I have a macbook air 13' from 2013.

I just bought the same model, only newer.

I backup up everything on an external hard drive via time machine on the old mac, then used migration assistant to copy files and configuration to the new mac.
Of course both machines were updated to the latest Yosemite 10.10.3, as Apple suggested.
Things seemed to work smoothly, with a correct copy of everything.
Alas, no. I have an external monitor, which is perfectly recognized on the old mac, correct model and resolution:

But on the new mac, same exact model, just a tiny difference (Intel HD Graphics 6000 1536 MB, instead of Intel HD Graphics 5000 1536 MB), the screen is not recognized at all and the resolution is all messed up.

Been on this for hours.

I tried SwitchResX, didn't help.
I tried using both the official Apple VGA adapter and a third-party. Same results. 
I tried pressing the alt key while choosing scaled on the display
preference pane to force 1920x1080, it works, but the x-axis is all
stretched smaller and moved about 400px to the right.
I tried changing the res via command line, didn't help.
I tried looking for mac drivers for BenqT220HDA, they don't seem to
exist as a separate file.
I tried flashing the NVRAM etc. Multiple times. Didn't help.

Ideas?

A:

Very weird and unusual problem, I solved it this way.
Open a terminal. Fin your DisplayPrefsKey
ioreg -l -x -w0 | grep IODisplayPrefsKey

Came out this:
"IODisplayPrefsKey" ="IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/IGPU@2/AppleIntelFramebuffer@1/display0/AppleDisplay-756e6b6e-717"

The important part is the last, AppleDisplay-756e6b6e-717.
Inside /System/Library/Displays/Overrides/ there is a folder  DisplayVendorID-756e6b6e. Now it's vim time:
vim DisplayProductID-717

Inside there is an XML file with values in Hexadecimal. If you edit it correctly, restart, OS X will do exactly what you told it to. If you get it wrong, you could fry your screen (maybe, didn't want to test that part).
So how do you get the values right? Look at other config files and find a suitable resolution that would work for your screen. In my case, I was lucky that my other MacBook Air from 2013 had the screen working properly. I copied the configuration, replaced the file (which had a different name), and voilà!
Small issue, if you're not perfectly comfortable editing file in hex, you have two options:

Use PlistEdit Pro for Mac (now free and part of XCode)
Use SwitchResX (~$20) to copy the config from one computer and port it on the other.

Hope this saves the 7 hours of work I put in yesterday to whomever is reading this :)
Useful resources:

http://www.insanelymac.com/forum/topic/274957-guide-how-to-fix-spdisplays-display-in-about-this-mac-window-20120820-update-tiny-app-added/
http://hints.macworld.com/article.php?story=20030212065523164
http://embdev.net/topic/284710

