Bug 73267

Summary: Nouveau: corrupted laptop screen's EDID info
Product: xorg Reporter: pjv <ezelspinguin>
Component: Driver/nouveauAssignee: 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 Flags
edid-tool.c (with fixes) none

Description pjv 2014-01-03 21:11:42 UTC
This is a reopen for #34554. If I'm wrong to report a new issue, please excuse me.

On my Macbook Pro 6,2 (mid 2010) (coincidentally the same as in the above bug), I was suddenly presented with an entirely black screen at a certain boot (morning Dec 29th), and ever since. I did not make any system changes before that cold boot. I do remember the system not shutting off properly the night before.

Symptoms are the same (I have not tested other OSes):
Black internal screen (no backlight) all the way, even the grey EFI bootloader screen is not there. PRAM reset works as normal (and should reset brightness so that is not it). Looked at by Genius bar and they suspected a disconnected LVDS cable, but that does not seem to be the problem.

External monitor works from the linux boot console kernel output on, but no grey EFI bootloader screen. When external monitor is connected, the keyboard lights up as well.

In the dmesg (with external monitor connected):
[    6.443945] Raw EDID:
[    6.443948]  	00 00 00 00 00 07 4f 00 06 10 bb 9c 00 00 00 00
[    6.443950]  	00 13 01 03 80 21 15 78 0a 50 c5 98 58 52 8e 27
[    6.443952]  	25 50 54 00 00 00 01 01 01 01 01 01 01 01 01 01
[    6.443954]  	01 01 01 01 01 01 7c 2e 90 a0 60 1a 1e 40 30 20
[    6.443956]  	36 00 4b cf 10 00 00 18 00 00 00 01 00 06 10 30
[    6.443958]  	00 00 00 00 00 00 00 00 0a 20 00 00 00 fe 00 4c
[    6.443960]  	50 31 35 34 57 45 33 2d 54 4c 42 31 00 00 00 fe
[    6.443962]  	00 43 6f 6c 6f 72 20 4c 43 44 0a 20 20 20 00 dd
[    6.478432] Raw EDID:
[    6.478434]  	00 00 00 00 00 07 4f 00 06 10 bb 9c 00 00 00 00
[    6.478437]  	00 13 01 03 80 21 15 78 0a 50 c5 98 58 52 8e 27
[    6.478439]  	25 50 54 00 00 00 01 01 01 01 01 01 01 01 01 01
[    6.478441]  	01 01 01 01 01 01 7c 2e 90 a0 60 1a 1e 40 30 20
[    6.478443]  	36 00 4b cf 10 00 00 18 00 00 00 01 00 06 10 30
[    6.478445]  	00 00 00 00 00 00 00 00 0a 20 00 00 00 fe 00 4c
[    6.478447]  	50 31 35 34 57 45 33 2d 54 4c 42 31 00 00 00 fe
[    6.478449]  	00 43 6f 6c 6f 72 20 4c 43 44 0a 20 20 20 00 dd
[    6.512977] Raw EDID:
[    6.512979]  	00 00 00 00 00 07 4f 00 06 10 bb 9c 00 00 00 00
[    6.512981]  	00 13 01 03 80 21 15 78 0a 50 c5 98 58 52 8e 27
[    6.512983]  	25 50 54 00 00 00 01 01 01 01 01 01 01 01 01 01
[    6.512986]  	01 01 01 01 01 01 7c 2e 90 a0 60 1a 1e 40 30 20
[    6.512988]  	36 00 4b cf 10 00 00 18 00 00 00 01 00 06 10 30
[    6.512990]  	00 00 00 00 00 00 00 00 0a 20 00 00 00 fe 00 4c
[    6.512992]  	50 31 35 34 57 45 33 2d 54 4c 42 31 00 00 00 fe
[    6.512994]  	00 43 6f 6c 6f 72 20 4c 43 44 0a 20 20 20 00 dd
[    6.547469] Raw EDID:
[    6.547471]  	00 00 00 00 00 07 4f 00 06 10 bb 9c 00 00 00 00
[    6.547474]  	00 13 01 03 80 21 15 78 0a 50 c5 98 58 52 8e 27
[    6.547476]  	25 50 54 00 00 00 01 01 01 01 01 01 01 01 01 01
[    6.547478]  	01 01 01 01 01 01 7c 2e 90 a0 60 1a 1e 40 30 20
[    6.547480]  	36 00 4b cf 10 00 00 18 00 00 00 01 00 06 10 30
[    6.547482]  	00 00 00 00 00 00 00 00 0a 20 00 00 00 fe 00 4c
[    6.547484]  	50 31 35 34 57 45 33 2d 54 4c 42 31 00 00 00 fe
[    6.547486]  	00 43 6f 6c 6f 72 20 4c 43 44 0a 20 20 20 00 dd
[    6.547490] nouveau 0000:01:00.0: LVDS-1: EDID block 0 invalid.
[    6.547493] nouveau E[     DRM] DDC responded, but no EDID for LVDS-1
[    6.682213] nouveau  [     DRM] allocated 1920x1080 fb: 0x70000, bo ffff88015e55b800

