[Xorg-driver-geode] [RFC PATCH video-amd] LX support for wide modes

Bart Trojanowski bart at symbio-technologies.com
Fri Feb 8 10:34:59 PST 2008


[[ This patch does work for me, but there were some issues from Jordan
    it does not yet address.  So please test and report failure/success,
    but know that it may not work for all configuration. ]]

-- 

This patch removes the strict requirement that all modes displayed by the
driver be in the Cimarron table.  The LXValidMode() will now permit
non-panel modes to be displayed even if they don't match.

When switching to a new mode, first the Cimarron method is used, and then
the "custom" method.

Thanks to Symbio Technologies for funding my work, and ThinCan for
providing GeodeLX hardware :)

Signed-off-by: Bart Trojanowski <bart at jukie.net>
---
 src/amd_lx_driver.c |   40 +++++++++++++++++++++++++++++++---------
 1 files changed, 31 insertions(+), 9 deletions(-)

diff --git a/src/amd_lx_driver.c b/src/amd_lx_driver.c
index 9abbd5f..908877c 100644
--- a/src/amd_lx_driver.c
+++ b/src/amd_lx_driver.c
@@ -845,9 +845,14 @@ LXSetVideoMode(ScrnInfoPtr pScrni, DisplayModePtr pMode)
     lx_disable_dac_power(pScrni, DF_CRT_DISABLE);
     vg_set_compression_enable(0);
 
-    if (!pMode->type || pMode->type == M_T_USERDEF) 
-      lx_set_custom_mode(pGeode, pMode, pScrni->bitsPerPixel);
-    else {
+    if (!pMode->type || pMode->type == M_T_USERDEF) {
+      int rc = lx_set_custom_mode(pGeode, pMode, pScrni->bitsPerPixel);
+      if (rc) {
+        xf86DrvMsg(pScrni->scrnIndex, X_ERROR,
+                   "Failed to set %s mode; error code %d.",
+                   pMode->name, rc);
+      }
+    } else {
       if (pMode->Flags & V_NHSYNC)
 	flags |= VG_MODEFLAG_NEG_HSYNC;
       if (pMode->Flags & V_NVSYNC)
@@ -873,10 +878,22 @@ LXSetVideoMode(ScrnInfoPtr pScrni, DisplayModePtr pMode)
 			  pScrni->bitsPerPixel, flags);
       }
       else {
-	vg_set_display_mode(pMode->CrtcHDisplay, pMode->CrtcVDisplay,
-			    pMode->CrtcHDisplay, pMode->CrtcVDisplay,
-			    pScrni->bitsPerPixel, GeodeGetRefreshRate(pMode), 
-			    0);
+        int rc = vg_set_display_mode(pMode->CrtcHDisplay, pMode->CrtcVDisplay,
+                            pMode->CrtcHDisplay, pMode->CrtcVDisplay,
+                            pScrni->bitsPerPixel, GeodeGetRefreshRate(pMode),
+                            0);
+        if (rc) {
+          rc = lx_set_custom_mode(pGeode, pMode, pScrni->bitsPerPixel);
+          if (rc == CIM_STATUS_OK) {
+            xf86DrvMsg(pScrni->scrnIndex, X_INFO,
+                       "Unable to match a Cimarron mode to %s, succeeded "
+                       "using custom method.\n", pMode->name);
+          } else {
+            xf86DrvMsg(pScrni->scrnIndex, X_ERROR,
+                       "Failed to set %s mode using Cimarron and custom "
+                       "methods; error code %d.", pMode->name, rc);
+          }
+        }
       }
     } 
    
@@ -1411,8 +1428,13 @@ LXValidMode(int scrnIndex, DisplayModePtr pMode, Bool Verbose, int flags)
 
       ret = vg_get_display_mode_index(&vgQueryMode);
 
-      if (ret < 0)
-	return MODE_BAD;
+      if (ret < 0) {
+        xf86DrvMsg(pScrni->scrnIndex, X_WARNING,
+                   "Mode %s is not available in the Cimarron table.\n",
+                   pMode->name);
+        if (pGeode->Output & OUTPUT_PANEL)
+          return MODE_BAD;
+      }
     }
     
     if (pGeode->tryCompression)
-- 
1.5.3.7.1150.g149d432



More information about the Xorg-driver-geode mailing list