Bug 21040

Summary: [965GM Macbook KMS] EDID detection on DVI connector fails(incorrect TV detection)
Product: DRI Reporter: Nico Schlömer <nico.schloemer>
Component: DRM/IntelAssignee: ykzhao <yakui.zhao>
Status: CLOSED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: infinity80, michael.fu, yakui.zhao
Version: unspecifiedKeywords: patch
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Xorg log with KMS
none
`xrandr -q` output with KMS
none
Xorg log without KMS (working as expected)
none
`xrandr -q` output without KMS (working as expected)
none
dmesg output after manually loading the modules (with debug)
none
output of `xrandr -q` with KMS on kernel 2.6.30_rc4
none
Xorg log with KMS on kernel 2.6.30_rc4
none
acpidump
none
dmesg output with KMS
none
dmicode output
none
Xorg log with KMS
none
Xorg log without KMS (working as expected)
none
`xrandr -q` output with KMS
none
`xrandr -q` output without KMS (working as expected)
none
X.org log with KMS (ModeDebug)
none
X.org log without KMS (working as expected) (ModeDebug)
none
X configuration with ignored TV
none
X.org log without KMS (ModeDebug, TV-out ignored)
none
X.org log with KMS (ModeDebug, TV-out ignored)
none
`xrandr -q` output with KMS (TV-out ignored)
none
X.org log, KMS enebled, mini-dvi to vga adapter plugged-in after xorg server start.
none
X.org log, KMS enebled, mini-dvi to vga adapter plugged-in before xorg server start.
none
X.org config
none
please try the debug patch in KMS mode, thanks
none
Xorg log with KMS on kernel 2.6.31_rc2 (ModeDebug)
none
pleaset try the patch on your machine in KMS mode, thanks.
none
xrandr -q output with the latest patch
none
X.org log with KMS and latest patch
none
Read the EDID for SDVO-DVI by using VGA DDC
none
Xorg log with KMS on Eric Anholt's kernel
none
dmesg on Eric Anholt's kernel
none
`xrandr -q` on Eric Anholt's kernel none

Description Nico Schlömer 2009-04-03 12:53:32 UTC
Created attachment 24512 [details]
Xorg log with KMS

Hi,

I just tried KMS with the 2.6.29.1 kernel and the intel 2.6.99.902 driver. Things work out well in the sense that my laptop display really gets a native 1280x800 framebuffer console in the beginning, and the xserver starts up smoothly.

The only thing is that my external screen (1440x900) doesn't get recognized at all (no signal all the time).

Logs appended. If you need any more info, drop a line.

Cheers,
Nico

PS. In case this bug belongs to some other place (kernel?) please let me know.
Comment 1 Nico Schlömer 2009-04-03 12:53:58 UTC
Created attachment 24513 [details]
`xrandr -q` output with KMS
Comment 2 Nico Schlömer 2009-04-03 12:54:33 UTC
Created attachment 24514 [details]
Xorg log without KMS (working as expected)
Comment 3 Nico Schlömer 2009-04-03 12:54:59 UTC
Created attachment 24515 [details]
`xrandr -q` output without KMS (working as expected)
Comment 4 Gordon Jin 2009-04-03 21:21:27 UTC
This seems to be bug#21030, right?
Comment 5 Nico Schlömer 2009-04-03 23:48:36 UTC
Well yeah, except for the fact that it appears for me even when the screen is *connected* during boot.

Would that be the same bug?

Cheers,
Nico
Comment 6 Gordon Jin 2009-04-04 04:09:32 UTC
Let Jesse to decide.
Comment 7 Jesse Barnes 2009-04-07 16:39:59 UTC
21030 has a patch now that you could try...  if it works it's a DUP. :)

Comment 8 Nico Schlömer 2009-04-07 17:07:29 UTC
Tried the patch, but it didn't help unfortunately.
The logs still say the same thing; in fact, nothing seems to have changed for me.

Cheers,
Nico
Comment 9 Jesse Barnes 2009-04-07 17:29:46 UTC
Can you modprobe your drm module with debug=1, plug in your external display, then modprobe i915 with modeset=1 and attach the dmesg here?  We could be failing to get EDID on your config or totally failing to detect...
Comment 10 Nico Schlömer 2009-04-08 03:30:07 UTC
Created attachment 24663 [details]
dmesg output after manually loading the modules (with debug)

