Bug 18099 - Xorg -configure tries to create a screen for every nvidia device
Summary: Xorg -configure tries to create a screen for every nvidia device
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/nVidia (open) (show other bugs)
Version: 7.4 (2008.09)
Hardware: Other Solaris
: medium normal
Assignee: Aaron Plattner
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-16 21:00 UTC by Alan Coopersmith
Modified: 2008-10-17 20:49 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Alan Coopersmith 2008-10-16 21:00:33 UTC
On two systems with motherboards utilizing nvidia chipsets, one running
Fedora 9, one running Solaris Express, both running Xorg 1.5 w/libpciaccess,
trying to create an xorg.conf with Xorg -configure generates a configure file
with screens for every device in the system with an nvidia vendor id, and errors
because Xorg can't handle a configuration with that many screens.

This change, suggested by ajax, to only match devices in the graphics class, 
seems to fix it, but has only been tested on one system (the one running
Solaris, on an ASUS A8N-SLI Deluxe motherboard [nVidia CK804 chipset] with
NVS 285 graphics card):

--- a/src/nv_driver.c
+++ b/src/nv_driver.c
@@ -80,8 +80,8 @@ #if XSERVER_LIBPCIACCESS
 /* For now, just match any NVIDIA PCI device and sort through them in the probe
  * routine */
 static const struct pci_id_match NVPciIdMatchList[] = {
-    { PCI_VENDOR_NVIDIA, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, 0 },
-    { PCI_VENDOR_NVIDIA_SGS, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, 0},
+    { PCI_VENDOR_NVIDIA, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, 0x030000, 0xff0000, 0 },
+    { PCI_VENDOR_NVIDIA_SGS, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, 0x030000, 0xff0000, 0},
     { 0, 0, 0 }
 };
 #endif
Comment 1 Aaron Plattner 2008-10-17 04:16:00 UTC
The server definitely used to limit PCI matches to graphics devices.  It seems odd that that behavior changed, but if that's the way it's intended to work now, so be it.
Comment 2 Ian Romanick 2008-10-17 10:12:20 UTC
There are two ways to fix this.  The first is to, as ajax suggested, fix it in the driver.  We don't encounter this bug in other drivers because all of the other driver only match explicit PCI device IDs.  nv uses PCI_MATCH_ANY.

The other fix is to modify probe_devices_from_device_sections (hw/xf86/common/xf86Init.c) to ignore non-graphics devices.  I believe I didn't implement this in the first place because some drivers wanted to claim non-graphics chips.  My recollection (which is getting fuzzy) is that some older 3D accelerators had multiple PCI devices on the card.  One device was the display controller, and the other device was the accelerator.  I'm not sure if we actually care about any of these devices any more.
Comment 3 Aaron Plattner 2008-10-17 20:49:01 UTC
commit e387bf31aae78d4447b4af555a8d09f79f72e6e7
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Fri Oct 17 20:45:18 2008 -0700

    Only match PCI display devices in our display driver.
    
    Apparently the server needs the driver to tell it that no, we really don't want
    screen sections on our NIC, USB hubs, bridge devices, etc.
    
    Stop whining about PROBE_DETECT in G80 PreInit and just bail out instead.
    
    Bug #18099: Xorg -configure tries to create a screen for every nvidia device.

:100644 100644 50d55a0... ad8a424... M  src/g80_driver.c
:100644 100644 831e90b... faf73a9... M  src/nv_driver.c


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.