Bug 39099 - two graphic cards and four monitors with Nouveau
two graphic cards and four monitors with Nouveau
Status: RESOLVED FIXED
Product: xorg
Classification: Unclassified
Component: Driver/nouveau
unspecified
x86-64 (AMD64) Linux (All)
: medium normal
Assigned To: Nouveau Project
Xorg Project Team
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-09 13:06 UTC by Damian Nowak
Modified: 2011-07-19 11:38 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
debug output (2.19 KB, patch)
2011-07-11 12:45 UTC, Emil Velikov
no flags Details | Splinter Review
Final patch (1.13 KB, patch)
2011-07-18 16:05 UTC, Emil Velikov
no flags Details | Splinter Review
Fix yet another silly typo (1.27 KB, patch)
2011-07-18 16:32 UTC, Emil Velikov
no flags Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Damian Nowak 2011-07-09 13:06:56 UTC
This bug is related to: https://bugs.freedesktop.org/show_bug.cgi?id=38759
I was trying to get a 2-cards-3-monitors set-up working. I finally did it after updating to bleeding edge X and using ZaphodHeads option.

3 monitors xorg.conf: http://wklej.org/id/555276/txt/  (working)
4 monitors xorg.conf: http://wklej.org/id/559775/txt/  (failing)
The only difference between those two configs is making use of 4th monitor.

3 monitors Xorg.0.log: http://wklej.org/id/559778/txt/ (working)
4 monitors Xorg.0.log: http://wklej.org/id/559777/txt/ (failing)

Error message: Screen(s) found, but none have a usable configuration.
After `service gdm restart` main screen blinks 5 times and goes back to console.

Ubuntu 11.04 - Linux ubuntu 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
(this didn't work on Ubuntu 10.10 either)

Packages version:
libdrm-nouveau1a 2.4.26+git20110604.6dd804c5-0ubuntu0sarvatt~natty
xserver-xorg-video-nouveau 1:0.0.16+git20110623.ab89aa02-0ubuntu0sarvatt~natty
(from https://launchpad.net/~xorg-edgers/+archive/ppa)
Comment 1 Damian Nowak 2011-07-09 15:31:33 UTC
Some need insights, thanks to pq from #nouveau irc channel.

4 monitors work when using a 3-monitors setup - the third and fourth monitor display the same picture (clone). What's interesting - this shouldn't happen as ZaphodHeads is set. Maybe it's a bug that makes ZaphodHeads work on the first graphic card only?

Here's xrandr output for each screen. http://wklej.org/id/559818/txt/
(I had to disable Xinerama for a while to get the xrandr output)

3-monitors xorg.conf: http://wklej.org/id/555276/txt/
Comment 2 Damian Nowak 2011-07-09 15:33:12 UTC
s/need insights/new insights/
Comment 3 Damian Nowak 2011-07-09 16:49:37 UTC
I tried combining ZaphotHeads on the first card and use one virtual-sized Screen on the second card. http://wklej.org/id/559842/

As long as I have Xinerama off, it works. I get 3 independent X screens on four monitors.

However, when I enable Xinerama, the strange behaviour from my first bug report appears. The video is there. https://bugs.freedesktop.org/show_bug.cgi?id=38759


So there are two alternative ways of resolving the issue:

- fix ZaphodHeads work on two cards, four monitors
- fix the strange behaviour from the video when using virtual screens
- ...or tell me what I did wrong in xorg.conf so I get the error message:
  Screen(s) found, but none have a usable configuration.
  It's the preferred way. :)
Comment 4 Emil Velikov 2011-07-11 12:45:30 UTC
Created attachment 48986 [details] [review]
debug output

Can you please try the patch on a 3 and 4 monitor setup and attach the Xorg.log

My best guess is that the total number of monitors is limited to the number of connectors on the primary card
Comment 5 Damian Nowak 2011-07-18 12:46:33 UTC
I git pulled the drivers and applied your patch. Apparently it works - although your patch prints debug info only, you say.

21:03 < Nowaker> xexaxo: your patch made those four monitors working :)
21:04 < Nowaker> xexaxo: sorry for testing it out so late but I played OpenTTD with my friends for three days in a row, and then got some work to do
21:10 < xexaxo> Nowaker: the patch or the configuration ?
21:10 < xexaxo> the patch only added some debug output
21:11 < Nowaker> xexaxo: the patch
21:11 < Nowaker> xexaxo: so someone fixed the issue in meantime on git
21:12 < Nowaker> I'm just uploading the logs
21:12 < xexaxo> Nowaker: can  you make sure that it's the patch, and try attaching the Xorg.log with/wo the patch (3 and 4 monitors please)

http://wklej.org/id/563568/txt/ - git+patch - 3-setup (working)
http://wklej.org/id/563558/txt/ - git+patch - 4-setup (working)

After `git reset --hard`

http://wklej.org/id/563575/txt/ - git - 3-setup (working)
http://wklej.org/id/563572/txt/ - git - 4-setup (failing the same way)

Looks like you really fixed it:

+		if (!IsShared || ScreenEq ) // <- this!
 			drmmode_crtc_init(pScrn, drmmode, i);

I made sure it's you who fixed the problem - twice. ;)
Comment 6 Emil Velikov 2011-07-18 16:05:38 UTC
Created attachment 49279 [details] [review]
Final patch

I was not able to oversee the issue while creating the initial patch
The issue lies within a missing (or actually 3) brackets, causing incorrect argument to the function xf86IsEntityShared()

It must be 
* xf86IsEntityShared(pScrn->entityList[0])
while currently it is
* xf86IsEntityShared(pScrn->entityList[0] || pScrn->confScreen->device->screen == i)

Please test
Emil
Comment 7 Emil Velikov 2011-07-18 16:32:15 UTC
Created attachment 49281 [details] [review]
Fix yet another silly typo

I've added a bit too many brackets
It should be finally resolved
Comment 8 Emil Velikov 2011-07-19 10:36:59 UTC
Latest patch resolves the issue and has been upstreamed
Comment 9 Damian Nowak 2011-07-19 11:38:02 UTC
Yep, working!

OpenTTD on four screens: http://upload.nowaker.net/nwkr/4-monitory.jpg
However, this is a fake photo. The game is not playable - looks like ~~20 fps. ;)

Thanks for fixing the issue.