Bug 17823

Summary: [945GM] Unable to switch to VGA with 2.4.2, VGA-1 replaced by TV-1
Product: xorg Reporter: Ulhume <artisan.ulhume>
Component: Driver/intelAssignee: Wang Zhenyu <zhenyu.z.wang>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: critical    
Priority: medium CC: antoni, artisan.ulhume, eich, kent.liu, lewsm, liangghv, mat, michael.fu, neogw, quanxian.wang, sndirsch, zhenyu.z.wang
Version: 7.3 (2007.09)Keywords: NEEDINFO
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 20615    
Attachments:
Description Flags
Xorg log
none
prefer VGA over TV output
none
2.5.1 Debug logs
none
SDVO use attached display flag for output setup
none
Xorg log file with patch applied on last code base (2.6.99)
none
Handle multifunc SDVO encoder
none
SDVO: handle multifunction encoder (updated for HEAD version)
none
Add new option for SDVO output setting
none
Updated patch for multifunction SDVO device
none
video clip of gnome-login problem
none
Xorg.0.log collected at AltF1 before Xlogin in AltF7
none
xorg.conf file with disable monitor-tv
none
xorg log after disabling monitor-tv
none
xorg.conf for 2 monitors
none
xorg log files after enabling 2 monitors none

Description Ulhume 2008-09-29 01:35:49 UTC
Created attachment 19278 [details]
Xorg log

--------
Linux Distro: Mandriva 2008.1
X server : 1.4.2
Hardware : Fujitsu U810/1010 with intel 945GM
----------


When using Intel driver 2.4.2, I was able to use xrandr to switch from LVDS to VGA-1. When I was running xrandr -q, I had this:
Screen 0: minimum 320 x 200, current 1024 x 768, maximum 2048 x 2048
VGA disconnected (normal left inverted right x axis y axis)
LVDS connected 1024x600+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   1024x600       59.9*+
   800x600        85.1     72.2     75.0     60.3     56.2  
   640x480        85.0     72.8     75.0     59.9  
   720x400        85.0  
   640x400        85.1  
   640x350        85.1  
VGA-1 connected 1024x768+0+0 (normal left inverted right x axis y axis) 376mm x 301mm
   1280x1024      60.0 +   74.9     75.0     71.9     59.9  
   1152x864       75.0     74.8  
   1024x768       75.1*    70.1     60.0  
   832x624        74.6  
   800x600        72.2     75.0     60.3  
   640x480        75.0     72.8     66.7     60.0  
   720x400        70.1  
   640x350        70.1  
TV disconnected (normal left inverted right x axis y axis)


With upgrading the driver to 2.4.2, xrandr give me that result :
Screen 0: minimum 320 x 200, current 1024 x 768, maximum 2048 x 2048
VGA disconnected (normal left inverted right x axis y axis)
LVDS connected 1024x600+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   1024x600       59.9*+
   800x600        85.1     72.2     75.0     60.3     56.2  
   640x480        85.0     72.8     75.0     59.9  
   720x400        85.0  
   640x400        85.1  
   640x350        85.1  
TV-1 connected 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   1280x1024@60.00   60.0  
   1024x768       60.0* 
   1024x768@60.00   60.0  
   920x766@60.00   60.0  
   832x624@60.00   60.0  
   800x600        60.3  
   800x600@60.00   60.0  
   720x576@60.00   60.0  
   704x576@60.00   60.0  
   720x540@60.00   60.0  
   720x480@60.00   60.0  
   640x480        59.9  

As you can see, VGA-1 is gone, replaced by TV-1. And I just can't switch to VGA any more, even by trying the TV output. 

When running the Xorg server by hand, I have this strange error :
(EE) intel(0): underrun on pipe A!

If you need more information, please tell me. I attached Xorg logs (with ModeDebug activated) when using 2.4.2 driver. 

