[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xserver-xorg-video-nv: Changes to 'upstream-unstable'



 COPYING           |   26 +
 Makefile.am       |    2 
 README.G80        |   16 
 configure.ac      |   16 
 man/Makefile.am   |    9 
 man/nv.man        |   80 ++--
 src/Makefile.am   |   24 +
 src/g80_cursor.c  |  185 ++++++++++
 src/g80_cursor.h  |    3 
 src/g80_ddc.c     |  230 +++++++++++++
 src/g80_ddc.h     |    1 
 src/g80_display.c |  525 ++++++++++++++++++++++++++++++
 src/g80_display.h |   10 
 src/g80_dma.c     |   65 +++
 src/g80_dma.h     |   14 
 src/g80_driver.c  |  916 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/g80_type.h    |   75 ++++
 src/g80_xaa.c     |  554 ++++++++++++++++++++++++++++++++
 src/g80_xaa.h     |    1 
 src/nv_driver.c   |  121 ++++++-
 src/nv_hw.c       |   13 
 src/nv_include.h  |    2 
 src/nv_type.h     |    1 
 23 files changed, 2840 insertions(+), 49 deletions(-)

New commits:
commit b4e26dfcc01b2816b6f8445fa8e9388b5e254df9
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Tue Apr 17 15:00:24 2007 -0700

    Bump to 2.0.2.

diff --git a/configure.ac b/configure.ac
index 1b3140b..e2f3999 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-nv],
-        2.0.1,
+        2.0.2,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-video-nv)
 

commit b23eeec2bebbbe1939366a8296565ae0120ea6da
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Tue Apr 17 14:59:41 2007 -0700

    G80: Add a basic README.

diff --git a/Makefile.am b/Makefile.am
index 3924813..fd65d86 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -21,7 +21,7 @@
 AUTOMAKE_OPTIONS = foreign
 SUBDIRS = src man
 
-EXTRA_DIST = README.NV1 ChangeLog
+EXTRA_DIST = README.NV1 README.G80 ChangeLog
 
 CLEANFILES = ChangeLog
 .PHONY: ChangeLog
diff --git a/README.G80 b/README.G80
new file mode 100644
index 0000000..f168957
--- /dev/null
+++ b/README.G80
@@ -0,0 +1,16 @@
+This xf86-video-nv driver package contains support for the NVIDIA GeForce 8
+series of graphics processors.
+
+There are a few caveats of which to be aware:
+ - The XVideo extension is not supported.
+ - With X servers prior to version 1.2.0 (X.org 7.2.0) on 64-bit Linux or most
+   non-Linux platforms, the driver may fail to restore the console due to bugs
+   in the server's x86 emulator.
+ - The RENDER extension is not accelerated by this driver.
+ - Only one output can be used at a time.  Work is in progress in the randr-1.2
+   branch to support dual-head output.
+
+Bugs should be reported at http://bugs.freedesktop.org/ under the "xorg"
+product, "Driver/nVidia (open)" component.  Please be sure to fill out the
+platform, OS, and severity fields.  Also attach a copy of your Xorg log file and
+provide a detailed description of your problem and how to reproduce it.

commit b68f3ada7bd857095c7652c175a0ba18bf45801f
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Tue Apr 17 12:47:11 2007 -0700

    Add GeForce 8600 and 8500 PCI IDs.

diff --git a/src/nv_driver.c b/src/nv_driver.c
index 6c04529..6c15cdf 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
@@ -338,6 +338,9 @@ static SymTabRec NVKnownChipsets[] =
   { 0x10DE0193, "GeForce 8800 GTS" },
   { 0x10DE019D, "Quadro FX 5600" },
   { 0x10DE019E, "Quadro FX 4600" },
+  { 0x10DE0400, "GeForce 8600 GTS" },
+  { 0x10DE0402, "GeForce 8600 GT" },
+  { 0x10DE0421, "GeForce 8500 GT" },
 #endif
 
   {-1, NULL}

commit 0126c809544cb3a0242fc3bce7ad82d4962aaf1c
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Sun Apr 1 01:17:31 2007 -0700

    Remove extraneous DisplayModeRec allocation.
    
    Thanks to Luc Verhaegen for pointing this out.