Did the following:

$ modprobe drm debug=1
External DVI screen plugged in.
$ modprobe i915 modeset=1

Result: External monitor *not* recognized, black LVDS screen, and a panic. :/

dmesg output attached.

Cheers,
Nico
Comment 11 Jesse Barnes 2009-05-04 15:02:56 UTC
Ah that helps, so it looks like we're failing to read the EDID from your DVI connected monitor.  There have been kernel fixes to the SDVO code recently though; can you give 2.6.30-rc4 a try?
Comment 12 Nico Schlömer 2009-05-04 16:55:08 UTC
Created attachment 25443 [details]
output of `xrandr -q` with KMS on kernel 2.6.30_rc4

Alright, I tested 2.6.30_rc4, unfortunately with no success.
I'll post the logs in a minute.
Comment 13 Nico Schlömer 2009-05-04 16:56:23 UTC
Created attachment 25444 [details]
Xorg log with KMS on kernel 2.6.30_rc4
Comment 14 Nico Schlömer 2009-05-04 17:07:12 UTC
Hm, the manual kernel loading from as above doesn't produce any output on dmesg anymore, not sure why.

If there's anything else I can provide, let me know.
Comment 15 Michael Fu 2009-06-08 01:26:58 UTC
looks like this is causing the problem... 

(II) intel(0): Output LVDS1 connected
(II) intel(0): Output DVI1 connected
(II) intel(0): Output TV1 connected

What's the model of this machine?
Comment 16 ykzhao 2009-06-08 20:28:37 UTC
What Michael said in comment #15 is right. In the KMS mode the LVDS is also detected. In fact maybe its detection should be skipped.
At the same time it seems that tv is also detected in KMS mode. But in UMS mode it is ignored.

Will you please attach the xorg.conf used in UMS mode?

Will you please attach the output of dmidecode, vbios dump, acpidump?
Thanks.
Comment 17 Nico Schlömer 2009-06-11 04:49:51 UTC
Alright,
I'm now on kernel 2.6.30, with xorg-server-1.6.1.90,1 and the intel 2.7.1 driver.

The problem persists.

Appending the logs..
Comment 18 Nico Schlömer 2009-06-11 04:50:21 UTC
Created attachment 26670 [details]
acpidump
Comment 19 Nico Schlömer 2009-06-11 04:51:18 UTC
Created attachment 26671 [details]
dmesg output with KMS
Comment 20 Nico Schlömer 2009-06-11 04:51:35 UTC
Created attachment 26672 [details]
dmicode output
Comment 21 Nico Schlömer 2009-06-11 04:52:05 UTC
Created attachment 26673 [details]
Xorg log with KMS
Comment 22 Nico Schlömer 2009-06-11 04:52:35 UTC
Created attachment 26674 [details]
Xorg log without KMS (working as expected)
Comment 23 Nico Schlömer 2009-06-11 04:52:55 UTC
Created attachment 26675 [details]
`xrandr -q` output with KMS
Comment 24 Nico Schlömer 2009-06-11 04:53:17 UTC
Created attachment 26676 [details]
`xrandr -q` output without KMS (working as expected)
Comment 25 Nico Schlömer 2009-06-11 04:55:25 UTC
Oh, and I'm not using an explicit xorg.conf anymore (see Xorg logs).

How do I actually generate a 'vbios dump'?

Cheers,
Nico
Comment 26 ykzhao 2009-06-16 02:14:37 UTC
From the dmesg log in comment #19 it seems that there exists the following error messages:
    >i2c-adapter i2c-3: unable to read EDID block.
    >i915 0000:00:02.0: DVI-D-1: no EDID data
   
    Is this caused by that the EDID can't be obtained for SDVO-DVI device?
    
Hi, Nico
    there exists the inconsistence in the log between comment #2 and comment #24. For example: there is no LVDS device in comment #2. But there exists the LVDS device in comment #24.
    Will you please double check it?
    It will be great if you can add the "option ModeDebug on" in xorg.conf and attach the Xorg.log with KMS enabled/disabled.
    
    Thanks.
