Bug 13722 - [830M] xrandr --output LVDS --left-of VGA disables LVDS
Summary: [830M] xrandr --output LVDS --left-of VGA disables LVDS
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: 7.3 (2007.09)
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Hong Liu
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
: 11148 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-12-18 07:40 UTC by Ben. E. Hard
Modified: 2008-02-22 12:21 UTC (History)
5 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Xorg.0.log with intel module from git (2.2-branch) and xserver-xorg from debian unstable (7.3+10), debug-mode (499.43 KB, text/x-log)
2008-01-22 05:49 UTC, Ben. E. Hard
no flags Details
fix i830M dvo (636 bytes, patch)
2008-01-24 20:02 UTC, Hong Liu
no flags Details | Splinter Review
Xorg.0.log after applying Hongs patch (778.81 KB, text/plain)
2008-01-28 05:14 UTC, Ben. E. Hard
no flags Details
i830 dvo fix 2nd (539 bytes, patch)
2008-01-28 22:12 UTC, Hong Liu
no flags Details | Splinter Review
Intel_reg_dumper-output after xrandr --output LVDS --left-of VGA (7.95 KB, text/plain)
2008-01-29 03:51 UTC, Ben. E. Hard
no flags Details
xrandr -q --verbose before and after enabling LVDS with xrandr --output LVDS --auto (8.57 KB, text/plain)
2008-01-29 03:55 UTC, Ben. E. Hard
no flags Details
Xorg.0.log after --left-of just after startup (164.04 KB, text/x-log)
2008-01-30 01:40 UTC, Ben. E. Hard
no flags Details
intel_reg_dumper output after --left-of after startup (7.94 KB, text/plain)
2008-01-30 01:44 UTC, Ben. E. Hard
no flags Details
correct dvo register for ivch module (395 bytes, patch)
2008-01-30 21:38 UTC, Hong Liu
no flags Details | Splinter Review
add ivch-dvob quirk (2.50 KB, patch)
2008-02-13 22:34 UTC, Hong Liu
no flags Details | Splinter Review

Description Ben. E. Hard 2007-12-18 07:40:43 UTC
executing xrandr --output LVDS --left-of VGA disables the LVDS if VGA is connected. 

I can check with i810switch that LVDS is being deactivated through that command. Reactivation of LVDS works only through i810switch, xrandr --output --LVDS --auto doesn't work.

Interesting enough, KDE and xfce4 think that there is a second monitor left-of the VGA, which makes them put all the applications to the black internal display of my monitor. 


My system:
sony vaio PCG-r600HFP with I830M.

debian lenny with xserver-xorg-video-intel 2.1.0-2 (also tried with xserver-xorg-video-intel 
2.2.0-1 from debian unstable). 

xrandr -q output: 
Screen 0: minimum 320 x 200, current 2048 x 768, maximum 2048 x 768
VGA connected 1024x768+1024+0 (normal left inverted right x axis y axis) 0mm x 
0mm
   1280x768       60.0
   1024x768       60.0*
   800x600        60.3
   640x480        59.9
LVDS connected 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 
0mm
   1024x768       60.0*+
   1280x768       60.0
   800x600        60.3
   640x480        59.9



Part of xorg.conf

  Driver "intel"
  Option "monitor-VGA" "externer"
  Option "monitor-LVDS" "interner"
        Option "NoDDC"
        Option "DDCmode" "off"
        Option "IgnoreEDID" "on"
  Option      "XAANoOffscreenPixmaps" "true"
  Option      "DRI"     "true"
EndSection

Section "Monitor"
  Identifier "interner"
 Option "PreferredMode" "1024x768"
  DisplaySize 270 203
EndSection

Section "Monitor"
  Identifier "externer"
        Option "RightOf" "interner"
EndSection


Section "Screen"
  Identifier "Default Screen"
  Device "intel"
  Monitor "interner"
  Monitor "externer"
  DefaultDepth 16
  SubSection "Display"
    Virtual 2048 768
    Depth 16
  EndSubSection
  SubSection "Display"
    Depth 24
    Virtual 2048 768
  EndSubSection
EndSection

Section "ServerLayout"
  Identifier "Default Layout"
  Screen "Default Screen"
  InputDevice "Generic Keyboard"
  InputDevice "Configured Mouse" "AlwaysCore"
  InputDevice "ALPS" "CorePointer"
  InputDevice "Vaio keys" "SendCoreEvents"
  Option      "AIGLX" "true"