diff --git a/src/nv_driver.c b/src/nv_driver.c
index 7ac162a..6c04529 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
@@ -1599,7 +1599,6 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
     if (pNv->FlatPanel && !pNv->Television && pNv->fpWidth && pNv->fpHeight) {
 	DisplayModePtr Mode;
 
-	Mode = xnfcalloc(1, sizeof(DisplayModeRec));
 	Mode = xf86CVTMode(pNv->fpWidth, pNv->fpHeight, 60.00, TRUE, FALSE);
 	Mode->type = M_T_DRIVER;
 	pScrn->monitor->Modes = NVModesAdd(pScrn->monitor->Modes, Mode);

commit d569934c3de326483347db00d34268b02101599c
Author: Henry Zhao <henryz@localhost.localdomain>
Date:   Sat Mar 31 18:47:30 2007 -0800

    10360: Need to inject a mode corresponding panel width/height for validation

diff --git a/configure.ac b/configure.ac
index 274697c..1b3140b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,6 +59,9 @@ PKG_CHECK_EXISTS([xorg-server >= 1.0.99.901],
                  [AC_DEFINE(HAVE_XV_DRAWABLE,1,[XV hooks take a DrawablePtr])],
                  [AC_DEFINE(USE_LIBC_WRAPPER,1,[Use the libc wrapper])])
 
+PKG_CHECK_EXISTS([xorg-server >= 1.1.99.901],
+                 [AC_DEFINE(USE_CVTMODE_FUNC,1,[Use xf86CVTMode func])])
+
 # Checks for pkg-config packages
 PKG_CHECK_MODULES(XORG, [xorg-server xproto fontsproto $REQUIRED_MODULES])
 sdkdir=$(pkg-config --variable=sdkdir xorg-server)
diff --git a/src/nv_driver.c b/src/nv_driver.c
index 8ab76f6..7ac162a 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
@@ -1021,6 +1021,33 @@ Bool NVI2CInit(ScrnInfoPtr pScrn)
     return FALSE;
 }
 
+
+#ifdef USE_CVTMODE_FUNC
+/* Copied from ddc/Property.c */
+static DisplayModePtr
+NVModesAdd(DisplayModePtr Modes, DisplayModePtr Additions)
+{
+    if (!Modes) {
+        if (Additions)
+            return Additions;
+        else
+            return NULL;
+    }
+
+    if (Additions) {
+        DisplayModePtr Mode = Modes;
+
+        while (Mode->next)
+            Mode = Mode->next;
+        
+        Mode->next = Additions;
+        Additions->prev = Mode;
+    }
+
+    return Modes;
+}
+#endif
+
 /* Mandatory */
 Bool
 NVPreInit(ScrnInfoPtr pScrn, int flags)
@@ -1030,6 +1057,9 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
     int i, max_width, max_height;
     ClockRangePtr clockRanges;
     const char *s;
