Summary: | Nouveau: corrupted laptop screen's EDID info | ||||||
---|---|---|---|---|---|---|---|
Product: | xorg | Reporter: | pjv <ezelspinguin> | ||||
Component: | Driver/nouveau | Assignee: | Nouveau Project <nouveau> | ||||
Status: | RESOLVED MOVED | QA Contact: | Xorg Project Team <xorg-team> | ||||
Severity: | normal | ||||||
Priority: | medium | CC: | chris | ||||
Version: | 7.7 (2012.06) | ||||||
Hardware: | x86-64 (AMD64) | ||||||
OS: | Linux (All) | ||||||
Whiteboard: | |||||||
i915 platform: | i915 features: | ||||||
Attachments: |
|
Description
pjv
2014-01-03 21:11:42 UTC
It appears that the correct values for the first 8 bytes are 00 ff ff ff ff ff ff 00 whereas you have them as 00 00 00 00 00 07 4f 00 (based on your earlier boots, and the last comment from bug 34554). Try to stick the "correct" EDID into a file, and force its use via module options. Take a look at https://wiki.archlinux.org/index.php/Kernel_Mode_Setting#Forcing_modes_and_EDID specifically, you need something like: drm_kms_helper.edid_firmware=LVDS-1:edid/your_edid.bin Hi Ilia, thanks for your quick reply. Before I get to that, please let me write elaborately how I fixed things these past few hours. It may help other people like me who need a pointer left and right. All credits go to Andy Getz, Stuart Pook and chr[] in the duplicate bug above. Many of these commands are as root. Use Andy's edid-tool.c (with slight fix from Stuart), which I attach here again, and build it: gcc -std=gnu99 -O edid-tool.c mv a.out > edid-tool Use your package manager and install: i2c-dev for the kernel module i2c-tools in order to get i2cdetect, i2cget, i2cset read-edid in order to get parse-edid Then activate the kernel module (the mistake Stuart made one time was to forget this: with i2c-dev installed the /dev/ nodes disappear, but they come back with loading the module): modprobe i2c-dev Assuming you use a modern udev system, you won't have to do anything else in /dev/. Read Andy's original commands: https://bugs.freedesktop.org/show_bug.cgi?id=34554#c15. I repeat them here with my output: # Find the right i2c device; reading one that's not DDC will probably give ENODEV edid-tool /dev/i2c-0 read > edid-bad 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123 4567 89ab cdef 00000000 00 00 00 00 00 07 4f 00 06 10 bb 9c 00 00 00 00 |.... ..O. .... ....| 00000010 00 13 01 03 80 21 15 78 0a 50 c5 98 58 52 8e 27 |.... .!.x .P.. XR.'| 00000020 25 50 54 00 00 00 01 01 01 01 01 01 01 01 01 01 |%PT. .... .... ....| 00000030 01 01 01 01 01 01 7c 2e 90 a0 60 1a 1e 40 30 20 |.... ..|. ..`. .@0 | 00000040 36 00 4b cf 10 00 00 18 00 00 00 01 00 06 10 30 |6.K. .... .... ...0| 00000050 00 00 00 00 00 00 00 00 0a 20 00 00 00 fe 00 4c |.... .... . .. ...L| 00000060 50 31 35 34 57 45 33 2d 54 4c 42 31 00 00 00 fe |P154 WE3- TLB1 ....| 00000070 00 43 6f 6c 6f 72 20 4c 43 44 0a 20 20 20 00 dd |.Col or L CD. ..| WARN at 209: Bad header: 0x0000 0000 0007 4f00 WARN at 217: Bad checksum: 0x5c i2c-0 was the internal screen for my laptop, i2c-1 the external one. In full: defiant Temp # edid-tool /dev/i2c-0 read > edids-all 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123 4567 89ab cdef 00000000 00 00 00 00 00 07 4f 00 06 10 bb 9c 00 00 00 00 |.... ..O. .... ....| 00000010 00 13 01 03 80 21 15 78 0a 50 c5 98 58 52 8e 27 |.... .!.x .P.. XR.'| 00000020 25 50 54 00 00 00 01 01 01 01 01 01 01 01 01 01 |%PT. .... .... ....| 00000030 01 01 01 01 01 01 7c 2e 90 a0 60 1a 1e 40 30 20 |.... ..|. ..`. .@0 | 00000040 36 00 4b cf 10 00 00 18 00 00 00 01 00 06 10 30 |6.K. .... .... ...0| 00000050 00 00 00 00 00 00 00 00 0a 20 00 00 00 fe 00 4c |.... .... . .. ...L| 00000060 50 31 35 34 57 45 33 2d 54 4c 42 31 00 00 00 fe |P154 WE3- TLB1 ....| 00000070 00 43 6f 6c 6f 72 20 4c 43 44 0a 20 20 20 00 dd |.Col or L CD. ..| WARN at 209: Bad header: 0x0000 0000 0007 4f00 WARN at 217: Bad checksum: 0x5c defiant Temp # edid-tool /dev/i2c-1 read > edids-all 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123 4567 89ab cdef 00000000 00 ff ff ff ff ff ff 00 36 74 30 00 01 00 00 00 |.... .... 6t0. ....| 00000010 0a 16 01 03 80 73 41 78 0a cf 74 a3 57 4c b0 23 |.... .sAx ..t. WL.#| 00000020 09 48 4c 21 08 00 81 80 45 40 61 40 95 00 01 01 |.HL! .... E@a@ ....| 00000030 01 01 01 01 01 01 02 3a 80 18 71 38 2d 40 58 2c |.... ...: ..q8 -@X,| 00000040 45 00 c4 8e 21 00 00 1e 66 21 50 b0 51 00 1b 30 |E... !... f!P. Q..0| 00000050 00 70 26 44 c4 8e 21 00 00 1e 00 00 00 fc 00 4d |.p&D ..!. .... ...M| 00000060 53 74 61 72 20 44 65 6d 6f 0a 20 20 00 00 00 fd |Star Dem o. ....| 00000070 00 32 4b 1e 50 17 00 0a 20 20 20 20 20 20 01 fd |.2K. P... ..| defiant Temp # edid-tool /dev/i2c-2 read > edids-all ERROR at 72: i2c_smbus_read_byte_data() failed: No such device or address defiant Temp # edid-tool /dev/i2c-3 read > edids-all ERROR at 72: i2c_smbus_read_byte_data() failed: No such device or address defiant Temp # edid-tool /dev/i2c-4 read > edids-all ERROR at 72: i2c_smbus_read_byte_data() failed: No such device or address defiant Temp # edid-tool /dev/i2c-5 read > edids-all ERROR at 72: i2c_smbus_read_byte_data() failed: No such device or address defiant Temp # edid-tool /dev/i2c-6 read > edids-all ERROR at 72: i2c_smbus_read_byte_data() failed: No such device or address defiant Temp # edid-tool /dev/i2c-7 read > edids-all ERROR at 72: i2c_smbus_read_byte_data() failed: No such device or address defiant Temp # edid-tool /dev/i2c-8 read > edids-all ERROR at 72: i2c_smbus_read_byte_data() failed: Remote I/O error defiant Temp # edid-tool /dev/i2c-9 read > edids-all ERROR at 72: i2c_smbus_read_byte_data() failed: Remote I/O error defiant Temp # edid-tool /dev/i2c-10 read > edids-all ERROR at 72: i2c_smbus_read_byte_data() failed: Remote I/O error defiant Temp # edid-tool /dev/i2c-11 read > edids-all ERROR at 72: i2c_smbus_read_byte_data() failed: Remote I/O error # If you don't get warnings here about either the header or checksum being bad, # you probably have some other problem. edid-tool /dev/i2c-0 fix < edid-bad > edid-fixed Indeed, as I predicted by some smartness and looking at my old logs, it replaced the first half of the first line with 00 ff ... ff 00 again, which is the correct one. The rest did not change. parse-edid < edid-fixed # parse-edid will read several of the display related fields out of the EDID and # generate an Xorg.conf Monitor section; CHECK IT TO MAKE SURE IT LOOKS SANE # BEFORE YOU FLASH IT BACK TO YOUR MONITOR. This printed out an xorg.conf in which I recognized the native resolution, so I was ok with it. edid-tool /dev/i2c-0 write < edid-fixed defiant Temp # edid-tool /dev/i2c-0 write < edid-fixed 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123 4567 89ab cdef 00000000 00 ff ff ff ff ff ff 00 06 10 bb 9c 00 00 00 00 |.... .... .... ....| 00000010 00 13 01 03 80 21 15 78 0a 50 c5 98 58 52 8e 27 |.... .!.x .P.. XR.'| 00000020 25 50 54 00 00 00 01 01 01 01 01 01 01 01 01 01 |%PT. .... .... ....| 00000030 01 01 01 01 01 01 7c 2e 90 a0 60 1a 1e 40 30 20 |.... ..|. ..`. .@0 | 00000040 36 00 4b cf 10 00 00 18 00 00 00 01 00 06 10 30 |6.K. .... .... ...0| 00000050 00 00 00 00 00 00 00 00 0a 20 00 00 00 fe 00 4c |.... .... . .. ...L| 00000060 50 31 35 34 57 45 33 2d 54 4c 42 31 00 00 00 fe |P154 WE3- TLB1 ....| 00000070 00 43 6f 6c 6f 72 20 4c 43 44 0a 20 20 20 00 dd |.Col or L CD. ..| ERROR at 91: i2c_smbus_write_byte_data() failed: No such device or address Unfortunately, this command never actually did the write. I looked at the code intensively and could not spot a bug, unless the bug is in the i2c code. I had some i2c module blacklisted (god knows why), which could have been the cause (I did not find out): defiant dev # cd /etc/modprobe.d/ defiant modprobe.d # grep i2c * blacklist.conf:blacklist i2c_i801 So the analysis was done, but there was no easy/working way to write for me. I fell back to the i2c-tools and in the end did the write with i2cget manually (slightly dangerous I would say). i2cdetect gives: defiant Temp # i2cdetect -y 0 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- 28 -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: 50 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- -- This is all on i2c-0 (column), 0x50 (number in table) is the EDID address that is also present in the code. Then I read out the bytes one by one at that address, and the output one by one matched the first half of the first line of the EDID (the next to last parameter (e.g. 0x07) matches the column number in the formatted EDID): i2cget -y 0 0x50 0x00 b i2cget -y 0 0x50 0x01 b i2cget -y 0 0x50 0x02 b i2cget -y 0 0x50 0x03 b i2cget -y 0 0x50 0x04 b i2cget -y 0 0x50 0x05 b i2cget -y 0 0x50 0x06 b i2cget -y 0 0x50 0x07 b i2cget -y 0 0x50 0x08 b If I can read them, I can also write them one by one. I double-checked with one i2cget. Here the next-to-last parameter is the value (e.g. 0xff for 'ff', what's supposed to be in the EDID itself): i2cset -y 0 0x50 0x00 0x00 b i2cset -y 0 0x50 0x01 0xff b i2cget -y 0 0x50 0x01 b i2cset -y 0 0x50 0x02 0xff b i2cset -y 0 0x50 0x03 0xff b i2cset -y 0 0x50 0x04 0xff b i2cset -y 0 0x50 0x05 0xff b i2cset -y 0 0x50 0x06 0xff b As soon as I sent through that last command (and thus had fixed my EDID as per edid-tool's recommendation), my mouse cursor appeared on my internal screen. Xorg apparently is not super-flexible, but a simple careful reboot gave me my normal working machine back. Fixed! In your case, these values will be different. Not sure how permanent this is. Created attachment 91473 [details]
edid-tool.c (with fixes)
Edid-tool.c from Andy with fixes from Stuart from #34554.
Ilia, is it sane to enforce an EDID in the module options? I have the habit to copy all my configuration when moving to a new laptop when it's time to replace, and then forget what this or that fix was for. I bet I would have a hard time getting my screen to show then. Can I help to diagnose where the corruption comes from? Is that useful/doable? I should also mention that Apple might have had some particular problems with this laptop model (MBP 6,2) related to the Nvidia chip: http://support.apple.com/kb/ts4088. This is like a recall problem for affected parts. Can't find enough info though. Hello pjv! I'm back. Dat Bug #34554 happened again after 2 years. Same machine, running kernel 3.15.10 meanwhile. I plugged in an external Monitor just as I did that dozend times before since then. It went on, and the Laptop-Display just went off and disappeared. Xrandr says it's disconnected and kernel says: kernel: [66875.422770] nouveau E[ DRM] DDC responded, but no EDID for LVDS-1 Well, I also got the problem with the edid-tool: edid-tool /dev/i2c-0 write < edid-fixed ERROR at 91: i2c_smbus_write_byte_data() failed: No such device or address and I somehow fixed it by dropping "usleep(10000);" into the write loop. I feel like putting my finger in that wound .... If it's a timing issue, how likely is it to turn a i2c-read operation into a write? I mean, by hot-plugging in an external display I also hot-plug an i2c-bus. I know, I can confuse my adourinous i2c-attached gadget this way. For the record, here are the flipped bits: --- edid.broken.hex +++ edid.ok.hex @@ -1,9 +1,9 @@ -00000000 00 03 00 00 00 07 4f 00 06 10 bb 9c 00 00 00 00 +00000000 00 ff ff ff ff ff ff 00 06 10 bb 9c 00 00 00 00 00000010 00 13 01 03 80 21 15 78 0a 50 c5 98 58 52 8e 27 00000020 25 50 54 00 00 00 01 01 01 01 01 01 01 01 01 01 00000030 01 01 01 01 01 01 7c 2e 90 a0 60 1a 1e 40 30 20 00000040 36 00 4b cf 10 00 00 18 00 00 00 01 00 06 10 30 00000050 00 00 00 00 00 00 00 00 0a 20 00 00 00 fe 00 4c 00000060 50 31 35 34 57 45 33 2d 54 4c 42 31 00 00 00 fe 00000070 00 43 6f 6c 6f 72 20 4c 43 44 0a 20 20 20 00 dd Hi chr[], You were able to fix it again? Good. I myself did not see it again (9 months have passed), so it's good to know at least you're fixing it for a long while. Of course I can't really answer your question; I clearly was expert-for-a-day only. Nice find with usleep. I can follow your reasoning about it being a timing issue. Is there a better place to submit a bug to "edid_tool write" in particular? Best regards, -- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/driver/xf86-video-nouveau/issues/83. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.