Bug 24255

Summary: [945GM Mac] DVI monitor not detected with KMS
Product: DRI Reporter: Julien Cristau <jcristau>
Component: DRM/IntelAssignee: ykzhao <yakui.zhao>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: major    
Priority: high CC: cworth, hramrach, michael.fu, shawn.t.rutledge, tero, yakui.zhao
Version: unspecifiedKeywords: NEEDINFO, regression
Hardware: x86 (IA32)   
OS: Linux (All)   
URL: http://bugs.debian.org/548045
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 25645    
Attachments:
Description Flags
X log from driver 2.9
none
X log with 02fe9be6 reverted
none
X log from 2.9 driver with modedebug
none
X log from patched 2.9 with modedebug
none
dmesg excerpt with KMS messages
none
KMS kernel messages with drm debug
none
try the debug patch to read some debug info from SDVO POM/DDC1/DDC2/DDC3
none
KMS kernel messages with the patch applied
none
try the update debug patch, which uses another mechanism to detect SDVO card
none
KMS kernel messages with the later patch applied
none
kernel messages with the new patch
none
Xorg.0.log, Eee Box B203, 2.9.0 from Ubuntu Karmic packages
none
Xorg.0.log, Eee Box B203, 2.9.0 from Ubuntu Karmic packages + patch
none
log of 2.6.32 with the above mentioned patch none

Description Julien Cristau 2009-10-01 07:04:26 UTC
Bug reported to Debian by Michal Suchanek <hramrach@centrum.cz> (http://bugs.debian.org/548045):

With xf86-video-intel 2.9, Michal's DVI monitor gets detected as disconnected, whereas 2.8.1 was fine.  He bisected it to:

commit 02fe9be695f7e209944bd0f7b67950f93619feee
Author: Zhao Yakui <yakui.zhao@intel.com>
Date:   Tue Sep 22 10:58:38 2009 +0800

    Check whether the DVI-I/D is connected or disconnected based on EDID

    When the monitor is digital type for SDVO-DVI D, there should exist the EDID. If
    there is no EDID, it should be detected as disconnected.

    Signe-off-by: Zhao Yakui <yakui.zhao@intel.com>

With that patch reverted, the driver does seem to find an EDID for this monitor, as far as I can tell from Michal's X log.
Comment 1 Julien Cristau 2009-10-01 07:07:20 UTC
Created attachment 29977 [details]
X log from driver 2.9
Comment 2 Julien Cristau 2009-10-01 07:08:10 UTC
Created attachment 29978 [details]
X log with 02fe9be6 reverted
Comment 3 ykzhao 2009-10-08 20:52:43 UTC
(In reply to comment #2)
> Created an attachment (id=29978) [details]
> X log with 02fe9be6 reverted
> 
Will you please add the "modedebug" option in xorg.conf and attach the output of xorg.0.log in 2.8.1 and 2.9.0?

Thanks.

Comment 4 Michal Suchanek 2009-10-09 04:59:05 UTC
Created attachment 30215 [details]
X log from 2.9 driver with modedebug
Comment 5 Michal Suchanek 2009-10-09 05:00:25 UTC
Created attachment 30216 [details]
X log from patched 2.9 with modedebug
Comment 6 ykzhao 2009-10-09 22:36:05 UTC
Please try the KMS mode and see whether the issue still exists.
Thanks.
Comment 7 ykzhao 2009-10-09 22:47:43 UTC
From the log in comment #5/#6 it seems that the EDID is obtained by using the CRT DDC_A bus instead of SDVO DDC bus. But unfortunately this method is not used in course of SDVO detection.
In such case as no EDID is obtained by using SDVO DDC bus, it is regarded as disconnected. Before the following commit is shipped, it is still regarded as connected and we will continue to initialize it although no EDID can be obtained by using SDVO DDC bus.
   >commit 02fe9be695f7e209944bd0f7b67950f93619feee
   >Author: Zhao Yakui <yakui.zhao@intel.com>
   >Date:   Tue Sep 22 10:58:38 2009 +0800

    Check whether the DVI-I/D is connected or disconnected based on EDID

   
Please try the KMS mode on the Eric's drm-intel-next tree and see whether the issue still exists. Of course the 2.6.32-rc1/3 kernel is also OK as the following the commit is already shipped.

   >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.
Comment 8 ykzhao 2009-10-09 22:53:55 UTC
*** Bug 24429 has been marked as a duplicate of this bug. ***
Comment 9 Michal Suchanek 2009-10-12 08:21:21 UTC
Created attachment 30288 [details]
dmesg excerpt with KMS messages

KMS seems broken as well.

I cannot start the X server at all currently due to unresolved symbols which is probably unrelated.
Comment 10 ykzhao 2009-10-12 08:57:13 UTC
(In reply to comment #9)
> Created an attachment (id=30288) [details]
> dmesg excerpt with KMS messages
> KMS seems broken as well.
> I cannot start the X server at all currently due to unresolved symbols which is
> probably unrelated.
Please add the boot option of "drm.debug=0x06" and attach the output of dmesg.
From the log in comment #9 it seems that no device is detected as connected.
But when the UMS mode is used, the TMDS-0 device can be detected.

Thanks.

Comment 11 Michal Suchanek 2009-10-13 09:27:00 UTC
Created attachment 30348 [details]
KMS kernel messages with drm debug

It's not surprising the kernel does not find the monitor if the user mode X server did not either.

However, it turns out that the kernel does find the monitor if 

1) module is loaded without KMS
2) X server is started (even the one which does not find the monitor)
3) module is loaded with KMS

