3. Study/Realize

Fixing Scrambled,Stretched, or Wrong Resolution Laptop Display Problems

Sherlocks 2013. 1. 9. 23:03
http://www.insanelymac.com/forum/topic/208410-fixing-scrambledstretched-or-wrong-resolution-laptop-display-problems/

Most of this information I have previously posted, but was scattered throughout multiple threads. I've gathered it all here to provide a comprehensive solution in one place. I've also given the option of skipping use of SwitchResX altogether, as it's not freeware, and some people were confused about the continued need for it once the fix was in place. If you have anything you think needs adding or clarifying, please don't hesitate to reply or message me directly.

Does your laptop have a 'messed up' display part or all the time? Are you missing some or all proper resolutions? Is everything stretched out, or maybe your screen is even blank*? Here's your likely solution! OSX has a horrible time trying to pick up EDID information from our LCD screens. That's the information it needs to know what timings to use, what resolutions are available, etc. Without it, a lot of us are stuck at the wrong resolution... or worse! Often the problem can be intermittent- for example, the display doesn't work right, but then does after a reboot or two, or randomly.

Most people incorrectly diagnose this as needing different display drivers, and try every strange concoction they can find. Sometimes the alternate / older drivers even seem to work, as they improve the chances of your EDID being picked up. However, this is the wrong solution. If the latest stock drivers give you QE, but the display is weird, stretched, or you're at 1024 x 768... DON'T CHANGE THEM! The issue is NOT actually a driver problem, but an EDID issue.  The screen looks wrong simply because OSX doesn't know how to talk to it correctly.

To start off with, we need to acquire your screen's EDID. There's several ways to do it; just choose the one that's easiest for you, or fits your situation best.


Solution A; IF YOUR DISPLAY WORKS PROPERLY SOMETIMES (FLAKY EDID PICKUP):

Often when I start OSX, my laptop doesn't show anything on the screen unless I reboot multiple times. In the past, I described it as a "cold boot" problem. With my previous LCD screen, it would boot to a blue screen (or gray in SL). Some others need to reboot once (or more times) to get the correct resolutions listed. If your problem is sporadic, you're in luck; this fix can be completely done within OSX. It can still be confusing, though, so follow closely. The good thing is, you only have to do it once!

1. Reboot, cross your fingers, wiggle your mouse, or do whatever it takes to get your display to show up properly. Again, this only works if resolution and picture are occasionally perfect. We need to be in that mode to continue!

2. Open Terminal, and stretch it as wide as possible. It sounds strange, but I make it about twice as wide as the actual screen. This works around Terminal's truncation limit, so our data isn't cut off. Alternatively,  you can use IORegExplorer. Either way will work fine, though the rest of this guide assumes you are using Terminal.

3. Enter ioreg -l and hit enter. This should fill the window will lots and lots of data about your machine.

4. Use Edit -> Find -> Find... to locate IODisplayEDID. If you do not have this listed, STOP HERE. this solution will not work; sorry, your EDID is not being picked up at all, go to Solution B. If this value IS present, continue on.

5. We need the value of IODisplayEDID (will have a long hex data string, like 00ffffffffffff00320c00df0...3A). Select the entire thing, and save it to a text file. Make sure it does not have a $ at the end! If it does, make the Terminal window wider and run ioreg -l again.

6. Reboot, wait a while, or do whatever it takes to boot so the display is NOT right (stretched, wrong resolution, whatever). If your 'bad' display is so bad you cannot use it, first go to System Preferences -> Sharing, checkmark Screen Sharing, and enable a password under Computer Settings. Note the vnc:// address. Using a second computer, connect to the vnc:// address and continue the instructions remotely. If you're using Windows, use TightVNC.

7. Run ioreg -l in Terminal again. If you cannot find IODisplayEDID, or it has a different value, then we're on the right track! This time, locate the DisplayProductID, DisplayVendorID, and IODisplayPrefsKey values. That last one should end in something like AppleBacklightDisplay-756e6b6e-717. Take note of all these. Leave this Terminal window open, so you can grab these values as needed as we continue.

