Bug 19620 - At first start of X, secondary display doesn't come up properly.
Summary: At first start of X, secondary display doesn't come up properly.
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/nouveau (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Nouveau Project
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-16 13:33 UTC by Mjules
Modified: 2009-01-20 17:46 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Config (2.35 KB, text/plain)
2009-01-16 13:33 UTC, Mjules
no flags Details
Xorg log at first start when second display doesn't come up properly (37.49 KB, text/plain)
2009-01-16 13:38 UTC, Mjules
no flags Details
Xorg log at second start when everything is ok (37.38 KB, text/plain)
2009-01-16 13:38 UTC, Mjules
no flags Details
Xorg log with a VT switch, before, problem, after, fine (39.55 KB, application/octet-stream)
2009-01-16 13:40 UTC, Mjules
no flags Details
Dump of register before switch to VT (with problem) (8.77 KB, text/plain)
2009-01-19 10:22 UTC, Mjules
no flags Details
Dump of reg after the switch (everything works fine) (8.77 KB, text/plain)
2009-01-19 10:23 UTC, Mjules
no flags Details
debug patch (1008 bytes, patch)
2009-01-19 11:39 UTC, Stuart Bennett
no flags Details | Splinter Review
Xorg Log with debug patch applied and VT switch (41.73 KB, text/plain)
2009-01-19 12:24 UTC, Mjules
no flags Details
test patch (579 bytes, patch)
2009-01-19 13:12 UTC, Stuart Bennett
no flags Details | Splinter Review
(hopefully) final patch (3.01 KB, patch)
2009-01-19 15:47 UTC, Stuart Bennett
no flags Details | Splinter Review

Description Mjules 2009-01-16 13:33:49 UTC
Created attachment 22036 [details]
Config

Problem :

first start of X : primary screen work fine, secondary screen stay blue (mandriva make root X window blue instead of grey by default). 
The screen seems to be properly configured (1024x768@85) and I can drag something on this screen (but obviously I don't see it anymore)
If I try this in clone mode, the second screen is blue, the first display properly.

Second start of X or after a switch to VT and come back, the second screen is perfectly fine, and I can use it



Configuration :

xserver : 1.4.0.90 from mandriva 2008.1

Card (NV4B, 10de:02e1) on AGP bus :
01:00.0 VGA compatible controller: nVidia Corporation G73 [GeForce 7600 GS] (rev a2)

Primary screen on DVI (with DVI to VGA adaptor) : IIYAMA A705MT (Vision master pro 411) 

Secondary screen on VGA : IIYAMA S704HT (Vision master 404), this screen alone had worked fine with nouveau on VGA since 18 months.

xrandr -q :
Screen 0: minimum 320 x 200, current 2048 x 768, maximum 3000 x 1024
DVI-I-0 connected 1024x768+1024+0 (normal left inverted right x axis y axis) 320mm x 240mm
   1024x768_85.00   84.9*+
   1352x1014      59.9  
   1280x1024      75.0  
   1152x864       75.0  
   1024x768_100.00  100.0  
   1024x768       75.1     70.1     60.0  
   832x665        97.7  
   832x624        74.6  
   800x600_85.00   84.9  
   800x600        72.2     75.0     60.3     56.2  
   640x480_85.00   84.6  
   640x480        75.0     72.8     66.7     69.6     60.0     59.9  
   512x384       120.0  
   400x300       120.6  
   320x240       120.1  
VGA-0 connected 1024x768+0+0 (normal left inverted right x axis y axis) 320mm x 240mm
   1024x768_85.00   84.9*+
   1280x1024      75.0  
   1152x864       75.0  
   1024x768       74.9     75.1     70.1     60.0  
   832x624        74.6     74.8  
   800x600_85.00   84.9  
   800x600        72.2     75.0     60.3     56.2  
   640x480_85.00   84.6  
   640x480        75.0     72.8     66.7     69.6     60.0     59.9  
   512x384       120.0  
   400x300       120.6  
   320x240       120.1
Comment 1 Mjules 2009-01-16 13:38:01 UTC
Created attachment 22038 [details]
Xorg log at first start when second display doesn't come up properly
Comment 2 Mjules 2009-01-16 13:38:53 UTC
Created attachment 22039 [details]
Xorg log at second start when everything is ok
Comment 3 Mjules 2009-01-16 13:40:24 UTC
Created attachment 22040 [details]
Xorg log with a VT switch, before, problem, after, fine
Comment 4 Mjules 2009-01-17 07:24:12 UTC
I've made a small movie (~1 min ; 8MB) in order to better explain the problem :
http://mjules.free.fr/nouveau/bug.avi

storyline : 
fresh boot in runlevel 3 (before the beginning of the movie)
2" : startx
30" : KDE is loaded, the screen on DVI (with adaptor) show KDE, the screen on VGA show nothing but a blue color
37" : I made a switch to VT
45" : I come back from VT to X, the two screen display KDE in clone mode as expected initially.

thx
Comment 5 Stuart Bennett 2009-01-19 09:59:05 UTC
Thanks, for the video, that explains it really well.

1) it would seem you are using an FB for the console.  Certainly this can cause problems if it's nvidiafb.  Even if it's vesafb it may be worth trying a boot with "vga=0" added to the end of your kernel parameters to force a text-mode only boot.

2) assuming this doesn't fix it, please make register dumps while in X, both before (broken) and after (working) the switch to and from VT.