the messages are repeated many times because it took a few tries to find the order in which things "work".

It seems the X server (or rather KMS, X without KMS works fine) kills the console. When I switch to console the screen goes to power saving mode.
Comment 12 ykzhao 2009-10-13 22:45:52 UTC
(In reply to comment #11)
> Created an attachment (id=30348) [details]
> KMS kernel messages with drm debug
> 
> It's not surprising the kernel does not find the monitor if the user mode X
> server did not either.
> 
Thanks for the response.
> However, it turns out that the kernel does find the monitor if 
> 
> 1) module is loaded without KMS
> 2) X server is started (even the one which does not find the monitor)
> 3) module is loaded with KMS
> 
From the dmesg log it seems that sometimes the SDVO_B device can't be detected, which causes that it won't detect the external monitor attached to the SDVO Card.
> [  159.569117] [drm:intel_sdvo_read_byte], i2c transfer returned -6
> [  159.569123] [drm:intel_sdvo_init], No SDVO device found on SDVOB

But sometimes it can detect the SDVO card on the SDVO B channel. In such case it can detect the external monitor attached to the SDVO Card. Then the X can be started correctly.
   >[  247.322198] [drm:intel_sdvo_init], SDVOB device VID/DID: 04:AA.03, clock range 25MHz - 165MHz, input 1: Y, input 2: N, output 1: Y, output 2: N

I will investigate why the SDVO card is not detected correctly on this box.
Thanks.
> the messages are repeated many times because it took a few tries to find the
> order in which things "work".
> 
> It seems the X server (or rather KMS, X without KMS works fine) kills the
> console. When I switch to console the screen goes to power saving mode.
> 

Comment 13 ykzhao 2009-10-13 23:28:42 UTC
Created attachment 30372 [details] [review]
try the debug patch to read some debug info from SDVO POM/DDC1/DDC2/DDC3

Will you please try the debug patch and attach the output of dmesg?Please add the boot option of "drm.debug=0x06".
thanks
Comment 14 Michal Suchanek 2009-10-14 03:40:38 UTC
Created attachment 30382 [details]
KMS kernel messages with the patch applied
Comment 15 ykzhao 2009-10-15 18:51:42 UTC
In KMS mode the DVI monitor can be detected if the SDVO_B card can be detected.
This is fixed by the following commit:
   > >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


But the remaining issue is that sometimes the SDVO card can't be detected correctly. In such case it will cause that no output device is detected.
   > [  159.569117] [drm:intel_sdvo_read_byte], i2c transfer returned -6
   > [  159.569123] [drm:intel_sdvo_init], No SDVO device found on SDVO
I will investigate this issue.

Thanks.
Comment 16 ykzhao 2009-10-15 19:15:56 UTC
Created attachment 30464 [details] [review]
try the update debug patch, which uses another mechanism to detect SDVO card

Will you please try the updated debug patch and attach the output of dmesg?
The boot option of "drm.debug=0x06" is still required.

thanks.
Comment 17 Michal Suchanek 2009-10-16 08:55:00 UTC
Created attachment 30479 [details]
KMS kernel messages with the later patch applied