EndSection

Section "Extensions"
        Option  "Composite" "Enable"
EndSection


Section "DRI"
        Group "video"
        Mode 0660
EndSection

find Xorg.0.log at http://paste.debian.net/45136 

Any other information I can provide?
Comment 1 Ben. E. Hard 2008-01-22 05:49:14 UTC
Created attachment 13856 [details]
Xorg.0.log with intel module from git (2.2-branch) and xserver-xorg from debian unstable (7.3+10), debug-mode
Comment 2 Ben. E. Hard 2008-01-22 05:51:00 UTC
Also tried with xf86-video-intel from git - same problem, see attached Xorg.0.log
Comment 3 Gordon Jin 2008-01-23 01:03:07 UTC
Hong/Zhenyu, any idea?
Comment 4 Hong Liu 2008-01-24 00:36:00 UTC
I've seen you have configured the LVDS to be left-of VGA in xorg.conf, is it OK when X startup? and it only happens you execute the command?

Could you elabrate on what steps you have done to trigger this bug?

Thanks,
Hong
Comment 5 Ben. E. Hard 2008-01-24 01:15:45 UTC
Hi Hong, 

no, it doesn't work even at startup - only the external monitor is working (of course LVDS works if the external monitor is not connected). I didn't do a lot to trigger the bug: I upgraded from i810 to intel in xorg.conf and changed xorg.conf to what I posted above (I also tried to delete xorg.conf). The options --left-of and --right-of (in xorg.conf or with xrandr) make kde think the desktop is bigger (applications and the mouse disappear to the (black) LVDS) but LVDS doesn't show a picture. What I can sometimes realise when executing xrandr --output LVDS --left-of VGA, is that LVDS changes a little bit the light, the black gets a little bit lighter. That made me already think that there is some screensaver-function or powersafe on the LVDS. But then I realised, that i810switch shows me, that lcd is off! I can turn it on with "i810switch lcd on", but that gives me only a clone of VGA and it will be again "off" when I execute afterwords xrandr --output LVDS --left-of VGA again. 

I tried with different kernels (debian lenny standard kernel and my own 2.6.22 kernel), I tried with the xserver-xorg-etc.-packages from debian unstable, experimental and from git, no change. 

Probably the output of 
xrandr -q --verbose (after startup with the posted xorg.conf, no other xrandr or i810switch commands executed)
might be interesting for you:

Screen 0: minimum 320 x 200, current 1024 x 768, maximum 2048 x 768
VGA connected 1024x768+0+0 (0x4e) normal (normal left inverted right) 304mm x 228mm
        Identifier: 0x4c
        Timestamp:  -1510538410
        Subpixel:   unknown
        Clones:
        CRTC:       0
        CRTCs:      0
        EDID_DATA:
                00ffffffffffff0026cd483811050000
                1c0c01036c1f1778ea0430a2564b9d25
                105054afce0001010101010101010101
                01010101010164190040410026301888
                360030e410000018d50980a0205e6310
                1060520830e41000001a000000fd0038
                4b1f3c08000a202020202020000000fc
                004158333831385554432020202000f4
  1024x768 (0x4e)   65.0MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock   48.4KHz
        v: height  768 start  771 end  777 total  806           clock   60.0Hz
  1024x768 (0x4f)   78.8MHz +HSync +VSync
        h: width  1024 start 1040 end 1136 total 1312 skew    0 clock   60.1KHz
        v: height  768 start  769 end  772 total  800           clock   75.1Hz
  1024x768 (0x50)   75.0MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1328 skew    0 clock   56.5KHz
        v: height  768 start  771 end  777 total  806           clock   70.1Hz
  1024x768 (0x4e)   65.0MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock   48.4KHz
        v: height  768 start  771 end  777 total  806           clock   60.0Hz
  800x600 (0x51)   50.0MHz +HSync +VSync
        h: width   800 start  856 end  976 total 1040 skew    0 clock   48.1KHz
        v: height  600 start  637 end  643 total  666           clock   72.2Hz
  800x600 (0x52)   49.5MHz +HSync +VSync
        h: width   800 start  816 end  896 total 1056 skew    0 clock   46.9KHz
        v: height  600 start  601 end  604 total  625           clock   75.0Hz
  800x600 (0x53)   40.0MHz +HSync +VSync
        h: width   800 start  840 end  968 total 1056 skew    0 clock   37.9KHz
        v: height  600 start  601 end  605 total  628           clock   60.3Hz
  800x600 (0x54)   36.0MHz +HSync +VSync
        h: width   800 start  824 end  896 total 1024 skew    0 clock   35.2KHz
        v: height  600 start  601 end  603 total  625           clock   56.2Hz
  640x480 (0x55)   31.5MHz -HSync -VSync
        h: width   640 start  656 end  720 total  840 skew    0 clock   37.5KHz
        v: height  480 start  481 end  484 total  500           clock   75.0Hz
  640x480 (0x56)   31.5MHz -HSync -VSync
        h: width   640 start  664 end  704 total  832 skew    0 clock   37.9KHz
        v: height  480 start  489 end  491 total  520           clock   72.8Hz
  640x480 (0x57)   25.2MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock   31.5KHz
        v: height  480 start  490 end  492 total  525           clock   60.0Hz
  720x400 (0x58)   28.3MHz -HSync +VSync
        h: width   720 start  738 end  846 total  900 skew    0 clock   31.5KHz
        v: height  400 start  412 end  414 total  449           clock   70.1Hz
  640x350 (0x59)   25.2MHz -HSync +VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock   31.5KHz
        v: height  350 start  387 end  389 total  449           clock   70.1Hz