Thanks for your help
Comment 1 Ulhume 2008-09-29 01:50:00 UTC
Complementary information, when I downgrade the driver without a power cycle (just restarting X), I can switch to VGA but pixel clocks are totally messed. I have to power cycle in order to restore correct settings
Comment 2 Gordon Jin 2008-09-29 03:03:13 UTC
>> When using Intel driver 2.4.2, I was able to use xrandr to switch from LVDS to
VGA-1.
What's the previous working driver version (before 2.4.2)? You seem to make a typo.
Comment 3 Ulhume 2008-09-29 03:34:54 UTC
(In reply to comment #2)
> >> When using Intel driver 2.4.2, I was able to use xrandr to switch from LVDS to
> VGA-1.
> What's the previous working driver version (before 2.4.2)? You seem to make a
> typo.
> 

Oups, sorry, previous version was 2.2.1
Comment 4 Jesse Barnes 2008-11-25 14:36:59 UTC
Sounds like you have an SDVO attached VGA port on this system and the SDVO code is confused about its type.  There have been some fixes to the master branch though lately, does this still happen with the 2.5.1 driver or git master?
Comment 5 Ulhume 2008-11-25 15:44:50 UTC
I built 2.5.1 driver and unfortunately it is exactly the same. 
Comment 6 Jesse Barnes 2008-11-25 16:35:34 UTC
Created attachment 20588 [details] [review]
prefer VGA over TV output

It looks like your SDVO capabilities indicate both VGA and TV outputs.  Does your machine have both?  This patch should make the driver preferentially initialize the VGA output instead, hopefully making things work again for you.  Can you give it a try?
Comment 7 Wang Zhenyu 2008-11-25 17:54:44 UTC
Could you attach X log with ModeDebug option on? And  your machine seems only have VGA and no TV right?
Comment 8 Ulhume 2008-11-25 18:40:49 UTC
Created attachment 20590 [details]
2.5.1 Debug logs
Comment 9 Ulhume 2008-11-25 18:42:41 UTC
No, this is a very small netbook (Fujitsu U810/U1010) with no TV output, just Panel and VGA. 

I attached the debug output with 2.5.1 build
Comment 10 Wang Zhenyu 2008-11-25 22:50:19 UTC
I think your SDVO chip is buggy as it announced non-existing outputs. I think
Jesse's patch will fix for you.
Comment 11 Ulhume 2008-11-26 00:16:36 UTC
Patch applied, it's working very well, thanks !!!

Is this something that could be applied for anyone and can I notify Mandriva about it ?
Comment 12 Wang Zhenyu 2008-11-26 00:46:55 UTC
Unfortunately we can't push this patch now. I've just checked on a 915G LF board which has SDVO-TV output, the capability flag looks like yours, means SDVO chip announces support for VGA and TV, but this board has only TV output. With Jesse's patch, we will have fault type on this board.

It looks we might have to find out what's the actually current SDVO output type.
Still open this one for reference.
Comment 13 Ulhume 2008-11-26 01:08:20 UTC
Any way I can help ?
Comment 14 Wang Zhenyu 2008-11-26 01:16:59 UTC
We need to check SDVO spec again to see if any command can be used for this, or we might provide config option. You may use Jesse's patch for now, and help to test with any future patches. Thanks!
Comment 15 Wang Zhenyu 2008-12-04 22:14:34 UTC
Created attachment 20826 [details] [review]
SDVO use attached display flag for output setup

Ulhume, could you help to try with this patch in place of Jesse's origin patch? This is applied to current git master. Please help to report back the result with X log with ModeDebug on.

Thanks.
Comment 16 Ulhume 2008-12-14 05:02:47 UTC
Created attachment 21135 [details]
Xorg log file with patch applied on last code base (2.6.99)
Comment 17 Ulhume 2008-12-14 05:07:07 UTC
So I tried the patch, it's working well. I had at one point a strange behavior (attached log file). When using xrandr, the LVDS panel was shown as "UNKNOWN-1". I had to restart the server in order to get LVDS back. 

But for my "core" problem this patch seems to be fine. I have VGA-1 and I can switch to it. 

There is a last problem with pm-suspend. It seems that when going back to life, the backlight stays off. I have to switch to text mode and go back to graphic mode in order to switch on the backlight. I'm not sure this is intel driver related so you tell me. 
Comment 18 Wang Zhenyu 2008-12-15 22:03:07 UTC
Comment on attachment 20826 [details] [review]
SDVO use attached display flag for output setup

This does wrong to get attached display in initialization, as that refused an existing output without monitor to be setup in X start. I'm reworking the SDVO multi-function encoder support patch.
Comment 19 Wang Zhenyu 2008-12-16 18:42:39 UTC
Created attachment 21225 [details] [review]
Handle multifunc SDVO encoder

Here's my current patch for handle multiple function SDVO encoder. Please help to verify this, thanks!
Comment 20 Ulhume 2008-12-16 22:49:50 UTC
It works nicely here. Do you need me to do some specific test/command output ? 
Comment 21 Ulhume 2009-01-06 07:29:52 UTC
Created attachment 21722 [details]
SDVO: handle multifunction encoder (updated for HEAD version)

This is juste an updated patch working with last GIT version. Any chance to get this mainstream ?
Comment 22 Wang Zhenyu 2009-01-06 21:15:06 UTC
Thanks, my updated patch has been on intel-gfx@lists.freedesktop.org for people to review and comment. I'll do more testing and push it if without problem.
Comment 23 Ulhume 2009-01-07 00:26:13 UTC
On this for sure, I test your patch every day and it's working perfectly here. Many thanks for this !!!
Comment 24 Wang Zhenyu 2009-01-08 18:52:54 UTC
Created attachment 21820 [details] [review]
Add new option for SDVO output setting

I've reworked the fix in another way, to add an option for SDVO output setting if our driver's default priority list is not right according with current connect in multifunction SDVO encoder case.

Origin patch doesn't work right in case there's no monitor connected when X start, and later when connected, current randr output can't be changed easily after output setup. And for user multi-head config it also can't handle correctly. It looks we should detect or initialize the connect type earlier in SDVO setup. I'm asking hw guys for possible method to detect real output type. If that can't be done, we can use this patch instead. So you provide option
like Option "SDVOBOutput" "VGA-1" should work, and normal multi-head config can work too.
Comment 25 Michael Fu 2009-01-31 23:57:12 UTC
Rather than doing this, why not create outputs covers reported capabilities?

1)RGB->VGA
2)Since there will be only one of CVBS/SVID/YPRPB/SCART, these capabilities can be grouped to create one output called TV to cover them all. Any one capability report connected, the TV output is connected.