The same result. Kernel does not detect the monitor until X with userspace modesetting is run at least once.

I hope you can tell by the messages which patch was applied. I am sure that I repatched the kernel but the installed module blob looks the same and either adds some more noise to the log so I can't really check.
Comment 18 Michal Suchanek 2009-10-30 08:46:30 UTC
Created attachment 30841 [details]
kernel messages with the new patch

I added a kprintf to be sure I have the nae patch. No change.

KMS only works after running non-KMS X.
Comment 19 Michal Suchanek 2009-11-05 03:33:25 UTC
If you need any more information please specify.
Comment 20 ykzhao 2009-11-08 18:42:02 UTC
The commit #02fe9be6 is reverted in the following commit:
   commit 8e4fc7d3ba0baa6b680c685429060cb62a08f89f
Author: Carl Worth <cworth@cworth.org>
Date:   Mon Oct 26 04:40:51 2009 -0700

    Revert "Check whether the DVI-I/D is connected or disconnected based on
EDID"

And the above commit is already shipped in 2.9.1 branch. So this bug will be
marked as resolved.

Thanks
Comment 21 Michal Suchanek 2009-11-09 01:24:07 UTC
it's still broken in KMS, though.
Comment 22 Michal Suchanek 2009-11-11 06:44:05 UTC
Only broken in KMS now, updating summary
Comment 23 Michael Fu 2009-11-17 05:38:01 UTC
what's the model of this computer? Is it a Mac? thanks.
Comment 24 Michal Suchanek 2009-11-17 12:27:35 UTC
It's in the later kernel logs:

Hardware name: Macmini1,1
Comment 25 Tero Tilus 2009-11-25 00:06:24 UTC
This affects me too.  I have ViewSonic VP201b connected to Asus Eee Box model B203, which has Intel 945G.

terotil@pulu:~$ lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation 82945G/GZ Integrated Graphics Controller (rev 02)

Reverting 02fe9be695f7e209944bd0f7b67950f93619feee works for me.
http://tero.tilus.net/rutinat/2009/11/20/ubuntu-karmic-koala-asus-eee-box-and-black-screen/
Comment 26 Michael Fu 2009-11-25 00:27:31 UTC
(In reply to comment #25)
> This affects me too.  I have ViewSonic VP201b connected to Asus Eee Box model
> B203, which has Intel 945G.
> 
> terotil@pulu:~$ lspci | grep VGA
> 00:02.0 VGA compatible controller: Intel Corporation 82945G/GZ Integrated
> Graphics Controller (rev 02)
> 
> Reverting 02fe9be695f7e209944bd0f7b67950f93619feee works for me.
> http://tero.tilus.net/rutinat/2009/11/20/ubuntu-karmic-koala-asus-eee-box-and-black-screen/
> 

any log?
Comment 27 Tero Tilus 2009-11-28 03:39:53 UTC
Logs, yes, logs...
Comment 28 Tero Tilus 2009-11-28 03:44:52 UTC
Created attachment 31529 [details]
Xorg.0.log, Eee Box B203, 2.9.0 from Ubuntu Karmic packages
Comment 29 Tero Tilus 2009-11-28 03:47:28 UTC
Created attachment 31530 [details]
Xorg.0.log, Eee Box B203, 2.9.0 from Ubuntu Karmic packages + patch

the patch would be revert of 02fe9be695f7e209944bd0f7b67950f93619feee
Comment 30 Michael Fu 2009-12-01 22:08:17 UTC
could you pls try:

http://lists.freedesktop.org/archives/intel-gfx/2009-December/004979.html

Comment 31 Michal Suchanek 2009-12-07 07:51:06 UTC
(In reply to comment #30)
> could you pls try:
> 
> http://lists.freedesktop.org/archives/intel-gfx/2009-December/004979.html
> 

I upgraded to 2.6.32 with this patch applied.

It resolves the problem for me. I can start X without switching between non-KMS and KMS X server.
Comment 32 Michal Suchanek 2009-12-07 07:51:52 UTC
Created attachment 31816 [details]
log of 2.6.32 with the above mentioned patch
Comment 33 Michael Fu 2009-12-07 21:59:47 UTC
fix in comment# 30.
Comment 34 Michal Suchanek 2010-02-04 01:35:34 UTC
This is not in kernel as of 2.6.32.4