LVDS connected 1024x768+0+0 (0x4e) normal (normal left inverted right) 0mm x 0mm
        Identifier: 0x4d
        Timestamp:  -1510538410
        Subpixel:   horizontal rgb
        Clones:
        CRTC:       1
        CRTCs:      0 1
  1024x768 (0x4e)   65.0MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock   48.4KHz
        v: height  768 start  771 end  777 total  806           clock   60.0Hz
  1280x768 (0x5a)   80.1MHz
        h: width  1280 start 1344 end 1480 total 1680 skew    0 clock   47.7KHz
        v: height  768 start  769 end  772 total  795           clock   60.0Hz
  800x600 (0x53)   40.0MHz +HSync +VSync
        h: width   800 start  840 end  968 total 1056 skew    0 clock   37.9KHz
        v: height  600 start  601 end  605 total  628           clock   60.3Hz
  640x480 (0x5b)   25.2MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock   31.5KHz
        v: height  480 start  490 end  492 total  525           clock   59.9Hz



This output is still the same after "i810switch lcd on" as well as after  "xrandr --output LVDS --left-of VGA"

All that made me think that i810switch must be deactivating something else then xrandr can do... But I'm no expert and now all I can do is executing commands you tell me and providing you with more info...

Cheers,
Ben
Comment 6 Hong Liu 2008-01-24 20:02:29 UTC
Created attachment 13916 [details] [review]
fix i830M dvo

Please try the attached patch.

Thanks,
Hong
Comment 7 Ben. E. Hard 2008-01-28 04:56:04 UTC
Hi Hong, I tried the patch. Now I get a clone of VGA on LVDS (with the unchanged xorg.conf), but no left-of. Executing xrandr --output LVDS --left-of VGA again disables LVDS, only that I can reenable it with xrandr --output LVDS --auto, which didn't work before. See attached Xorg.0.log.

Greetings,