Comment 27 Michael Fu 2009-06-16 02:21:56 UTC
(In reply to comment #25)
> Oh, and I'm not using an explicit xorg.conf anymore (see Xorg logs).
> 
to add ModeDebug option , you need an xorg.conf file. to generate a xorg.conf:

 If your distribution doesn't ship xorg.conf, you can use 'X --configure' to let X spit out the default configuration it uses and save it as /etc/X11/xorg.conf.)

> How do I actually generate a 'vbios dump'?
> 

# cd /sys/devices/pci0000\:00/0000\:00\:02.0/
# echo 1 > rom
# cat rom > /tmp/rom.bin
# echo 0 > rom

> Cheers,
> Nico
> 

Comment 28 Nico Schlömer 2009-06-16 10:44:46 UTC
Hi,

you were right ykzhao, you can forget about the `xrandr -q` of comment #3. My laptop's native screen is LVDS (@1280x800), the external one TMDS-1 (@1440x900), correctly recognized at no KMS.

ModeDebug'ged Xorg logs following.

Not sure if they help so much, though, as the phenomenon (blank external screen) appears right after KMS has been loaded. This made me think it might be a kernel driver issue..

Anyway, you guys are on top of it.

Cheers,
Nico
Comment 29 Nico Schlömer 2009-06-16 10:45:54 UTC
Created attachment 26860 [details]
X.org log with KMS (ModeDebug)
Comment 30 Nico Schlömer 2009-06-16 10:46:31 UTC
Created attachment 26861 [details]
X.org log without KMS (working as expected) (ModeDebug)
Comment 31 Nico Schlömer 2009-06-16 10:48:13 UTC
Oh, and when I follow the recipe for vbios dumps (which is all I can do there b/c I totally don't know my way in /devices/), I only get an almost empty file (just some disclaimer about free software).
Comment 32 MaLing 2009-06-18 07:03:03 UTC
In order to reduce complexity, please modify your xorg.conf as below to ignore non-existent TV output, then upload your xorg.conf with modedebug optoin on, thanks.

Section "Device"
        ...
        Option    "monitor-TV"    "TV"
        ...
EndSection
        ...
Section "Monitor" 
        Identifier      "TV" 
        Option          "Ignore" "True" 
EndSection 
Comment 33 Nico Schlömer 2009-06-18 08:47:48 UTC
Created attachment 26923 [details]
X configuration with ignored TV

Hm, what am I doing wrong? The complexity isn't reduced, rather the line

"monitor-TV" is not used

in the logs. xorg.conf appended.
Comment 34 Michael Fu 2009-06-18 18:59:59 UTC
(In reply to comment #33)
> Created an attachment (id=26923) [details]
> X configuration with ignored TV
> 
> Hm, what am I doing wrong? The complexity isn't reduced, rather the line
> 
> "monitor-TV" is not used
> 
> in the logs. xorg.conf appended.
> 

yeah, in KMS mode, you need to name it like "monitor-TV1". the name was changed in KMS. :(
Comment 35 Nico Schlömer 2009-06-19 02:59:33 UTC
Progress, progress!

In KMS, I disabled the incorrectly recognized TV-out, and now actually got the DVI connector to display my desktop!
Unfortunately, the modelines are still not correct.

Logs appended.
Comment 36 Nico Schlömer 2009-06-19 03:00:31 UTC
Created attachment 26952 [details]
X.org log without KMS (ModeDebug, TV-out ignored)
Comment 37 Nico Schlömer 2009-06-19 03:01:12 UTC
Created attachment 26953 [details]
X.org log with KMS (ModeDebug, TV-out ignored)
Comment 38 Nico Schlömer 2009-06-19 03:01:40 UTC
Created attachment 26954 [details]
`xrandr -q` output with KMS (TV-out ignored)
Comment 39 Uros 2009-06-20 09:35:38 UTC
Same problem here since switching to KMS. EDID does not seem to be read off the external device.

Also, Apple mini-DVI to DVI / mini-DVI to VGA adapter detection does not seem to be working right either -- meaning when VGA adapter is plugged-in both VGA1 and DVI1 show as "connected" with "xrandr -q".

Running on:
x11-base/xorg-server-1.6.1.901-r3
x11-drivers/xf86-video-intel-2.7.1
media-libs/mesa-7.4.2
x11-libs/libdrm-2.4.11
sys-kernel/gentoo-sources-2.6.30-r1

And a question.. are FB_MODE_HELPERS and FIRMWARE_EDID kernel options related to this problem or not? I tried both built-in without success..
Comment 40 Uros 2009-06-20 09:39:08 UTC
Created attachment 26975 [details]
X.org log, KMS enebled, mini-dvi to vga adapter plugged-in after xorg server start.
Comment 41 Uros 2009-06-20 09:39:41 UTC
Created attachment 26976 [details]
X.org log, KMS enebled, mini-dvi to vga adapter plugged-in before xorg server start.
Comment 42 Uros 2009-06-20 09:40:44 UTC
Created attachment 26977 [details]
X.org config
Comment 43 MaLing 2009-06-23 22:42:59 UTC
Could you please confirm the patch commit id 619ac3b75a1e9b2df66857f6a0fb466f1da5fa9e, which will succeed in reading EDID in KMS. Meanwhile please ignore TV1 too.

Thanks
Ma Ling
Comment 44 Uros 2009-06-25 13:19:02 UTC
(In reply to comment #43)

Mentioned patch is already included in gentoo-sources-2.6.30-r1.

Is there another tool to read EDID off external device besides xrandr?
Comment 45 Nico Schlömer 2009-06-26 01:15:54 UTC
Indeed, the patch went into mainline at 2.6.30-rc8 I think. I'm using 2.6.30 (and got the screens misbehave).
Comment 46 Michael Fu 2009-06-26 02:05:38 UTC
Uros, Mac is probably a different bug. would you please open a new bug to track rahter than update to this one? thanks.
Comment 47 Nico Schlömer 2009-06-26 02:12:47 UTC
Err -- I'm on Mac(book 3,1) here as well, so I guess it's the exact same issue.
Comment 48 Michael Fu 2009-06-26 02:16:21 UTC
I see. in fact, we are looking for someone who could help us do some testing on Macbook. Bugs summary updated.
Comment 49 Uros 2009-06-26 04:35:15 UTC
Macbook 4,1 here. If there's anything else I can do, let me know.
Comment 50 Michael Fu 2009-06-26 19:44:35 UTC
Nico, Uros,

Does any of you have HW to help test the bug# 11211? It's about a Mini-DVI-to-SVideo for connect MacBook to a TV...

If you can help, would you please kindly help to post your update to that bug instead of this one? 

thanks a lot!
Comment 51 Nico Schlömer 2009-06-27 04:10:07 UTC
Hm, unfortunately I don't have an S-Video connector, just DVI here.. :/
Comment 52 MaLing 2009-06-28 06:30:16 UTC
(In reply to comment #36)
> Created an attachment (id=26952) [details]
> X.org log without KMS (ModeDebug, TV-out ignored)

(II) intel(0): Using fuzzy aspect match for initial modes
(II) intel(0): Output LVDS using initial mode 1024x768
(II) intel(0): Output TMDS-1 using initial mode 1024x768

In UMS , edid has been found correctly, but X chose 1024x768. However in KMS it seem not to read EDID correctly, I will send one patch later to check it.

Thanks
Ma Ling
Comment 53 Michael Fu 2009-06-29 22:13:18 UTC
(In reply to comment #52)
> (In reply to comment #36)
> > Created an attachment (id=26952) [details] [details]
> > X.org log without KMS (ModeDebug, TV-out ignored)
> 
> (II) intel(0): Using fuzzy aspect match for initial modes
> (II) intel(0): Output LVDS using initial mode 1024x768
> (II) intel(0): Output TMDS-1 using initial mode 1024x768
> 
> In UMS , edid has been found correctly, but X chose 1024x768. 

given the modelines from both monitor, I think X is doing right as initial configuration here.

> However in KMS it
> seem not to read EDID correctly, I will send one patch later to check it.
> 

this should be the root cause. the hacky code for Mac is commented out in KMS, compared with UMS, in get_modes function.

> Thanks
> Ma Ling
> 

Comment 54 Michael Fu 2009-06-29 22:16:57 UTC
(In reply to comment #39)
> 
> Also, Apple mini-DVI to DVI / mini-DVI to VGA adapter detection does not seem
> to be working right either -- meaning when VGA adapter is plugged-in both VGA1
> and DVI1 show as "connected" with "xrandr -q".
> 

this ought to be another thing need to fix - I think due to special HW design of Mac, its TMDS sdvo device seems also think it's connected with a monitor, when any MiniDVI adapter is used. We need to do a special check for Mac in sdvo's detect call back func, similar as we did for DVI-I case in the current code.
Comment 55 Michael Fu 2009-06-29 22:30:07 UTC
(In reply to comment #32)
> In order to reduce complexity, please modify your xorg.conf as below to ignore
> non-existent TV output, then upload your xorg.conf with modedebug optoin on,
> thanks.
> 
> Section "Device"
>         ...
>         Option    "monitor-TV"    "TV"
>         ...
> EndSection
>         ...
> Section "Monitor" 
>         Identifier      "TV" 
>         Option          "Ignore" "True" 
> EndSection 
> 

even though we quirk it using conf file, we should confirm if this has been fixed by your TV detection patches. Looks UMS works even without the ignore in xorg.conf. Would you pls attach your KMS version of TV detection patchs to verify? Or is it Keith's loaddetect fix (03d6069912babc07a3da20e715dd6a5dc8f0f867)?

Wow, many fixes need in one bug...
Comment 56 Uros 2009-06-30 00:14:58 UTC
(In reply to comment #50)
> Does any of you have HW to help test the bug# 11211? It's about a
> Mini-DVI-to-SVideo for connect MacBook to a TV...

Found one.. will post there.
Comment 57 MaLing 2009-06-30 05:12:09 UTC
(In reply to comment #56)
> (In reply to comment #50)
> > Does any of you have HW to help test the bug# 11211? It's about a
> > Mini-DVI-to-SVideo for connect MacBook to a TV...
> Found one.. will post there.

It's very kind of you! :)
Comment 58 MaLing 2009-07-01 05:35:31 UTC
Created attachment 27295 [details]
please try the debug patch in KMS mode, thanks
Comment 59 Nico Schlömer 2009-07-01 09:39:48 UTC
Alright, so I applied the patch, and the kernel just hanged right before it would normally switch to KMS (that's about two, three seconds into boot).
The last things printed to screen are

==================== *snip* ====================
i2c adapter i2c-3: unable to read EDID block.
i915 0000:00:02.0: DVI-D-I no EDID data
i2c adapter i2c-3: unable to read EDID block.
i915 0000:00:02.0: DVI-D-I no EDID data
==================== *snap* ====================
Comment 60 Michael Fu 2009-07-06 18:28:31 UTC
(In reply to comment #56)
> (In reply to comment #50)
> > Does any of you have HW to help test the bug# 11211? It's about a
> > Mini-DVI-to-SVideo for connect MacBook to a TV...
> 
> Found one.. will post there.
> 

any update, Uros?
Comment 61 MaLing 2009-07-07 17:38:29 UTC
Hi Nico,


Could you please confirm the KMS patch (commit 8ed9a5bc9c9425ef93a1b03b418300a5e18b2361) has been included your version, if yes, please remove TV1 ignore optoin in xorg.conf and upload log file with modedebug option on.

Thanks
Ma Ling
Comment 62 Nico Schlömer 2009-07-08 11:28:50 UTC
Created attachment 27502 [details]
Xorg log with KMS on kernel 2.6.31_rc2 (ModeDebug)

Alright, so I didn't have the patch installed, but I'm now running on 2.6.31_rc2 which includes the thing.

Xorg log attached.

There's no change comparing to the situation before the kernel patch: DVI1 fine, Modelines on external screen incorrect.

Cheers,
Nico
Comment 63 MaLing 2009-07-08 22:39:55 UTC
(In reply to comment #62)
> Created an attachment (id=27502) [details]
> Xorg log with KMS on kernel 2.6.31_rc2 (ModeDebug)
> Alright, so I didn't have the patch installed, but I'm now running on
> 2.6.31_rc2 which includes the thing.
> Xorg log attached.
> There's no change comparing to the situation before the kernel patch: DVI1
> fine, Modelines on external screen incorrect.
> Cheers,
> Nico

(II) intel(0): Output VGA1 disconnected
(II) intel(0): Output LVDS1 connected
(II) intel(0): Output DVI1 connected
(II) intel(0): Output TV1 disconnected
log tell us TV is disconnected, I will refine  patch to fetch EDID for DVI output in KMS mode.

Thanks
Ma Ling

 
Comment 64 MaLing 2009-07-16 20:56:56 UTC
Created attachment 27782 [details] [review]
pleaset try the patch on your machine in KMS mode, thanks.

(In reply to comment #54)
> (In reply to comment #39)
> > 
> > Also, Apple mini-DVI to DVI / mini-DVI to VGA adapter detection does not seem
> > to be working right either -- meaning when VGA adapter is plugged-in both VGA1
> > and DVI1 show as "connected" with "xrandr -q".
> > 
> this ought to be another thing need to fix - I think due to special HW design
> of Mac, its TMDS sdvo device seems also think it's connected with a monitor,
> when any MiniDVI adapter is used. We need to do a special check for Mac in
> sdvo's detect call back func, similar as we did for DVI-I case in the current
> code.

The patch intends to fetch edid for Mac machine.

thanks
Ma Ling
Comment 65 Nico Schlömer 2009-07-17 02:16:46 UTC
Hm, against which kernel version is the patch? It'd help me a lot if it was at least an RC, but rc-2 and rc-3 didn't work.
Comment 66 MaLing 2009-07-17 02:25:26 UTC
(In reply to comment #65)
> Hm, against which kernel version is the patch? It'd help me a lot if it was at
> least an RC, but rc-2 and rc-3 didn't work.

v2.6.29-rc1-26127-gdff33cf.
Thanks
Ma Ling
Comment 67 Nico Schlömer 2009-07-17 14:23:54 UTC
Ding-ding-ding: Success!
I applied the patch to 2.6.31_rc2 (with the necessary adaptations of course), and now the external screen is correctly identified (as DVI1) with the correct modelines. Nice!

By default, the resolution is not the highest, but that might have other reasons. Logs appended.

Thanks!
Nico
Comment 68 Nico Schlömer 2009-07-17 14:24:58 UTC
Created attachment 27804 [details]
xrandr -q output with the latest patch
Comment 69 Nico Schlömer 2009-07-17 14:27:33 UTC
Created attachment 27805 [details]
X.org log with KMS and latest patch
Comment 70 ykzhao 2009-08-07 06:03:13 UTC
Created attachment 28421 [details] [review]
Read the EDID for SDVO-DVI by using VGA DDC

Will you please try the debug patch on the latest Eric's drm-intel-next tree and see whether the EDID can be obtained for the SDVO-DVI?
Thanks.
Comment 71 Nico Schlömer 2009-08-10 03:37:14 UTC
Alright, I applied the patch to Eric's kernel and things seem to work out pretty fine. Logs attached.
Comment 72 Nico Schlömer 2009-08-10 03:37:51 UTC
Created attachment 28476 [details]
Xorg log with KMS on Eric Anholt's kernel
Comment 73 Nico Schlömer 2009-08-10 03:38:14 UTC
Created attachment 28477 [details]
dmesg on Eric Anholt's kernel
Comment 74 Nico Schlömer 2009-08-10 03:38:40 UTC
Created attachment 28478 [details]
`xrandr -q` on Eric Anholt's kernel
Comment 75 Nico Schlömer 2009-09-03 08:16:55 UTC
Errm, err, by the way, Eric's kernel still works alright.
Comment 76 ykzhao 2009-09-09 23:13:03 UTC
(In reply to comment #75)
> Errm, err, by the way, Eric's kernel still works alright.

Thanks for the test. Now it seems that the EDID can be obtained correctly on Mini-dvi after applying the patch in comment #70.

As the following commit is already shipped in Eric's drm-intel-next tree, it will be marked as resolved.

commit 57cdaf90f5f607eb029356074fefb66c9b1c0659
Author: Keith Packard <keithp@keithp.com>
Date:   Fri Sep 4 13:07:54 2009 +0800

    drm/I915: Use the CRT DDC to get the EDID for DVI-connector on Mac

Thanks.
 

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.