as long as the output is reported as disconnected, it won't be trouble, right?


Comment 26 Lew Shih Ming 2009-02-04 01:47:24 UTC
Hi zhenyu,

Does the latest intel driver includes your patches that ccan solve bug 18687 as well? 

Should I try to use your patch in comment #24?
Comment 27 Stefan Dirsch 2009-02-04 02:10:51 UTC
Even git master does not include zhenyu's patch, although there is no better solution at the moment.
Comment 28 Lew Shih Ming 2009-02-04 22:11:20 UTC
Is there any timeline or schedule to release a new driver with sdvo fix?
Comment 29 Guek Wu Neo 2009-02-05 01:24:38 UTC
Intel,

we are looking forward to you reply for question posted in comment#26/28 so that Novell can get it  to include the fix in for us.

Comment 30 Stefan Dirsch 2009-02-05 01:50:53 UTC
Lew/Guek. Even if intel would make a release with this patch, Novell won't update to this release, since it might include regressions and we no longer have time for extensive testing. Question is, if Intel considers to put this patch in a new release, or if it needs to be handled differently anyway and the patch in comment #24 is just a hack. I don't know. Comment #25 sounds like this.
Comment 31 Wang Zhenyu 2009-02-08 18:55:12 UTC
yeah, new option might not be ideal solution. Or we just go with my previous approach, I'll ask keith/eric for comments.
Comment 32 Wang Zhenyu 2009-02-18 22:39:33 UTC
Created attachment 23100 [details] [review]
Updated patch for multifunction SDVO device

Here's refreshed patch against git master. Please help to test and verify.
Comment 33 Lew Shih Ming 2009-02-19 00:49:49 UTC
I just did a git clone from git://anongit.freedesktop.org/git/xorg/driver/xf86-video-intel. May I know what version is it? I cannot build it due to libdrm from SLE 11 is still 2.4.1.
Comment 34 Wang Zhenyu 2009-02-19 01:23:36 UTC
Driver's version is marked in configure.ac.