8. Now in Finder, navigate to /System/Library/Displays/Overrides. See if there is a match between a folder name there, and the green part of the IODisplayPrefsKey value. Chances are (unless you've been previously fiddling with SwitchResX) there won't be, so create one on your desktop (you cannot make a new folder in the Overrides directory). For instance, with the above example, the folder we would make would be named DisplayVendorID-756e6b6e.

9. Now open  Plist Editor Pro, and paste the following into the lower half of it:

<?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>DisplayProductID</key>
         
<integer>1815</integer>
         
<key>DisplayProductName</key>
         
<string>Internal LCD Forced EDID</string>
         
<key>DisplayVendorID</key>
         
<integer>1970170734</integer>
         
<key>IODisplayEDID</key>
         
<data>
         AP///////wAGEF+cAAAAAAgRAQOAIRV4CunVmVlTjigmUFQAAAABAQEBAQEBAQEBAQEB
         AQEB3iGgcFCEHzAgIFYAS88QAAAYAAAADwAGECAKCgoKCgoKCgoKAAAA/gBLUzUxNQAx
         NTRXUDEKAAAA/gBDb2xvciBMQ0QKCgoKAI8=
         
</data>
 
</dict>
 
</plist>

10. After clicking Sync Outline, you should now be able to edit the DisplayProductID, DisplayVendorID, and IODisplayEDID values in the upper window. Don't use the bottom code window, as we need Plist Editor to convert the data strings for us. The IODisplayEDID value is the long hex string we grabbed earlier. The DisplayProductID and DisplayVendorID values are in the ioreg Terminal window we left open.

11. Once done, save the Plist file as anything you like in the DisplayVendorID folder we created on the desktop, and close Plist Editor Pro. Now rename the Plist file using the purple part of the IODisplayPrefsKey, like so: DisplayProductID-717. Make sure there is NO extension, .plist or anything else! Verify and/or correct this by right-clicking on the file and choosing Get Info.

12. Now all that's left is to drag the folder to /System/Library/Displays/Overrides. It should require the Administrator password to proceed. This should create a directory something like /System/Library/Displays/Overrides/DisplayVendorID-756e6b6e/DisplayProductID-717. Reboot, and see if it worked! To verify that the Override loaded, just open Displays in System Preferences. It should say "Internal LCD Forced EDID" whenever the EDID is not found. If your pickup is sporadic, you may have to reboot a few times to make sure it works. Congratulations, your internal display is now 100% functional!


Solution B; IF YOUR DISPLAY NEVER WORKS PROPERLY (NO EDID PICKUP):

The challenge here is that OSX refuses to pick up your EDID at all, forcing us to boot to a different operating system altogether to acquire the data we need. This could be easy (if you have a dual boot system) or a bit of a challenge, if you don't. I'll try and cover every possibility here.

The Windows Way:
Boot to Windows and retrieve your EDID using this. Once you have the EDID saved somewhere you can access (online, text file, USB key, whatever), reboot to OSX. You should now be able to pick up the instructions in Solution A, starting with step 6.

The Linux Way:
I have not personally tested this yet, but it should work. Boot Ubuntu Linux (a live cd is fine). Open Terminal, make sure you have a working internet connection, and entersudo apt-get install read-edid. You can now try entering sudo get-edid | sudo parse-edid. If that doesn't show the full EDID hex string, try just sudo get-edid. Once you have the EDID saved somewhere you can access (online, text file, USB key, whatever), reboot to OSX. You should now be able to pick up the instructions in Solution A, starting with step 6.

The DOS Way:
I've tried this, and it works, though is currently not the most ideal solution. Create a bootable DOS USB key using the instructions here. Once that is done, extract this file and add it to the USB drive. Reboot, and boot off the DOS USB drive. You might have to change the boot order in your bios. Once you're at the command prompt, enter GET-EDID.EXE EDID-OUT. This will create a new file (edid-out, no extension) on your USB drive. Unfortunately, the only way I have found to access the EDID from it is using a hex editor, as it saves it as raw data, not a text file. I have yet to find a simple DOS hex-dump-to-text utility, but if anyone can supply one, I'll create a single *.bat file to do all the work. Once you have the EDID retrieved from the hex editor, you should now be able to pick up the instructions in Solution A, starting with step 6.


Solution C; USING SWITCHRESX INSTEAD OF IOREG / TERMINAL:

This could be easier for some people. Once you have your EDID using one of the above methods, boot OSX (using screen sharing, if the screen is unusable) and openSwitchResX. Find the fake display and vendor id's it is using (as in the example above, mine is using /System/Library/Displays/Overrides/DisplayVendorID-756e6b6e/DisplayProductID-717, which seems to be a sort of universal default). Copy that file to your desktop, and rename it to *.plist. Open it with Plist Editor Pro, and add your EDID. If that file isn't there, create it using the directions in Method A. Once done, remove the .plist extension, overwrite the default Override, and reboot.

After you verify the Override is working properly, you CAN get rid of SwitchResX (open Applications, right-click the icon and choose "Move to trash"). It isn't needed anymore. It's a useful tool for setting up an Override, reading your EDID (if OSX has it), or seeing what DisplayVendorID / DisplayProductID path is being used... but once a fix is in place, it's no longer useful. Removing SwitchResX, at least for me, did not affect any of my custom Overrides. 


Some comments and warnings:

Using someone else's unedited Display Override is a bad idea, just like using someone else's DSDT.aml or toothbrush! Even the same make and model laptops have different LCD screens, so the EDID could be drastically different. At best, you end up with a (more) scrambled screen. At worst, there's a chance you could damage your display.

If your EDID pickup is flaky like mine, OSX will use the created Override only when it can't find the EDID. The down side to this is OSX sees this situation as having two completely separate displays; settings like wallpaper and Color Calibration will be different for each. As long as you have both settings the same, you'll never notice the difference. However, if for example you change your wallpaper while not using the Override, then on next reboot the Override is used, you'll see the older wallpaper. I consider it a small price to pay for a 100% working display, and as far as I know there's no way around it. I personally have my Wallpaper set to rotate, so never notice :) 