The line with "DDC responded, but no EDID for LVDS-1" repeats often.

Significant is that these long EDID reports only show up from the 29th onwards, as well as on the last boot of the 28th (boot before the problematic boot).

That last boot shows:

Dec 28 20:47:08 defiant kernel: [19803.436112] Raw EDID:
Dec 28 20:47:08 defiant kernel: [19803.436119]  	fb fb ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Dec 28 20:47:08 defiant kernel: [19803.436121]  	ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Dec 28 20:47:08 defiant kernel: [19803.436122]  	ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Dec 28 20:47:08 defiant kernel: [19803.436123]  	ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Dec 28 20:47:08 defiant kernel: [19803.436124]  	ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Dec 28 20:47:08 defiant kernel: [19803.436125]  	ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Dec 28 20:47:08 defiant kernel: [19803.436126]  	ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Dec 28 20:47:08 defiant kernel: [19803.436127]  	ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Dec 28 20:47:08 defiant kernel: [19803.470773] Raw EDID:
Dec 28 20:47:08 defiant kernel: [19803.470781]  	00 00 00 00 00 07 4f 00 06 10 bb 9c 00 00 00 00
Dec 28 20:47:08 defiant kernel: [19803.470783]  	00 13 01 03 80 21 15 78 0a 50 c5 98 58 52 8e 27
Dec 28 20:47:08 defiant kernel: [19803.470784]  	25 50 54 00 00 00 01 01 01 01 01 01 01 01 01 01
Dec 28 20:47:08 defiant kernel: [19803.470785]  	01 01 01 01 01 01 7c 2e 90 a0 60 1a 1e 40 30 20
Dec 28 20:47:08 defiant kernel: [19803.470786]  	36 00 4b cf 10 00 00 18 00 00 00 01 00 06 10 30
Dec 28 20:47:08 defiant kernel: [19803.470788]  	00 00 00 00 00 00 00 00 0a 20 00 00 00 fe 00 4c
Dec 28 20:47:08 defiant kernel: [19803.470789]  	50 31 35 34 57 45 33 2d 54 4c 42 31 00 00 00 fe
Dec 28 20:47:08 defiant kernel: [19803.470790]  	00 43 6f 6c 6f 72 20 4c 43 44 0a 20 20 20 00 dd
Dec 28 20:47:08 defiant kernel: [19803.504839] Raw EDID:
Dec 28 20:47:08 defiant kernel: [19803.504847]  	00 00 00 00 00 07 4f 00 06 10 bb 9c 00 00 00 00
Dec 28 20:47:08 defiant kernel: [19803.504848]  	00 13 01 03 80 21 15 78 0a 50 c5 98 58 52 8e 27
Dec 28 20:47:08 defiant kernel: [19803.504849]  	25 50 54 00 00 00 01 01 01 01 01 01 01 01 01 01
Dec 28 20:47:08 defiant kernel: [19803.504850]  	01 01 01 01 01 01 7c 2e 90 a0 60 1a 1e 40 30 20
Dec 28 20:47:08 defiant kernel: [19803.504851]  	36 00 4b cf 10 00 00 18 00 00 00 01 00 06 10 30
Dec 28 20:47:08 defiant kernel: [19803.504852]  	00 00 00 00 00 00 00 00 0a 20 00 00 00 fe 00 4c
Dec 28 20:47:08 defiant kernel: [19803.504853]  	50 31 35 34 57 45 33 2d 54 4c 42 31 00 00 00 fe
Dec 28 20:47:08 defiant kernel: [19803.504854]  	00 43 6f 6c 6f 72 20 4c 43 44 0a 20 20 20 00 dd
Dec 28 20:47:08 defiant kernel: [19803.538901] Raw EDID:
Dec 28 20:47:08 defiant kernel: [19803.538909]  	00 00 00 00 00 07 4f 00 06 10 bb 9c 00 00 00 00
Dec 28 20:47:08 defiant kernel: [19803.538910]  	00 13 01 03 80 21 15 78 0a 50 c5 98 58 52 8e 27
Dec 28 20:47:08 defiant kernel: [19803.538911]  	25 50 54 00 00 00 01 01 01 01 01 01 01 01 01 01
Dec 28 20:47:08 defiant kernel: [19803.538912]  	01 01 01 01 01 01 7c 2e 90 a0 60 1a 1e 40 30 20
Dec 28 20:47:08 defiant kernel: [19803.538913]  	36 00 4b cf 10 00 00 18 00 00 00 01 00 06 10 30
Dec 28 20:47:08 defiant kernel: [19803.538914]  	00 00 00 00 00 00 00 00 0a 20 00 00 00 fe 00 4c
Dec 28 20:47:08 defiant kernel: [19803.538915]  	50 31 35 34 57 45 33 2d 54 4c 42 31 00 00 00 fe
Dec 28 20:47:08 defiant kernel: [19803.538916]  	00 43 6f 6c 6f 72 20 4c 43 44 0a 20 20 20 00 dd
Dec 28 20:47:08 defiant kernel: [19803.538921] nouveau 0000:01:00.0: LVDS-1: EDID block 0 invalid.
Dec 28 20:47:08 defiant kernel: [19803.538926] nouveau E[     DRM] DDC responded, but no EDID for LVDS-1


