File xf86-video-nv.diff of Package xorg-x11-driver-video

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.

diff --git a/src/g80_driver.c b/src/g80_driver.c
index 50d55a0..ad8a424 100644
--- a/src/g80_driver.c
+++ b/src/g80_driver.c
@@ -206,11 +206,8 @@ G80PreInit(ScrnInfoPtr pScrn, int flags)
     CARD32 tmp;
     memType BAR1sizeKB;
 
-    if(flags & PROBE_DETECT) {
-        xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-                "G80 PROBE_DETECT unimplemented\n");
-        return FALSE;
-    }
+    if(flags & PROBE_DETECT)
+        return TRUE;
 
     /* Check the number of entities, and fail if it isn't one. */
     if(pScrn->numEntities != 1)
diff --git a/src/nv_driver.c b/src/nv_driver.c
index 831e90b..faf73a9 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
@@ -77,11 +77,22 @@ static Bool	NVModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode);
 static Bool	NVSetModeVBE(ScrnInfoPtr pScrn, DisplayModePtr pMode);
 
 #if XSERVER_LIBPCIACCESS
-/* For now, just match any NVIDIA PCI device and sort through them in the probe
- * routine */
+/* For now, just match any NVIDIA display device and sort through them in the
+ * probe routine */
+
+/*
+ * libpciaccess's masks are shifted by 8 bits compared to the ones in xf86Pci.h.
+ */
+#define LIBPCIACCESS_CLASS_SHIFT (PCI_CLASS_SHIFT - 8)
+#define LIBPCIACCESS_CLASS_MASK (PCI_CLASS_MASK >> 8)
+
 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,
+      PCI_CLASS_DISPLAY << LIBPCIACCESS_CLASS_SHIFT, LIBPCIACCESS_CLASS_MASK, 0 },
+
+    { PCI_VENDOR_NVIDIA_SGS, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY,
+      PCI_CLASS_DISPLAY << LIBPCIACCESS_CLASS_SHIFT, LIBPCIACCESS_CLASS_MASK, 0 },
+
     { 0, 0, 0 }
 };
 #endif
commit b5f33108fea77280c9acd219954f20401f760faf
Author: Adam Jackson <ajax@redhat.com>
Date:   Mon Oct 27 17:54:36 2008 -0400

    Adjust the nv34 panel tweak for Toshiba Tecra M2.

diff --git a/src/nv_dac.c b/src/nv_dac.c
index b1049cc..a256d0a 100644
--- a/src/nv_dac.c
+++ b/src/nv_dac.c
@@ -42,8 +42,21 @@ NVDACPanelTweaks(NVPtr pNv, NVRegPtr state)
           we can do is experiment and apply hacks. */
 
        if(((pNv->Chipset & 0xffff) == 0x0328) && (state->bpp == 32)) {
-          /* At least one NV34 laptop needs this workaround. */
-          tweak = -1;
+#if XSERVER_LIBPCIACCESS
+          if (((pNv->PciInfo->subvendor_id & 0xffff) == 0x1179) &&
+              ((pNv->PciInfo->subdevice_id & 0xffff) == 0x0020))
+#else
+          if (((pNv->PciInfo->subsysVendor & 0xffff) == 0x1179) &&
+              ((pNv->PciInfo->subsysCard & 0xffff) == 0x0020))
+#endif
+          {
+
+             /* Toshiba Tecra M2 */
+             tweak = 1;
+          } else {
+             /* At least one NV34 laptop needs this workaround. */
+             tweak = -1;
+          }
        }
 
        if((pNv->Chipset & 0xfff0) == 0x0310) {
commit 52c034f5a41195f2b3193ec8c18b3f4ed7a763a3
Author: Adam Jackson <ajax@redhat.com>
Date:   Mon Nov 3 15:01:58 2008 -0500

    Do E-EDID if built against a server that supports it.

diff --git a/src/g80_output.c b/src/g80_output.c
index e906fbb..420a73e 100644
--- a/src/g80_output.c
+++ b/src/g80_output.c
@@ -307,7 +307,11 @@ ProbeDDC(I2CBusPtr i2c)
             "Probing for EDID on I2C bus %i...\n", bus);
     pNv->reg[addr/4] = 7;
     /* Should probably use xf86OutputGetEDID here */
+#ifdef EDID_COMPLETE_RAWDATA
+    monInfo = xf86DoEEDID(pScrn->scrnIndex, i2c, TRUE);
+#else
     monInfo = xf86DoEDID_DDC2(pScrn->scrnIndex, i2c);
+#endif
     pNv->reg[addr/4] = 3;
 
     if(monInfo) {
diff --git a/src/nv_setup.c b/src/nv_setup.c
index bea0050..132a96b 100644
--- a/src/nv_setup.c
+++ b/src/nv_setup.c
@@ -229,7 +229,12 @@ NVProbeDDC (ScrnInfoPtr pScrn, int bus)
     xf86DrvMsg(pScrn->scrnIndex, X_INFO, 
                "Probing for EDID on I2C bus %s...\n", bus ? "B" : "A");
 
-    if ((MonInfo = xf86DoEDID_DDC2(pScrn->scrnIndex, pNv->I2C))) {
+#ifdef EDID_COMPLETE_RAWDATA
+    MonInfo = xf86DoEEDID(pScrn->scrnIndex, pNv->I2C, TRUE);
+#else
+    MonInfo = xf86DoEDID_DDC2(pScrn->scrnIndex, pNv->I2C);
+#endif
+    if (MonInfo) {
        xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
                   "DDC detected a %s:\n", MonInfo->features.input_type ?
                   "DFP" : "CRT");
diff --git a/src/riva_setup.c b/src/riva_setup.c
index b7352b6..b616798 100644
--- a/src/riva_setup.c
+++ b/src/riva_setup.c
@@ -167,7 +167,12 @@ RivaProbeDDC (ScrnInfoPtr pScrn)
 
     xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Probing for EDID...\n");
 
-    if ((MonInfo = xf86DoEDID_DDC2(pScrn->scrnIndex, pRiva->I2C))) {
+#ifdef EDID_COMPLETE_RAWDATA
+    MonInfo = xf86DoEEDID(pScrn->scrnIndex, pRiva->I2C, TRUE);
+#else
+    MonInfo = xf86DoEDID_DDC2(pScrn->scrnIndex, pRiva->I2C);
+#endif
+    if (MonInfo) {
        xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                   "  ... found one\n");
        xf86PrintEDID( MonInfo );
openSUSE Build Service is sponsored by