You can grab libdrm 2.4.4 tarball from http://dri.freedesktop.org/libdrm/, and build yourself.
Comment 35 Michael Fu 2009-02-23 18:47:14 UTC
(In reply to comment #33)
> I just did a git clone from
> git://anongit.freedesktop.org/git/xorg/driver/xf86-video-intel. May I know what
> version is it? I cannot build it due to libdrm from SLE 11 is still 2.4.1.
> 

Lew Shih Ming, are you able to continue this with zhenyu's suggestion?
Comment 36 Lew Shih Ming 2009-02-23 19:24:28 UTC
(In reply to comment #35)
> (In reply to comment #33)
> > I just did a git clone from
> > git://anongit.freedesktop.org/git/xorg/driver/xf86-video-intel. May I know what
> > version is it? I cannot build it due to libdrm from SLE 11 is still 2.4.1.
> > 
> Lew Shih Ming, are you able to continue this with zhenyu's suggestion?

Hi Zhenyu and Michael,

I am still working on it. I just got the machine back for testing and will verify it by today. Will update you guys once I applied the patch to the git-master.
Comment 37 Lew Shih Ming 2009-02-23 23:15:59 UTC
(In reply to comment #34)
> Driver's version is marked in configure.ac.
> You can grab libdrm 2.4.4 tarball from http://dri.freedesktop.org/libdrm/, and
> build yourself.

Zhenyu,

I trying to compile the libdrm-2.4.5. but encounter some issue. From the readme of the tarball, I followed the instruction doing ./configure --prefix=usr/ --exec-prefix=/ and make install.

Then I compile xf86-video-intel by doing ./autogen.sh. It stop at a point when it says:-
checking for DRM... configure: error: Package requirements (libdrm >=2.4.5) were not met:
Requested 'libdrm >= 2.4.5' but version of libdrm is 2.4.1

Then I cannot carry on and do make. Could you advice?

Comment 38 qwang13 2009-02-24 00:24:18 UTC
> I trying to compile the libdrm-2.4.5. but encounter some issue. From the readme
> of the tarball, I followed the instruction doing ./configure --prefix=usr/
> --exec-prefix=/ and make install.
> 
> Then I compile xf86-video-intel by doing ./autogen.sh. It stop at a point when
> it says:-
> checking for DRM... configure: error: Package requirements (libdrm >=2.4.5)
> were not met:
> Requested 'libdrm >= 2.4.5' but version of libdrm is 2.4.1
> 
> Then I cannot carry on and do make. Could you advice?
> 

following the below instruction to build libdrm and xf86-video-intel
1) libdrm
./autogen.sh --prefix=/usr --libdir=/usr/lib (note: if you use x64, please use /usr/lib64)
and then
make install

2) xf86-video-intel
Should be the same as libdrm. Just note x64 setting.

What you come across for libdrm >=2.4.5?
1) you got wrong code. Seems it should master code. 
2) you install libdrm.pc to wrong directory. That is why you should set --libdir=/usr/lib(or /usr/lib64)

Wish it can help you.
Comment 39 Lew Shih Ming 2009-02-24 01:58:47 UTC
(In reply to comment #38)
> > I trying to compile the libdrm-2.4.5. but encounter some issue. From the readme
> > of the tarball, I followed the instruction doing ./configure --prefix=usr/
> > --exec-prefix=/ and make install.
> > 
> > Then I compile xf86-video-intel by doing ./autogen.sh. It stop at a point when
> > it says:-
> > checking for DRM... configure: error: Package requirements (libdrm >=2.4.5)
> > were not met:
> > Requested 'libdrm >= 2.4.5' but version of libdrm is 2.4.1
> > 
> > Then I cannot carry on and do make. Could you advice?
> > 
> following the below instruction to build libdrm and xf86-video-intel
> 1) libdrm
> ./autogen.sh --prefix=/usr --libdir=/usr/lib (note: if you use x64, please use
> /usr/lib64)
> and then
> make install
> 2) xf86-video-intel
> Should be the same as libdrm. Just note x64 setting.
> What you come across for libdrm >=2.4.5?
> 1) you got wrong code. Seems it should master code. 
> 2) you install libdrm.pc to wrong directory. That is why you should set
> --libdir=/usr/lib(or /usr/lib64)
> Wish it can help you.