In earlier correct boots I regularly find:

Dec 24 12:37:49 defiant kernel: [ 7225.572415] [drm:drm_edid_block_valid] *ERROR* EDID checksum is invalid, remainder is 92
Dec 24 12:37:49 defiant kernel: [ 7225.572421] Raw EDID:
Dec 24 12:37:49 defiant kernel: [ 7225.572426]  	00 ff ff ff ff ff ff 00 06 10 bb 9c 00 00 00 00
Dec 24 12:37:49 defiant kernel: [ 7225.572428]  	00 13 01 03 80 21 15 78 0a 50 c5 98 58 52 8e 21
Dec 24 12:37:49 defiant kernel: [ 7225.572430]  	ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Dec 24 12:37:49 defiant kernel: [ 7225.572433]  	ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Dec 24 12:37:49 defiant kernel: [ 7225.572435]  	ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Dec 24 12:37:49 defiant kernel: [ 7225.572437]  	ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Dec 24 12:37:49 defiant kernel: [ 7225.572439]  	ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Dec 24 12:37:49 defiant kernel: [ 7225.572441]  	ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff


Dec 25 12:15:51 defiant kernel: [ 2707.066122] [drm:drm_edid_block_valid] *ERROR* EDID checksum is invalid, remainder is 255
Dec 25 12:15:51 defiant kernel: [ 2707.066129] Raw EDID:
Dec 25 12:15:51 defiant kernel: [ 2707.066133]  	00 ff ff ff ff ff ff 00 06 10 bb 9c 00 00 00 00
Dec 25 12:15:51 defiant kernel: [ 2707.066136]  	00 13 01 03 80 20 15 78 0a 50 c5 98 58 52 8e 27
Dec 25 12:15:51 defiant kernel: [ 2707.066138]  	25 50 54 00 00 00 01 01 01 01 01 01 01 01 01 01
Dec 25 12:15:51 defiant kernel: [ 2707.066140]  	01 01 01 01 01 01 7c 2e 90 a0 60 1a 1e 40 30 20
Dec 25 12:15:51 defiant kernel: [ 2707.066142]  	36 00 4b cf 10 00 00 18 00 00 00 01 00 06 10 30
Dec 25 12:15:51 defiant kernel: [ 2707.066145]  	00 00 00 00 00 00 00 00 0a 20 00 00 00 fe 00 4c
Dec 25 12:15:51 defiant kernel: [ 2707.066147]  	50 31 35 34 57 45 33 2d 54 4c 42 31 00 00 00 fe
Dec 25 12:15:51 defiant kernel: [ 2707.066149]  	00 43 6f 6c 6f 72 20 4c 43 44 0a 20 20 20 00 dd


As to the recommendation to try the latest updates, my mint system is up to date (slight updated after problem occurred). Versions:
xorg 1:7.7+1ubuntu4
xserver-xorg-video-nouveau 1:1.0.7+git20130516.bf72ae1f-0ubuntu0sarvatt~raring
libgl1-mesa-dri 9.2.0~git20130627.15085b47-0ubuntu0sarvatt~raring
kernel 3.8.0-25-generic
As you can see, neither kernel nor nouveau are at the requested highest versions, but these do not seem easily available for my distro. With some pointers I can try them but am not sure what they would fix as corruption has already occurred.


I will now proceed and try to repair.
Comment 1 Ilia Mirkin 2014-01-03 21:23:54 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
Comment 2 pjv 2014-01-03 22:47:58 UTC
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.
Comment 3 pjv 2014-01-03 22:50:28 UTC
Created attachment 91473 [details]
edid-tool.c (with fixes)

Edid-tool.c from Andy with fixes from Stuart from #34554.
Comment 4 pjv 2014-01-03 23:51:48 UTC
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.
Comment 5 chr[] 2014-09-23 17:29:43 UTC
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
Comment 6 pjv 2014-09-27 12:34:12 UTC
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,
Comment 7 Martin Peres 2019-12-04 08:41:49 UTC
-- 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.