Use my version of radeontool to make these.  It can be acquired by:

git clone git://anongit.freedesktop.org/~stuart/radeontool
cd radeontool; make

then dumps made by

./radeontool regs > logfile
Comment 6 Mjules 2009-01-19 10:21:33 UTC
Hi,

thx for your answer

disabling vesafb doesn't fix the problem but it becomes different : 
now the secondary screen doesn't come up at all at first start. It is powered but stays black as if it doesn't receive a signal. 

As previously switch to VT and come back fix the display.

Dumps attached
Comment 7 Mjules 2009-01-19 10:22:29 UTC
Created attachment 22099 [details]
Dump of register before switch to VT (with problem)
Comment 8 Mjules 2009-01-19 10:23:10 UTC
Created attachment 22100 [details]
Dump of reg after the switch (everything works fine)
Comment 9 Stuart Bennett 2009-01-19 11:01:47 UTC
Try running these register writes, all together in a script and see if it fixes anything (in the same mode you made the dumps - I assume vesafb enabled?)

./radeontool regset C1:00 0xa7
./radeontool regset C1:01 0x7f
./radeontool regset C1:02 0x7f
./radeontool regset C1:03 0x8b
./radeontool regset C1:04 0x88
./radeontool regset C1:05 0x95
./radeontool regset C1:06 0x27
./radeontool regset C1:07 0xf5

If that doesn't produce anything, it might be interesting to see the reg dumps for the vesafb disabled case.
Comment 10 Mjules 2009-01-19 11:19:14 UTC
Dumps were made with vga=0 (but vesafb has been compiled inside the kernel by my distro)

Writing the registers seems to solve the problem :) the screen display fine after that.

thx
Comment 11 Stuart Bennett 2009-01-19 11:39:34 UTC
Created attachment 22101 [details] [review]
debug patch

Hm, weird :)  Please apply this patch and attach an Xorg log showing: starting (broken)->switch to vt->switch to X (working)
Comment 12 Mjules 2009-01-19 12:24:13 UTC
Created attachment 22102 [details]
Xorg Log with debug patch applied and VT switch
Comment 13 Mjules 2009-01-19 12:25:05 UTC
Log attached

Could the weirdness you see come from grub ? my distro is using a "graphic" grub.
Comment 14 Stuart Bennett 2009-01-19 13:12:56 UTC
Created attachment 22104 [details] [review]
test patch

please test if this fixes things
Comment 15 Mjules 2009-01-19 13:43:18 UTC
It works with your test patch applied :)

thx
Comment 16 Stuart Bennett 2009-01-19 15:47:40 UTC
Created attachment 22108 [details] [review]
(hopefully) final patch

Ok, this is what I intend to push, provided it works :)  Can you verify it still fixes it for you (and doesn't break anything else)?
Comment 17 Mjules 2009-01-20 13:00:04 UTC
Your last patch fixes the bug :), it doesn't seems to cause other problems :)

thanks a lot.


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.