X server aborts if two primary devices found
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
xorg-server (Ubuntu) |
Fix Released
|
High
|
Bryce Harrington | ||
Karmic |
Fix Released
|
High
|
Bryce Harrington |
Bug Description
[Problem]
If multiple video devices are present, X will look to see which is marked primary in the BIOS. If neither are so marked, or both are marked primary, X doesn't know what to do and aborts with an error such as this in Xorg.0.log:
(!!) More than one possible primary device found
(--) PCI: (0:1:0:0) 1002:9400:1002:2552 ATI Technologies Inc R600 [Radeon HD 2900 Series] rev 0, Mem @ 0xc0000000/
(--) PCI: (0:2:0:0) 1002:9400:1002:2552 ATI Technologies Inc R600 [Radeon HD 2900 Series] rev 0, Mem @ 0xd0000000/
Primary device is not PCI
...
(II) VESA: driver for VESA chipsets: vesa
(II) FBDEV: driver for framebuffer: fbdev
(II) Primary Device is:
(WW) Falling back to old probe method for vesa
(WW) Falling back to old probe method for fbdev
...
(EE) open /dev/fb0: No such file or directory
(EE) No devices detected.
Fatal server error:
no screens found
[Discussion]
For some additional background on this class of issues, bug 267241 is worth reviewing. During Jaunty development we found that ALL dual-card setups were broken, including ones with primary/secondary states properly set.
As a temporary fix, I made a patch that simply prevented it from aborting in this case, by just selecting the card with the highest BusID. The problem with the patch is that it could cause X to boot with the secondary card even if the primary was properly marked. But at least it prevented X from failing to start up.
However, a patch from fedora turned up in time for inclusion in Jaunty, that gave a mostly-better solution, by adding code to query bios and detect the primary card and use it. We felt this to be a more elegant solution so this was the patch we shipped in Jaunty. Debian also picked up this patch.
This patch has one flaw however - it still exits out in the specific condition that both cards are PCI (as opposed to one PCI / one VGA), and neither card are marked primary. While this sounds unusual, it does appear in the wild; see attached Xorg.0.log and lspci for example.
[Proposal]
The solution I used originally to just force X to pick the one with the highest bus id would work on top of the fedora patch. In fact, using that plus the fedora patch together gives us a best of both worlds solution since together they cover each other's flaws.
There is still one (potential) issue that it could select the wrong device as primary, if neither device is specified as primary, and if the expected primary has the lower busid. But in this case the bug will be much less severe; instead of not booting at all, it will boot up but just have the monitors reversed from what the user expects.
From the lspci output, note the two video devices are identical types:
00:00.0 Host bridge: Intel Corporation 82X38/X48 Express DRAM Controller (rev 01)
Subsystem: ASUSTeK Computer Inc. Device 8295
01:00.0 VGA compatible controller: ATI Technologies Inc R600 [Radeon HD 2900 Series]
Subsystem: ATI Technologies Inc Device 2552
02:00.0 VGA compatible controller: ATI Technologies Inc R600 [Radeon HD 2900 Series]
Subsystem: ATI Technologies Inc Device 2552
From my reading of the source, X will still abort even if the devices are not the same; it's just checking if one is marked primary or not. However, for testing purposes we should make sure the case of two identical video cards works properly. (I don't have hardware on hand that can replicate this scenario unfortunately.)