Ben
Comment 8 Ben. E. Hard 2008-01-28 05:14:42 UTC
Created attachment 13984 [details]
Xorg.0.log after applying Hongs patch
Comment 9 Hong Liu 2008-01-28 21:27:45 UTC
(In reply to comment #7)
> Hi Hong, I tried the patch. Now I get a clone of VGA on LVDS (with the
> unchanged xorg.conf), but no left-of. Executing xrandr --output LVDS --left-of
> VGA again disables LVDS, only that I can reenable it with xrandr --output LVDS
> --auto, which didn't work before. See attached Xorg.0.log.

Does the rightof option in Xorg get correct at X server startup?

And after you enable LVDS with xrandr, LVDS+CRT display correctly (i.e a 2048x768 screen)?

Thanks,
Hong
Comment 10 Hong Liu 2008-01-28 21:34:56 UTC
Could you please attach the register dump log after you executing xrandr --output LVDS --left-of VGA? There is a tool in our driver package (xf86-video-intel/src/reg_dumper/intel_reg_dump).

Thanks,
Hong
Comment 11 Hong Liu 2008-01-28 22:12:58 UTC
Created attachment 13997 [details] [review]
i830 dvo fix 2nd

Please try this patch.
And if there still has problem, please provide log I asked in comment #9 and #10.

Thanks,
Hong
Comment 12 Ben. E. Hard 2008-01-29 03:31:42 UTC
Hi, 

First to your questions about the first patch: KDE startet with a clone on LVDS and CRT, not taking care of the "right-of" option in xorg.conf. Resolution was correctly 1024x768 on both screens (not 2048, which I declared only for the virtual screen). 

I applied the second patch (on a clean git clone without the other patch). Again, kde starts with a clone on VGA and LVDS (with a correct resolution of 1024x768), even if the "right-of" option ist activated in xorg.conf. 

xrandr --output LVDS --left-of VGA changes the virtual screen but not the visible: LVDS and VGA keep showing the same image, but cursor can be moved to the invisible screen. Same for xrandr --output LVDS --right-of VGA.

After that I executed xrandr --output LVDS --off, which switches LVDS of and virtual screen is only the size of one screen again. (i810switch still reports LVDS to be "on", which might be the correct behaviour?). I can switch LVDS on and off now with --off and --auto, but --left-of and --right-of doesn't change anything if LVDS was turned of with xrandr --output LVDS --off.

So far, I can't compile the reg_dumper utility. It fails with the folling messages:

/home/bve/bin/xf86-video-intel/src/reg_dumper/main.c:45: undefined reference to `pci_system_init'
/home/bve/bin/xf86-video-intel/src/reg_dumper/main.c:52: undefined reference to `pci_device_find_by_slot'
/home/bve/bin/xf86-video-intel/src/reg_dumper/main.c:56: undefined reference to `pci_device_probe'
/home/bve/bin/xf86-video-intel/src/reg_dumper/main.c:72: undefined reference to `pci_device_map_range'
collect2: ld returned 1 exit status
make: *** [intel_reg_dumper] Fehler 1

Greetings, 
Ben
Comment 13 Ben. E. Hard 2008-01-29 03:51:06 UTC
Created attachment 14009 [details]
Intel_reg_dumper-output after xrandr --output LVDS --left-of VGA

Ok, I compiled it (didn't realize, that it compiles automatically if libpciaccess is available). 

Output attached!
Comment 14 Ben. E. Hard 2008-01-29 03:55:00 UTC
Created attachment 14010 [details]
xrandr -q --verbose before and after enabling LVDS with xrandr --output LVDS --auto
Comment 15 Hong Liu 2008-01-29 17:38:35 UTC
(In reply to comment #12)
> After that I executed xrandr --output LVDS --off, which switches LVDS of and
> virtual screen is only the size of one screen again. (i810switch still reports
> LVDS to be "on", which might be the correct behaviour?). 

i810switch has bug when reporting this info, it doesn't read the correct register.

> I can switch LVDS on
> and off now with --off and --auto, but --left-of and --right-of doesn't change
> anything if LVDS was turned of with xrandr --output LVDS --off.

It's expected behavior, commands only be effective when output is on.
Comment 16 Hong Liu 2008-01-29 17:42:55 UTC
(In reply to comment #13)
> Created an attachment (id=14009) [details]
> Intel_reg_dumper-output after xrandr --output LVDS --left-of VGA
> 
> Ok, I compiled it (didn't realize, that it compiles automatically if
> libpciaccess is available). 
> 
> Output attached! 
> 

It seems you have turned off the LVDS output before executing left-of command.
Would you please execute the left-of command just after X startup (no other commands in between) and attach the log?

Thanks,
Hong
Comment 17 Ben. E. Hard 2008-01-30 01:40:56 UTC
Created attachment 14032 [details]
Xorg.0.log after --left-of just after startup
Comment 18 Ben. E. Hard 2008-01-30 01:44:04 UTC
Created attachment 14033 [details]
intel_reg_dumper output after --left-of after startup

Hi, as you suggested, I executed xrandr --output LVDS --left-of VGA just after startup. The result is that the virtual screens for KDE seems to know a second screen on the left (the mouse can go there), but both screens show a clone of the right part of the virtual screen.
Comment 19 Ben. E. Hard 2008-01-30 03:56:09 UTC
Something else I now realized, which could be related: xrandr --output LVDS --off dectivates correctly LVDS, while xrandr --output VGA --off deactivates both the external and the internal screen.
Comment 20 Hong Liu 2008-01-30 21:38:17 UTC
Created attachment 14046 [details] [review]
correct dvo register for ivch module

Please try to see if dual head screen is OK.
Comment 21 Hong Liu 2008-01-30 21:49:52 UTC
(In reply to comment #20)
> Created an attachment (id=14046) [details]
> correct dvo register for ivch module
> 
> Please try to see if dual head screen is OK.
> 

You still need the i830-dvo-fix-2nd patch in comment #11.

Also please retest with the two patches if turning off VGA will turn off LVDS too.

Thanks,
Hong
Comment 22 Ben. E. Hard 2008-01-31 02:30:40 UTC
Hi Hong, 

it seems to work correctly now! Thanks a lot for your fast and great work. 

I have a dual screen now, can switch each output on and off, left-of works with the start of X, I can change everything with xrandr. Also, xrandr -q now shows no more 1280x768 as supported resolution for LVDS, which cannot work on that display. 

Greetings,
Ben
Comment 23 Julien Cristau 2008-01-31 10:45:00 UTC
The fix is not in git afaics, so reopening.
Comment 24 Hong Liu 2008-01-31 18:55:25 UTC
(In reply to comment #22)
> Hi Hong, 
> 
> it seems to work correctly now! Thanks a lot for your fast and great work. 
> 
> I have a dual screen now, can switch each output on and off, left-of works with
> the start of X, I can change everything with xrandr. Also, xrandr -q now shows
> no more 1280x768 as supported resolution for LVDS, which cannot work on that
> display. 
> 
> Greetings,
> Ben
> 

You are welcome :)

One more thing, would you please only try the correct-dvo-register-for-ivch-module patch to see if everything is OK (without the i830-dvo-fix-2nd patch in comment #11)?

Thanks,
Hong


Comment 25 Hong Liu 2008-02-04 17:09:38 UTC
*** Bug 11148 has been marked as a duplicate of this bug. ***
Comment 26 Hong Liu 2008-02-04 17:10:34 UTC
From Ben:

Works well with only the last patch. If I add both patches, I get a strange 
behaviour on the VGA, where the drop-down menus are broken if (see 
screenshot). With only the last patch, I can see no problems so far. I can 
run xrandr, switch on and off  VGA or LVDS, position left-of and rigth-of. 

So the i830-dvo-fix-2nd patch is not needed.
Comment 27 Hong Liu 2008-02-13 22:34:14 UTC
Created attachment 14304 [details] [review]
add ivch-dvob quirk

Hi, Ben and Gerrit

According to Keith, there are other machines use DVOA register. So we can't just change the dvo_reg to DVOB for ivch module. I've added a quirk for your two laptops, please try this patch (the patch is against latest git version).

Thanks,
Hong
Comment 28 gerrit 2008-02-14 04:49:47 UTC
(In reply to comment #27)
> Created an attachment (id=14304) [details]
> add ivch-dvob quirk
> 
> Hi, Ben and Gerrit
> 
> According to Keith, there are other machines use DVOA register. So we can't
> just change the dvo_reg to DVOB for ivch module. I've added a quirk for your
> two laptops, please try this patch (the patch is against latest git version).
> 
> Thanks,
> Hong
> 

Works on my laptop...

Gerrit
Comment 29 Ben. E. Hard 2008-02-16 04:39:20 UTC
works on my laptop as well. 
Ben
Comment 30 Kristian Høgsberg 2008-02-22 12:06:51 UTC
(In reply to comment #27)
> Created an attachment (id=14304) [details]
> add ivch-dvob quirk
> 
> Hi, Ben and Gerrit
> 
> According to Keith, there are other machines use DVOA register. So we can't
> just change the dvo_reg to DVOB for ivch module. I've added a quirk for your
> two laptops, please try this patch (the patch is against latest git version).
> 
> Thanks,
> Hong
> 

And it fixes my i830 x30 thinkpad here too, that the fix earlier in this bug broke.
Comment 31 Jesse Barnes 2008-02-22 12:21:05 UTC
Ok, I'm closing this one out then.  Fix is in commit 975d7833bc844485c7043538336bddcba7f7f90e.

We can keep 14570 open a bit longer since Hong might find a better way of doing this (sounds like external displays are still broken somehow anyway).


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.