+#ifdef USE_CVTMODE_FUNC
+    int config_mon_rates;
+#endif
 
     if (flags & PROBE_DETECT) {
         EntityInfoPtr pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
@@ -1487,6 +1517,14 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
     pNv->alphaCursor = (pNv->Architecture >= NV_ARCH_10) &&
                        ((pNv->Chipset & 0x0ff0) != 0x0100);
 
+#ifdef USE_CVTMODE_FUNC
+    if ((pScrn->monitor->nHsync == 0) && 
+	(pScrn->monitor->nVrefresh == 0))
+	config_mon_rates = FALSE;
+    else
+	config_mon_rates = TRUE;
+#endif
+
     NVCommonSetup(pScrn);
 
     if (pNv->FBDev) {
@@ -1556,6 +1594,38 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
        max_height = 4096;
     }
 
+#ifdef USE_CVTMODE_FUNC
+    /* If DFP, add a modeline corresponding to its panel size */
+    if (pNv->FlatPanel && !pNv->Television && pNv->fpWidth && pNv->fpHeight) {
+	DisplayModePtr Mode;
+
+	Mode = xnfcalloc(1, sizeof(DisplayModeRec));
+	Mode = xf86CVTMode(pNv->fpWidth, pNv->fpHeight, 60.00, TRUE, FALSE);
+	Mode->type = M_T_DRIVER;
+	pScrn->monitor->Modes = NVModesAdd(pScrn->monitor->Modes, Mode);
+
+	if (!config_mon_rates) {
+	    if (!Mode->HSync)
+            	Mode->HSync = ((float) Mode->Clock ) / ((float) Mode->HTotal);
+            if (!Mode->VRefresh)
+            	Mode->VRefresh = (1000.0 * ((float) Mode->Clock)) /
+                    ((float) (Mode->HTotal * Mode->VTotal));
+
+ 	    if (Mode->HSync < pScrn->monitor->hsync[0].lo)
+            	pScrn->monitor->hsync[0].lo = Mode->HSync;
+            if (Mode->HSync > pScrn->monitor->hsync[0].hi)
+            	pScrn->monitor->hsync[0].hi = Mode->HSync;
+            if (Mode->VRefresh < pScrn->monitor->vrefresh[0].lo)
+            	pScrn->monitor->vrefresh[0].lo = Mode->VRefresh;
+            if (Mode->VRefresh > pScrn->monitor->vrefresh[0].hi)
+            	pScrn->monitor->vrefresh[0].hi = Mode->VRefresh;
+
+	    pScrn->monitor->nHsync = 1;
+	    pScrn->monitor->nVrefresh = 1;
+	}
+    }
+#endif
+
     /*
      * xf86ValidateModes will check that the mode HTotal and VTotal values
      * don't exceed the chipset's limit if pScrn->maxHValue and

commit 4d929d383abe064b5334847eb466321a6bf30999
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Tue Mar 27 15:56:52 2007 -0700

    REALLY bump to 2.0.1.
    
    I need more caffeine, or something.

diff --git a/configure.ac b/configure.ac
index 565ec6d..274697c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-nv],
-        2.0.0,
+        2.0.1,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-video-nv)
 

commit 0953f081d1592b123dc27fb82d1cfecca079d5de
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Tue Mar 27 15:46:38 2007 -0700

    Fix warnings and bump to 2.0.1.

diff --git a/src/g80_ddc.c b/src/g80_ddc.c
index bcc4bff..4fa076e 100644
--- a/src/g80_ddc.c
+++ b/src/g80_ddc.c
@@ -31,6 +31,7 @@
 
 #include "g80_type.h"
 #include "g80_ddc.h"
+#include "g80_display.h"
 
 static Bool G80ReadPortMapping(int scrnIndex, G80Ptr pNv)
 {
@@ -58,7 +59,7 @@ static Bool G80ReadPortMapping(int scrnIndex, G80Ptr pNv)
     entries = table2[2];
 
     for(i = 0; i < entries; i++) {
-        CARD32 type, port;
+        int type, port;
         ORNum or;
 
         b = *(CARD32*)&table2[headerSize + 8*i];

commit 7c2a31dec3d04111eaee5292c156753c316d52a9
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Tue Mar 27 14:45:17 2007 -0700

    Fix broken prototype.

diff --git a/src/g80_display.h b/src/g80_display.h
index cbe312f..5213576 100644
--- a/src/g80_display.h
+++ b/src/g80_display.h
@@ -1,5 +1,5 @@
 Bool G80LoadDetect(ScrnInfoPtr);
-Bool G80DispLoadDetect(ScrnInfoPtr, ORNum or);
+Bool G80DispDetectLoad(ScrnInfoPtr, ORNum or);
 Bool G80DispInit(ScrnInfoPtr);
 Bool G80DispSetMode(ScrnInfoPtr, DisplayModePtr);
 void G80DispShutdown(ScrnInfoPtr);

commit 16f51977d49e52079754b62f4a13754e56da1c9c
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Mon Mar 19 12:00:36 2007 -0700

    NVSync hangs in EnterVT, so don't call it there.

diff --git a/src/nv_driver.c b/src/nv_driver.c
index 4b07505..8ab76f6 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
@@ -816,7 +816,10 @@ NVProbe(DriverPtr drv, int flags)
 Bool
 NVSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
 {
-    return NVModeInit(xf86Screens[scrnIndex], mode);
+    ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+
+    NVSync(pScrn);
+    return NVModeInit(pScrn, mode);
 }
 
 /*
@@ -1736,8 +1739,6 @@ NVModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
     NVPtr pNv = NVPTR(pScrn);
     NVRegPtr nvReg;
 
-    NVSync(pScrn);
-
     /* Initialise the ModeReg values */
     if (!vgaHWInit(pScrn, mode))
 	return FALSE;

commit ac84f228de689c6cb85eae827ec2443fabe67786
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Sun Mar 18 20:53:46 2007 -0700

    Bump to 2.0.0.

diff --git a/configure.ac b/configure.ac
index 6b1f98e..565ec6d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-nv],
-        1.99.1,
+        2.0.0,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-video-nv)
 

commit 4d15dd2c490cce739f2eb1474019c723da8ce32b
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Fri Mar 16 16:14:00 2007 -0700

    Avoid hanging when switching modes on some nv4x cards.
    
    SUSE bug #235171.