Thanks for your help. I had successfully built the intel driver. FYI, there is no autogen.sh script in libdrm directory. So I use configure script to do the trick. I will continue with the dual display testing.
Comment 40 Lew Shih Ming 2009-02-25 01:04:12 UTC
(In reply to comment #34)
> Driver's version is marked in configure.ac.
> You can grab libdrm 2.4.4 tarball from http://dri.freedesktop.org/libdrm/, and
> build yourself.

Hi Zhenyu,

I had built both libdrm and xfree86-video-intel on SLED11 RC4. The kernel is 2.6.27.15-2-pae. After rebooting my system, I could not login from gnome-login. I have not patch with the updated patch from comment #32. Could it have break some of the xorg code?
Comment 41 Wang Zhenyu 2009-02-25 17:13:21 UTC
I don't understand if you haven't used that patch, how could it break anything? 

Please try to apply that patch to your xf86-video-intel, then build and install again.
Comment 42 Lew Shih Ming 2009-02-25 19:19:51 UTC
(In reply to comment #41)
> I don't understand if you haven't used that patch, how could it break anything? 
> Please try to apply that patch to your xf86-video-intel, then build and install
> again.

I had tested with the patch. It's still the same problem. Do you need me to collect any logs?
Comment 43 Lew Shih Ming 2009-02-26 06:20:06 UTC
Created attachment 23323 [details]
video clip of gnome-login problem

This is a video clip that I had taken on the gnome-login problem. The resolution of the clip is very low but hopefully you guys can get the idea of what I meant. 

After I enter with my user account and password, it will start to login without any authcentication error. Then the screen will start to refresh and it comes back to the same login screen.
Comment 44 Stefan Dirsch 2009-02-26 07:54:36 UTC
Well, this can be everything. Xserver crashing or Gnome desktop terminating the Xserver to kill the Xsessions immediately - for whatever reasons.
Comment 45 Wang Zhenyu 2009-02-27 00:49:46 UTC
Could you paste the X log in failure case?
Comment 46 Guek Wu Neo 2009-02-27 02:40:38 UTC
Created attachment 23365 [details]
Xorg.0.log collected at AltF1  before Xlogin in AltF7

Xorg.0.log collected at AltF1  before Xlogin in AltF7

Not able to proceed to ALTF1 once the terminal goes through the Xlogin in ALTF7 and relaunch login screen.
Comment 47 Michael Fu 2009-02-27 04:47:52 UTC
this doesn't look like caused by zhenyu's patch. The mis-detected-integrated-TV should be a problem of our bios parsing code... 

Comment 48 Wang Zhenyu 2009-03-01 19:20:06 UTC
Could you ignore integrated TV in xorg.conf? 

Section "Monitor"
    Identifier "TV"
    Option "Ignore" "true"
EndSection

Section "Device"
    ...
    Driver "intel"
    ...
    Option "monitor-TV" "TV"
EndSection
Comment 49 Lew Shih Ming 2009-03-01 22:24:54 UTC
Created attachment 23429 [details]
xorg.conf file with disable monitor-tv

Hi Zhenyu,

I had included the new section to disable monitor-TV. It still does not work. Is there any workaround for the bios parsing code?
Comment 50 Michael Fu 2009-03-01 23:10:59 UTC
(In reply to comment #49)
> Created an attachment (id=23429) [details]
> xorg.conf file with disable monitor-tv
> 
> Hi Zhenyu,
> 
> I had included the new section to disable monitor-TV. It still does not work.
> Is there any workaround for the bios parsing code?
> 

please ignore my comment in comment#47, it shouldn't be the problem of your symptom..zhenyu's solution in comment# 48 should be enough, if it's caused by that... 

have you attached monitor to both VGA ports on your platform? To test zhenyu's patch, we need it. thanks.
Comment 51 Lew Shih Ming 2009-03-02 02:01:13 UTC
Created attachment 23433 [details]
xorg log after disabling monitor-tv

This is the xorg log I had collected after configuring xorg.conf with the disabling of monitor-tv. The login problem still exists with/without 2 monitors connected.
Comment 52 Michael Fu 2009-03-02 05:01:19 UTC
from the log, the SDVO output has been successfully detected as VGA-1 now, rather than TV-1 as before. This is what zhenyu's patch is about..

For the issue you saw in comment# 43, it should be caused by something else. Have you tried to turns option like NoAccel, EXANoCompsite on? Compiz or other fancy desktop feature could be the culprit, too.
Comment 53 Lew Shih Ming 2009-03-03 02:00:32 UTC
Created attachment 23467 [details]
xorg.conf for 2 monitors

Thanks Michael for your tips. I am able to login after uninstalling compiz completely. 

Zhengyu, this is the xorg.conf file I used to configure dual monitors manually after unsuccessfull attempts of using the previous xorg.conf file that I had used to disable LVDS. I am attaching the log file in the next comment.
Comment 54 Lew Shih Ming 2009-03-03 02:01:36 UTC
Created attachment 23468 [details]
xorg log files after enabling 2 monitors
Comment 55 Wang Zhenyu 2009-03-04 23:10:33 UTC
Pushed the patch. Close.
commit 0d20bbbc2005a51f427a9ae6b6a66dbbb101dbab
Author: Zhenyu Wang <zhenyu.z.wang@intel.com>
Date:   Thu Feb 19 14:24:24 2009 +0800

    SDVO: handle multifunction encoder (try 2)
    
    For SDVO encoder that advertise multiple functions,
    we have to get attached display to determine current
    output, and update output's name according with
    current type.
Comment 56 Lew Shih Ming 2009-03-05 01:51:25 UTC
(In reply to comment #55)
> Pushed the patch. Close.
> commit 0d20bbbc2005a51f427a9ae6b6a66dbbb101dbab
> Author: Zhenyu Wang <zhenyu.z.wang@intel.com>
> Date:   Thu Feb 19 14:24:24 2009 +0800
>     SDVO: handle multifunction encoder (try 2)
>     For SDVO encoder that advertise multiple functions,
>     we have to get attached display to determine current
>     output, and update output's name according with
>     current type.

Hi Zhenyu,

Do you mean that you had committed the patch to git? 
Comment 57 Lew Shih Ming 2009-03-11 05:28:26 UTC
The fix have successfully replaced TV-1 with VGA-1. Does this meant that dual displays (2 external VGA) should be fixed too? I still have problem displaying on my 2nd VGA interface.
Comment 58 Michael Fu 2009-03-11 18:04:39 UTC
(In reply to comment #57)
> The fix have successfully replaced TV-1 with VGA-1. Does this meant that dual
> displays (2 external VGA) should be fixed too? I still have problem displaying
> on my 2nd VGA interface.
> 

in comment# 53, you've confirmed getting rid of compiz will make your dual head work, havn't you?

what issue do you run into now?
Comment 59 Lew Shih Ming 2009-03-11 18:56:23 UTC
In comment #53, I said that I have unsuccessfull attempts of using the previous xorg.conf file which was working previously. Which means I still have problem making my 2nd monitor to display even thought xrandr is reflecting VGA-1 instead of TV-1. And I had attached my xorg.conf and log file for someone to review it. I am waiting for further comments. Sorry for the misinterpretation.
Comment 60 Michael Fu 2009-03-11 19:08:54 UTC
(In reply to comment #59)
> In comment #53, I said that I have unsuccessfull attempts of using the previous
> xorg.conf file which was working previously. Which means I still have problem
> making my 2nd monitor to display even thought xrandr is reflecting VGA-1
> instead of TV-1. And I had attached my xorg.conf and log file for someone to
> review it. I am waiting for further comments. Sorry for the misinterpretation.
> 

what did you see on the 2nd VGA monitor ( I assume it's the one connected to SDVO VGA )? Blank screen?
Comment 61 Lew Shih Ming 2009-03-11 20:20:23 UTC
Yes. You are correct. It's using SDVO. Only primary monitor is able to display while the secondary is blank.
Comment 62 Wang Zhenyu 2009-03-11 20:23:03 UTC
If so, there should be another bug for SDVO VGA issue, don't pollute this closed bug track.

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.