xf86-video-nv: src/g80_output.c src/g80_sor.c

Aaron Plattner aplattner at kemper.freedesktop.org
Thu Jun 7 18:57:09 PDT 2007


 src/g80_output.c |    6 ++++--
 src/g80_sor.c    |   28 ++++++++++++++++++++++++++--
 2 files changed, 30 insertions(+), 4 deletions(-)

New commits:
diff-tree 4e56465a79587c4df6bf1dfd7cc87a4f22707a8f (from 6b71721439802bffd715602af3036083ff442449)
Author: Aaron Plattner <aplattner at nvidia.com>
Date:   Thu Jun 7 18:28:56 2007 -0700

    G80: Mode validation.
    
    Disable LVDS modes larger than the native resolution.
    Disable dual-link TMDS modes for now since they don't work reliably.

diff --git a/src/g80_output.c b/src/g80_output.c
index 6a2723b..11bdb25 100644
--- a/src/g80_output.c
+++ b/src/g80_output.c
@@ -164,8 +164,10 @@ G80OutputSetPClk(xf86OutputPtr output, i
 int
 G80OutputModeValid(xf86OutputPtr output, DisplayModePtr mode)
 {
-    if(mode->Clock > 400000 || mode->Clock < 25000)
-        return MODE_CLOCK_RANGE;
+    if(mode->Clock > 400000)
+        return MODE_CLOCK_HIGH;
+    if(mode->Clock < 25000)
+        return MODE_CLOCK_LOW;
 
     return MODE_OK;
 }
diff --git a/src/g80_sor.c b/src/g80_sor.c
index a51e5e0..2ab9f2e 100644
--- a/src/g80_sor.c
+++ b/src/g80_sor.c
@@ -65,6 +65,30 @@ G80SorDPMSSet(xf86OutputPtr output, int 
     while((pNv->reg[(0x61C030+off)/4] & 0x10000000));
 }
 
+static int
+G80TMDSModeValid(xf86OutputPtr output, DisplayModePtr mode)
+{
+    // Disable dual-link modes until I can find a way to make them work
+    // reliably.
+    if (mode->Clock > 165000)
+        return MODE_CLOCK_HIGH;
+
+    return G80OutputModeValid(output, mode);
+}
+
+static int
+G80LVDSModeValid(xf86OutputPtr output, DisplayModePtr mode)
+{
+    G80OutputPrivPtr pPriv = output->driver_private;
+    DisplayModePtr native = pPriv->nativeMode;
+
+    // Ignore modes larger than the native res.
+    if (mode->HDisplay > native->HDisplay || mode->VDisplay > native->VDisplay)
+        return MODE_PANEL;
+
+    return G80OutputModeValid(output, mode);
+}
+
 static void
 G80SorModeSet(xf86OutputPtr output, DisplayModePtr mode,
               DisplayModePtr adjusted_mode)
@@ -180,7 +204,7 @@ static const xf86OutputFuncsRec G80SorTM
     .dpms = G80SorDPMSSet,
     .save = NULL,
     .restore = NULL,
-    .mode_valid = G80OutputModeValid,
+    .mode_valid = G80TMDSModeValid,
     .mode_fixup = G80OutputModeFixup,
     .prepare = G80OutputPrepare,
     .commit = G80OutputCommit,
@@ -194,7 +218,7 @@ static const xf86OutputFuncsRec G80SorLV
     .dpms = G80SorDPMSSet,
     .save = NULL,
     .restore = NULL,
-    .mode_valid = G80OutputModeValid,
+    .mode_valid = G80LVDSModeValid,
     .mode_fixup = G80SorModeFixupScale,
     .prepare = G80OutputPrepare,
     .commit = G80OutputCommit,


More information about the xorg-commit mailing list