Bug 56347

Summary: NVPlatformProbe routine does not mark the entity as Shared for ZaphodHeads.
Product: xorg Reporter: Vladimir Chebotarev <exc>
Component: Driver/nouveauAssignee: Nouveau Project <nouveau>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: exc, rodrigorivascosta
Version: git   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Four stage patch adding the relevant functions to NVPlatformProbe none

Description Vladimir Chebotarev 2012-10-24 09:11:31 UTC
NVPlatformProbe routine does not mark the entity as Shared for ZaphodHeads.
It is used by xorg since version 1.13 so there is no possibility to use ZaphodHeads.

This config:
 75 Section "Device"
 76     Identifier  "CardA1"
 77     Screen    0 
 78         Option     "ZaphodHeads"  "DVI-I-1"
 79     Option  "Monitor-DVI-I-1" "Monitor0"
 80         Option     "NoAccel"    "off"           # [<bool>]                                                                  
 81     Driver      "nouveau"
 82     BusID       "PCI:1:0:0"
 83 EndSection
 84 
 85 Section "Device"
 86     Identifier  "CardA2"
 87         Option     "ZaphodHeads"  "VGA-1"
 88     Screen     1
 89     Option  "Monitor-VGA-1" "Monitor1"
 90         Option     "NoAccel"    "off"           # [<bool>]
 91     Driver      "nouveau"
 92     BusID       "PCI:1:0:0"
 93 EndSection
causes xorg to print "Requested Entity already in use!" and use PCI:1:0:0 as single-head adapter.

Thanks.
Comment 1 Damian Nowak 2012-11-01 03:08:16 UTC
Confirming the bug.

02:59 < Nowaker> after distro upgrade I am no longer able to use my 2 gpus, 3 monitors. looks like zaphodheads doesn't work as expected. Screen0 on GPU0 is OK, Screen1 on GPU0 fails, Screen2 on GPU1 is OK. fail message: Screen 1 deleted because of no matching config section. xorg.conf: http://wklej.org/id/555276/txt/ This is the bug that was fixed a year ago for me. https://bugs.freedesktop.org/show_bug.cgi?id=39099
03:00 < Nowaker> instead of getting two screens of GPU0 with zaphodheads, I get one (output DVI-I-1) and a clone (output DVI-I-2)
03:01 < Nowaker> something must have been broken along the way, I will check the version of nouveau I was using in my previous distro
03:27 < Nowaker> definitely ZaphodHeads broken in current nouveau
03:28 < Nowaker> [  5849.183] Requested Entity already in use!
03:28 < Nowaker> this is not supposed to happen when ZaphodHeads is defined
03:31 < Nowaker> confirmed, http://www.spinics.net/lists/xorg/msg54660.html
Comment 2 Damian Nowak 2012-11-01 03:30:43 UTC
I tried calling xf86SetEntityShared(0) in nv_driver.c before xf86AllocateScreen and xf86AddEntityToScreen are called. Unfortunately, it isn't enough.

It would be great if any hacker could take a look at it. ZaphodHeads is the only way of dealing with multiple GPUs and monitors on Nouveau.
Comment 3 Emil Velikov 2012-11-01 14:49:07 UTC
Guys can you try the patch series as posted in here

http://lists.freedesktop.org/archives/nouveau/2012-November/011347.html

Only the last patch is needed in this case, although I have added a few more checks to be on the safe side
Comment 4 Damian Nowak 2012-11-01 21:12:32 UTC
Nope, doesn't work. :(

http://upload.nowaker.net/nwkr/1351803759_Xorg.0.log
[  1809.910] (II) [drm] nouveau interface version: 1.0.0
[  1809.910] Requested Entity already in use!
[  1809.910] (II) [drm] nouveau interface version: 1.0.0
[  1809.910] (II) [drm] nouveau interface version: 1.0.0
[  1809.910] (EE) Screen 1 deleted because of no matching config section.

I applied all the four patches.
(full patch: http://upload.nowaker.net/nwkr/1351804213_xexaxo-diff)
Comment 5 Emil Velikov 2012-11-02 03:29:26 UTC
Created attachment 69408 [details] [review]
Four stage patch adding the relevant functions to NVPlatformProbe

Guy can you try the patch series

I have reworked it a bit, to be more consistent with the coding style and eliminate some minor memory leak I have introduced
Comment 6 rodrigo 2012-11-03 19:57:55 UTC
I have this very same bug and just tested your patch over the master/HEAD of today. It works like a charm!

You made my day. Thank you.
--
Rodrigo
Comment 7 Damian Nowak 2012-11-04 13:53:23 UTC
Yeah, it works. Just like before, you can add me to Tested-By in the commit. Can't wait to see that in the upstream. ;-)

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.