Once your Override is created, I recommend backing it up for future use. That way all these steps are not needed the next time you install OSX on the same machine. Think of it as a custom driver; you can just drag and drop the folder into /Overrides/. The Overrides are also version-agnostic, so once created, should be able to be used in 10.5.x and 10.6.x interchangeably. I wish there was a way to have it on /EFI/Extra/, but oh well. OSX updates won't overwrite the Override, so it's only annoying for the first bootup, or for people like me who want every fix completely separate from the OS.

Display Overrides are the only 100% solution I have found for EDID detection problems. There are theoretical ways to add EDID to the Boot.plist or DSDT (AAPL01, EDID) but it seems at least some of the OSX Intel drivers (if not all) ignore this data. It's been theorized that this is due to the display device being 'created' when the GMA video drivers load, thus the early-loading Boot.plist and DSDT data is erroneous at the time they are loaded. Another thought is that since the GMA drivers 'create' their own display device, they don't access or use the DSDT LCD entry / information. Regardless of the reason, I can personally attest to Overrides being the only real working X3100 EDID solution. Of course, if anyone has a proven alternate method, please share.

*For Intel chipsets, if your screen is blank, there's other possibilities besides EDID issues. If your LCD is 1440x900 or higher, you might need the Dual Link DSDT patch. Some people report that removing all video devices but the LCD forces it to be used. Sometimes the LCD is actually working fine, but a backlight issue keeps anything from being seen. And as with my laptop, sometimes it's a combination of any one of these, plus needing a Display Override.