[Xorg-driver-geode] looking at wide mode support for GeodeLX (success)

Bart Trojanowski bart at jukie.net
Sat Mar 1 09:01:18 PST 2008


Hi again,

* Bart Trojanowski <bart at jukie.net> [080229 13:35]:
> Earlier, Jordan presented a patch:
> 
> http://lists.x.org/archives/xorg-driver-geode/2008-February/000211.html
> 
> I tested it with on Gutsy (xorg-core 1.3.0) and found that it was
> skipping most of the modes in LXValidMode() because it was not in the
> Cimarron table.

I am attaching the original patch plus a small logic correction..

-    if ((pMode->type & M_T_BUILTIN) || (pMode->type && M_T_DEFAULT)) {
+    if ((pMode->type & M_T_BUILTIN) || (pMode->type & M_T_DEFAULT)) {

... I read through the patch a few times and didn't spot it until I
started looking at the values of mode->type.

I don't have a way to test this with a PANEL connected.  But I can
confirm that wide modes work.  I am happy to sign off on the patch.

-Bart

-- 
				WebSig: http://www.jukie.net/~bart/sig/
-------------- next part --------------
From 62076bb36c7e3d521c7e5b21f79b50571ef45201 Mon Sep 17 00:00:00 2001
From: Bart Trojanowski <bart at jukie.net>
Date: Wed, 13 Feb 2008 10:43:26 -0500
Subject: [PATCH] ddc patch from Jordan

---
 src/amd_gx_driver.c |    9 +++++----
 src/amd_lx_driver.c |   21 +++++++++++++++------
 2 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/src/amd_gx_driver.c b/src/amd_gx_driver.c
index 177b111..ead492f 100644
--- a/src/amd_gx_driver.c
+++ b/src/amd_gx_driver.c
@@ -783,7 +783,9 @@ GXSetVideoMode(ScrnInfoPtr pScrni, DisplayModePtr pMode)
 
   /* Only use the panel mode for built in modes */
 
-  if ((pMode->type && pMode->type != M_T_USERDEF) && pGeode->Panel) {
+ if ((pMode->type & M_T_BUILTIN) || (pMode->type & M_T_DEFAULT)
+	&& pGeode->Panel) {
+
     GFX(set_fixed_timings(pGeode->PanelX, pGeode->PanelY,
 			  pMode->CrtcHDisplay, pMode->CrtcVDisplay,
 			  pScrni->bitsPerPixel));
@@ -1390,10 +1392,9 @@ GXValidMode(int scrnIndex, DisplayModePtr pMode, Bool Verbose, int flags)
   GeodeRec *pGeode = GEODEPTR(pScrni);
   int p, ret;
 
-  /* Not sure if this is an X bug or not - but on my current build,
-   * user defined modes pass a type of 0 */
+  /* Use the durango lookup for builtin or default modes only */
 
-  if (pMode->type && pMode->type != M_T_USERDEF) {
+  if ((pMode->type & M_T_BUILTIN) || (pMode->type & M_T_DEFAULT)) {
 
     if (pGeode->Panel) {
       if (pMode->CrtcHDisplay > pGeode->PanelX ||
diff --git a/src/amd_lx_driver.c b/src/amd_lx_driver.c
index 9abbd5f..c779ac1 100644
--- a/src/amd_lx_driver.c
+++ b/src/amd_lx_driver.c
@@ -845,9 +845,10 @@ 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 the mode is a default one, then set the mode with the Cimarron
+     * tables */
+
+    if ((pMode->type & M_T_BUILTIN) || (pMode->type & M_T_DEFAULT)) {
       if (pMode->Flags & V_NHSYNC)
 	flags |= VG_MODEFLAG_NEG_HSYNC;
       if (pMode->Flags & V_NVSYNC)
@@ -878,8 +879,14 @@ LXSetVideoMode(ScrnInfoPtr pScrni, DisplayModePtr pMode)
 			    pScrni->bitsPerPixel, GeodeGetRefreshRate(pMode), 
 			    0);
       }
-    } 
-   
+    }
+    else {
+	/* For anything other then a default mode - use the passed in
+	 * timings */
+
+	lx_set_custom_mode(pGeode, pMode, pScrni->bitsPerPixel);
+    }
+
     if (pGeode->Output & OUTPUT_PANEL)
       df_set_output_path((pGeode->Output & OUTPUT_CRT) ? DF_DISPLAY_CRT_FP : DF_DISPLAY_FP);
     else
@@ -1386,7 +1393,9 @@ LXValidMode(int scrnIndex, DisplayModePtr pMode, Bool Verbose, int flags)
 
     memset(&vgQueryMode, 0, sizeof(vgQueryMode));
 
-    if (pMode->type && pMode->type != M_T_USERDEF) {
+    /* For builtin and default modes, try to look up the mode in Cimarron */
+
+    if ((pMode->type & M_T_BUILTIN) || (pMode->type && M_T_DEFAULT)) {
       
       if (pGeode->Output & OUTPUT_PANEL) {
 
-- 
1.5.3.8


From 17d1a6a83aab541a5d627ceee526b1d89c0929c0 Mon Sep 17 00:00:00 2001
From: Bart Trojanowski <bart at jukie.net>
Date: Sat, 1 Mar 2008 11:38:57 -0500
Subject: [PATCH] fix logic bug in LXValidMode()

---
 src/amd_lx_driver.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/amd_lx_driver.c b/src/amd_lx_driver.c
index c779ac1..f125995 100644
--- a/src/amd_lx_driver.c
+++ b/src/amd_lx_driver.c
@@ -1395,7 +1395,7 @@ LXValidMode(int scrnIndex, DisplayModePtr pMode, Bool Verbose, int flags)
 
     /* For builtin and default modes, try to look up the mode in Cimarron */
 
-    if ((pMode->type & M_T_BUILTIN) || (pMode->type && M_T_DEFAULT)) {
+    if ((pMode->type & M_T_BUILTIN) || (pMode->type & M_T_DEFAULT)) {
       
       if (pGeode->Output & OUTPUT_PANEL) {
 
-- 
1.5.3.8



More information about the Xorg-driver-geode mailing list