diff --git a/src/nv_driver.c b/src/nv_driver.c
index 97bc8ff..4b07505 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
@@ -1736,6 +1736,8 @@ NVModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
     NVPtr pNv = NVPTR(pScrn);
     NVRegPtr nvReg;
 
+    NVSync(pScrn);
+
     /* Initialise the ModeReg values */
     if (!vgaHWInit(pScrn, mode))
 	return FALSE;

commit 90c53c5322e50bce06996e3c857e6bf7531235d4
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Thu Mar 15 17:07:25 2007 -0700

    Fix GXxor corruption on nv4x.
    
    SUSE bug #246421.

diff --git a/src/nv_hw.c b/src/nv_hw.c
index 6232cd6..d7a0c19 100644
--- a/src/nv_hw.c
+++ b/src/nv_hw.c
@@ -1190,6 +1190,7 @@ void NVLoadStateExt (
               pNv->PGRAPH[0x008C/4] = 0x60de8051;
               pNv->PGRAPH[0x0090/4] = 0x00008000;
               pNv->PGRAPH[0x0610/4] = 0x00be3c5f;
+              pNv->PGRAPH[0x0bc4/4] |= 0x00008000;
 
               j = pNv->REGS[0x1540/4] & 0xff;
               if(j) {

commit 9763b9dcef144f649ccbcfd302601769bc940ffb
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Thu Mar 15 14:39:07 2007 -0700

    Hide the cursor in CloseScreen.
    
    Otherwise, if we're restoring a graphical framebuffer mode the cursor will still
    be visible.

diff --git a/src/nv_driver.c b/src/nv_driver.c
index 64d45c5..97bc8ff 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
@@ -1791,6 +1791,8 @@ NVRestore(ScrnInfoPtr pScrn)
     NVPtr pNv = NVPTR(pScrn);
     NVRegPtr nvReg = &pNv->SavedReg;
 
+    if(pNv->HWCursor)
+        NVShowHideCursor(pNv, 0);
     NVLockUnlock(pNv, 0);
 
     if(pNv->twoHeads) {

commit 9d65abab153cdf3ab2b7e3e2843d573b22ea6769
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Wed Mar 14 21:16:04 2007 -0700

    Fix VGA output with vesafb on nv4x and G7x GPUs.
    
    SuSE bug #160812.

diff --git a/src/nv_hw.c b/src/nv_hw.c
index ab703f1..6232cd6 100644
--- a/src/nv_hw.c
+++ b/src/nv_hw.c
@@ -878,6 +878,10 @@ void NVCalcStateExt (
             state->general  = bpp == 16 ? 0x00101100 : 0x00100100;
             state->repaint1 = hDisplaySize < 1280 ? 0x04 : 0x00;
             break;
+        case NV_ARCH_40:
+            if(!pNv->FlatPanel)
+                state->control = pNv->PRAMDAC0[0x0580/4] & 0xeffffeff;
+            /* fallthrough */
         case NV_ARCH_10:
         case NV_ARCH_20:
         case NV_ARCH_30:
@@ -1475,6 +1479,10 @@ void NVLoadStateExt (
     VGA_WR08(pNv->PCIO, 0x03D5, state->interlace);
 
     if(!pNv->FlatPanel) {
+       if(pNv->Architecture >= NV_ARCH_40) {
+           pNv->PRAMDAC0[0x0580/4] = state->control;
+       }
+
        pNv->PRAMDAC0[0x050C/4] = state->pllsel;
        pNv->PRAMDAC0[0x0508/4] = state->vpll;
        if(pNv->twoHeads)
@@ -1541,6 +1549,10 @@ void NVUnloadStateExt
     state->scale        = pNv->PRAMDAC[0x0848/4];
     state->config       = pNv->PFB[0x0200/4];
 
+    if(pNv->Architecture >= NV_ARCH_40 && !pNv->FlatPanel) {
+        state->control  = pNv->PRAMDAC0[0x0580/4];
+    }
+
     if(pNv->Architecture >= NV_ARCH_10) {
         if(pNv->twoHeads) {
            state->head     = pNv->PCRTC0[0x0860/4];
diff --git a/src/nv_type.h b/src/nv_type.h
index d704e2e..6b29d99 100644
--- a/src/nv_type.h
+++ b/src/nv_type.h
@@ -56,6 +56,7 @@ typedef struct _riva_hw_state
     U032 vpllB;
     U032 vpll2B;
     U032 pllsel;
+    U032 control;
     U032 general;
     U032 crtcOwner;
     U032 head;

commit 26a9f1fa5a92eba7d4b6ddfa47c0517e604be130
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Mon Mar 12 14:56:10 2007 -0700

    Get rid of non-portable := assignments.

diff --git a/man/Makefile.am b/man/Makefile.am
index 036545c..442d27d 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -42,9 +42,9 @@ XORGRELSTRING = @PACKAGE_STRING@
   XORGMANNAME = X Version 11
 
 if SUPPORT_G80
-MAN_SUPPORT_G80 := 1
+MAN_SUPPORT_G80 = 1
 else
-MAN_SUPPORT_G80 := 0
+MAN_SUPPORT_G80 = 0
 endif
 
 MAN_SUBSTS = \

commit 8b2c7bc457d34b7ed59cd08719bec8754ebf6fb8
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Fri Mar 9 12:43:12 2007 -0800

    Use DAC load detection to decide which OR to use instead of trusting the EDID.

diff --git a/src/g80_ddc.c b/src/g80_ddc.c
index 3713028..bcc4bff 100644
--- a/src/g80_ddc.c
+++ b/src/g80_ddc.c
@@ -197,22 +197,19 @@ Bool G80ProbeDDC(ScrnInfoPtr pScrn)
 
         flatPanel = (monInfo->features.input_type == 1);
 
-        if(flatPanel) {
-            if(pNv->i2cMap[port].sor == -1) {
-                xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Saw a flat panel EDID "
-                    "on I2C port %i but no SOR outputs were registered for "
-                    "that port.\n", port);
-                continue;
-            }
+        if(pNv->i2cMap[port].dac != -1 &&
+           G80DispDetectLoad(pScrn, pNv->i2cMap[port].dac)) {
+            pNv->orType = DAC;
+            pNv->or = pNv->i2cMap[port].dac;
+        } else if(pNv->i2cMap[port].sor != -1) {
             pNv->orType = SOR;
             pNv->or = pNv->i2cMap[port].sor;
         } else {
-            if(pNv->i2cMap[port].dac == -1) {
-                xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Saw a flat panel EDID "
-                    "on I2C port %i but no DAC outputs were registered for "
-                    "that port.\n", port);
-                continue;
-            }
+            xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+                       "Saw an EDID on I2C port %i but no DAC load was "
+                       "detected and no SOR is connected to this port.  Using "
+                       "DAC%i.\n", port,
+                       pNv->or);
             pNv->orType = DAC;
             pNv->or = pNv->i2cMap[port].dac;
         }
@@ -220,7 +217,7 @@ Bool G80ProbeDDC(ScrnInfoPtr pScrn)
         xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
                    "Found a %s on I2C port %i, assigning %s%i\n",
                    flatPanel ? "flat panel" : "CRT",
-                   port, flatPanel ? "SOR" : "DAC", pNv->or);
+                   port, pNv->orType == SOR ? "SOR" : "DAC", pNv->or);
 
         pScrn->monitor->DDC = monInfo;
         xf86SetDDCproperties(pScrn, monInfo);
diff --git a/src/g80_display.c b/src/g80_display.c
index 5ff3514..068e902 100644
--- a/src/g80_display.c
+++ b/src/g80_display.c
@@ -187,6 +187,28 @@ G80DispCommand(G80Ptr pNv, CARD32 addr, CARD32 data)
 #define C(mthd, data) G80DispCommand(pNv, (mthd), (data))
 
 /*
+ * Performs load detection on a single DAC.
+ */
+Bool G80DispDetectLoad(ScrnInfoPtr pScrn, ORNum or)
+{
+    G80Ptr pNv = G80PTR(pScrn);
+    const int dacOff = 2048 * or;
+    CARD32 load, tmp;
+
+    pNv->reg[(0x0061A010+dacOff)/4] = 0x00000001;
+    pNv->reg[(0x0061A004+dacOff)/4] = 0x80150000;
+    while(pNv->reg[(0x0061A004+dacOff)/4] & 0x80000000);
+    tmp = pNv->architecture == 0x50 ? 420 : 340;
+    pNv->reg[(0x0061A00C+dacOff)/4] = tmp | 0x100000;
+    usleep(4500);
+    load = pNv->reg[(0x0061A00C+dacOff)/4];
+    pNv->reg[(0x0061A00C+dacOff)/4] = 0;
+    pNv->reg[(0x0061A004+dacOff)/4] = 0x80550000;
+
+    return (load & 0x38000000) == 0x38000000;
+}
+
+/*
  * Performs load detection on the DACs.  Sets pNv->orType and pNv->or
  * accordingly.
  */
@@ -199,21 +221,9 @@ Bool G80LoadDetect(ScrnInfoPtr pScrn)
     pNv->orType = DAC;
 
     for(or = DAC0; or <= DAC2; or++) {
-        const int dacOff = 2048 * or;
-        CARD32 load, tmp;
-
         xf86DrvMsg(scrnIndex, X_PROBED, "Trying load detection on DAC%i ... ", or);
 
-        pNv->reg[(0x0061A010+dacOff)/4] = 0x00000001;
-        pNv->reg[(0x0061A004+dacOff)/4] = 0x80150000;
-        while(pNv->reg[(0x0061A004+dacOff)/4] & 0x80000000);
-        tmp = pNv->architecture == 0x50 ? 420 : 340;
-        pNv->reg[(0x0061A00C+dacOff)/4] = tmp | 0x100000;
-        usleep(4500);
-        load = pNv->reg[(0x0061A00C+dacOff)/4];
-        pNv->reg[(0x0061A00C+dacOff)/4] = 0;
-        pNv->reg[(0x0061A004+dacOff)/4] = 0x80550000;
-        if((load & 0x38000000) == 0x38000000) {
+        if(G80DispDetectLoad(pScrn, or)) {
             xf86ErrorF("found one!\n");
             pNv->or = or;
             return TRUE;
diff --git a/src/g80_display.h b/src/g80_display.h
index aec6314..cbe312f 100644
--- a/src/g80_display.h
+++ b/src/g80_display.h
@@ -1,4 +1,5 @@
 Bool G80LoadDetect(ScrnInfoPtr);
+Bool G80DispLoadDetect(ScrnInfoPtr, ORNum or);
 Bool G80DispInit(ScrnInfoPtr);
 Bool G80DispSetMode(ScrnInfoPtr, DisplayModePtr);
 void G80DispShutdown(ScrnInfoPtr);

commit 06b168ced3cc4aa47cdad21a2351cca674fa26e0
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Thu Mar 8 18:12:43 2007 -0800

    Enable G80 support by default.

diff --git a/configure.ac b/configure.ac
index acebecf..6b1f98e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -64,10 +64,10 @@ PKG_CHECK_MODULES(XORG, [xorg-server xproto fontsproto $REQUIRED_MODULES])
 sdkdir=$(pkg-config --variable=sdkdir xorg-server)
 
 # Check for optional compile-time support
-AC_ARG_ENABLE(g80, AC_HELP_STRING([--enable-g80],
-                                  [Enable G80 support [[default=no]]]),
+AC_ARG_ENABLE(g80, AC_HELP_STRING([--disable-g80],
+                                  [Disable G80 support [[default=no]]]),
               [SUPPORT_G80="$enableval"],
-              [SUPPORT_G80=no])
+              [SUPPORT_G80=yes])
 AM_CONDITIONAL(SUPPORT_G80, test x$SUPPORT_G80 = xyes)
 if test "$SUPPORT_G80" = yes; then
         AC_DEFINE(SUPPORT_G80,1,[Enable G80 support])

commit 23383c2c2e1aa590f69197b1860053d5cb710cf7
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Fri Feb 16 16:11:13 2007 -0800

    Initial G80 support.  Bump to 1.99.1.

diff --git a/COPYING b/COPYING
index 7f33cbf..cad7191 100644
--- a/COPYING
+++ b/COPYING
@@ -1,12 +1,20 @@
-This is a stub file.  This package has not yet had its complete licensing
-information compiled.  Please see the individual source files for details on
-your rights to use and modify this software.
+Copyright (c) 2007 NVIDIA, Corporation
 
-Please submit updated COPYING files to the Xorg bugzilla:
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
 
-https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
 
-All licensing questions regarding this software should be directed at the
-Xorg mailing list:
-
-http://lists.freedesktop.org/mailman/listinfo/xorg
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/configure.ac b/configure.ac
index 571d3f3..acebecf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-nv],
-        1.2.2.1,
+        1.99.1,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-video-nv)
 
@@ -63,6 +63,17 @@ PKG_CHECK_EXISTS([xorg-server >= 1.0.99.901],
 PKG_CHECK_MODULES(XORG, [xorg-server xproto fontsproto $REQUIRED_MODULES])
 sdkdir=$(pkg-config --variable=sdkdir xorg-server)
 
+# Check for optional compile-time support
+AC_ARG_ENABLE(g80, AC_HELP_STRING([--enable-g80],
+                                  [Enable G80 support [[default=no]]]),
+              [SUPPORT_G80="$enableval"],
+              [SUPPORT_G80=no])
+AM_CONDITIONAL(SUPPORT_G80, test x$SUPPORT_G80 = xyes)
+if test "$SUPPORT_G80" = yes; then
+        AC_DEFINE(SUPPORT_G80,1,[Enable G80 support])
+        echo "Enabling G80 support"
+fi
+
 # Checks for libraries.
 
 # Checks for header files.
diff --git a/man/Makefile.am b/man/Makefile.am
index bf7ec17..036545c 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -41,6 +41,12 @@ SED = sed
 XORGRELSTRING = @PACKAGE_STRING@
   XORGMANNAME = X Version 11
 
+if SUPPORT_G80
+MAN_SUPPORT_G80 := 1
+else
+MAN_SUPPORT_G80 := 0
+endif
+
 MAN_SUBSTS = \
 	-e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
 	-e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
@@ -51,7 +57,8 @@ MAN_SUBSTS = \
 	-e 's|__drivermansuffix__|$(DRIVER_MAN_SUFFIX)|g' \
 	-e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \
 	-e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \
-	-e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g'
+	-e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g' \
+	-e 's|__support_g80__|$(MAN_SUPPORT_G80)|g'
 
 SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man
 
diff --git a/man/nv.man b/man/nv.man
index 83d20ae..243b406 100644
--- a/man/nv.man
+++ b/man/nv.man
@@ -58,6 +58,12 @@ NV40, NV41, NV43, NV44, NV45, C51
 .TP 22
 .B GeForce 7XXX
 G70, G71, G72, G73
+.de G8
+.TP 22
+.B GeForce 8XXX
+G80
+..
+.if __support_g80__ .G8
 
 .SH CONFIGURATION DETAILS
 Please refer to __xconfigfile__(__filemansuffix__) for general configuration
@@ -69,7 +75,7 @@ present for all chips.
 .PP
 The following driver
 .B Options
-are supported:
+are supported for pre-G80 hardware:
 .TP
 .BI "Option \*qHWCursor\*q \*q" boolean \*q
 Enable or disable the HW cursor.  Default: on.
@@ -128,42 +134,54 @@ Default: no rotation support.
 .TP
 .BI "Option \*qShadowFB\*q \*q" boolean \*q
 Enable or disable use of the shadow framebuffer layer.  Default: off.
+.
+.\" ******************** begin G80 section ********************
+.de G8
+.PP
+The following driver
+.B Options
+are available for G80:
+.TP
+.BI "Option \*qHWCursor\*q \*q" boolean \*q
+Enable or disable the hardware cursor.  Default: on.
+.TP
+.BI "Option \*qNoAccel\*q \*q" boolean \*q
+Disable or enable acceleration.  Default: acceleration is enabled.
+.TP
+.BI "Option \*qBackendMode\*q \*q" mode \*q
+Designate a mode to be used as the physical mode driving the display.
+The screen will be scaled to fit the requested mode.
+For example, if
+.B Option \*qBackendMode\*q \*q1280x1024\*q
+is specified, the monitor will always display the 1280x1024 mode and the screen will be scaled to match.
+..
+.if __support_g80__ .G8
+.\" ******************** end G80 section ********************
+.
 .SH "SEE ALSO"
 __xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__)
 .SH AUTHORS
 Authors include: David McKay, Jarno Paananen, Chas Inman, Dave Schmenk, 
-Mark Vojkovich
+Mark Vojkovich, Aaron Plattner
 .SH COPYRIGHT
 .LP
-NOTICE TO USER:   The source code  is copyrighted under  U.S. and
-international laws.  Users and possessors of this source code are
-hereby granted a nonexclusive,  royalty-free copyright license to
-use this code in individual and commercial software.
-.LP
-Any use of this source code must include,  in the user documentation and
-internal comments to the code,  notices to the end user as follows:
+Copyright (c) 2003 - 2007 NVIDIA, Corporation
 .LP
-Copyright 1993-2003 NVIDIA, Corporation.  All rights reserved.
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
 .LP
-NVIDIA, CORPORATION MAKES NO REPRESENTATION ABOUT THE SUITABILITY
-OF  THIS SOURCE  CODE  FOR ANY PURPOSE.  IT IS  PROVIDED  "AS IS"
-WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.  NVIDIA, CORPORATION 
-DISCLAIMS ALL WARRANTIES  WITH REGARD  TO THIS SOURCE CODE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT,  
-AND FITNESS  FOR A PARTICULAR PURPOSE.   IN NO EVENT SHALL
-NVIDIA, CORPORATION  BE LIABLE FOR ANY SPECIAL,  INDIRECT,  INCIDENTAL, 
-OR CONSEQUENTIAL DAMAGES,  OR ANY DAMAGES  WHATSOEVER RESULTING FROM 
-LOSS OF USE,  DATA OR PROFITS,  WHETHER IN AN ACTION
-OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,  ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE.
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
 .LP
-U.S. Government  End  Users.   This source code  is a "commercial
-item,"  as that  term is  defined at  48 C.F.R. 2.101 (OCT 1995),
-consisting  of "commercial  computer  software"  and  "commercial
-computer  software  documentation,"  as such  terms  are  used in
-48 C.F.R. 12.212 (SEPT 1995)  and is provided to the U.S. Government 
-only as  a commercial end item.   Consistent with  48 C.F.R.
-12.212 and  48 C.F.R. 227.7202-1 through  227.7202-4 (JUNE 1995),
-all U.S. Government End Users  acquire the source code  with only
-those rights set forth herein.                                   
-
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/src/Makefile.am b/src/Makefile.am
index ecc8597..b7c1128 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -28,7 +28,9 @@ nv_drv_la_LTLIBRARIES = nv_drv.la
 nv_drv_la_LDFLAGS = -module -avoid-version
 nv_drv_ladir = @moduledir@/drivers
 
-nv_drv_la_SOURCES = \
+nv_drv_la_SOURCES = $(nv_sources) $(riva_sources) $(g80_sources)
+
+nv_sources = \
          nv_const.h \
          nv_cursor.c \
          nv_dac.c \
@@ -45,7 +47,9 @@ nv_drv_la_SOURCES = \
          nv_type.h \
          nvvga.h \
          nv_video.c \
-         nv_xaa.c \
+         nv_xaa.c
+
+riva_sources = \
          riva_const.h \
          riva_cursor.c \
          riva_dac.c \
@@ -61,3 +65,19 @@ nv_drv_la_SOURCES = \
          riva_tbl.h \
          riva_type.h \
          riva_xaa.c
+
+if SUPPORT_G80
+g80_sources = \
+         g80_cursor.c \
+         g80_cursor.h \
+         g80_ddc.c \
+         g80_ddc.h \
+         g80_display.c \
+         g80_display.h \
+         g80_dma.c \
+         g80_dma.h \
+         g80_driver.c \
+         g80_type.h \
+         g80_xaa.c \
+         g80_xaa.h
+endif
diff --git a/src/g80_cursor.c b/src/g80_cursor.c
new file mode 100644
index 0000000..07422e5
--- /dev/null
+++ b/src/g80_cursor.c
@@ -0,0 +1,185 @@
+/*
+ * Copyright (c) 2007 NVIDIA, Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <string.h>
+
+#include <cursorstr.h>
+
+#include "g80_type.h"
+#include "g80_cursor.h"
+#include "g80_display.h"
+
+#define CURSOR_PTR ((CARD32*)pNv->mem + pNv->videoRam * 256 - 0x1000)
+
+static void G80SetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
+{
+    G80Ptr pNv = G80PTR(pScrn);
+    CARD32 *dst = CURSOR_PTR;
+    CARD32 *src = pNv->tmpCursor;
+    int i, j;
+
+    fg |= 0xff000000;
+    bg |= 0xff000000;
+
+    for(i = 0; i < 128; i++) {
+        CARD32 b = *src++;
+        CARD32 m = *src++;
+
+        for(j = 0; j < 32; j++) {
+            if(m & 1)
+                *dst = (b & 1) ? fg : bg;
+            else
+                *dst = 0;
+            b >>= 1;
+            m >>= 1;
+            dst++;
+        }
+    }
+}
+
+static void G80SetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
+{
+    G80Ptr pNv = G80PTR(pScrn);
+    const int headOff = 0x1000*pNv->head;
+
+    x &= 0xffff;
+    y &= 0xffff;
+    pNv->reg[(0x00647084 + headOff)/4] = y << 16 | x;
+    pNv->reg[(0x00647080 + headOff)/4] = 0;
+}
+



Reply to: