xf86-video-ati: Branch 'master'

Matthias Hopf mhopf at kemper.freedesktop.org
Mon Aug 20 06:45:55 PDT 2007


 src/radeon_modes.c |   22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

New commits:
diff-tree a0d0fcd3bab765b4db25e04884fd8a342abb9c66 (from d0895f67e327bb268fd59fcfd8fc22678d804f57)
Author: iLisa Wu <liswu at ati.com>
Date:   Mon Aug 20 15:44:07 2007 +0200

    Fix crash with no valid mode in xorg.conf's modelist and empty Virtual
    
    If the resolution defined in xorg.conf failed to find a matching mode in the
    supported modelist, and no virtual desktop dimensions are defined the xorg.conf
    either, virtual X and Y dimension will be set to 0 which will cause Xserver
    crash.
    
    (Novell bugzilla #296856, closed)

diff --git a/src/radeon_modes.c b/src/radeon_modes.c
index 1a63971..e1635e0 100644
--- a/src/radeon_modes.c
+++ b/src/radeon_modes.c
@@ -299,6 +299,8 @@ int RADEONValidateDDCModes(ScrnInfoPtr p
     DisplayModePtr  first      = NULL;
     DisplayModePtr  ddcModes   = NULL;
     int             count      = 0;
+    int             maxXRes    = 0;
+    int             maxYRes    = 0;
     int             i, width, height;
     ScrnInfoPtr pScrn = pScrn1;
 
@@ -334,13 +336,13 @@ int RADEONValidateDDCModes(ScrnInfoPtr p
 		p->Flags     |= RADEON_USE_RMX;
 	    }
 
-	    maxVirtX = MAX(maxVirtX, p->HDisplay);
-	    maxVirtY = MAX(maxVirtY, p->VDisplay);
+	    maxXRes = maxVirtX = MAX(maxVirtX, p->HDisplay);
+	    maxYRes = maxVirtY = MAX(maxVirtY, p->VDisplay);
 	    count++;
 
 	    last = p;
 	}
-
+    
 	/* Match up modes that are specified in the XF86Config file */
 	if (ppModeName[0]) {
 	    DisplayModePtr  next;
@@ -378,9 +380,21 @@ int RADEONValidateDDCModes(ScrnInfoPtr p
 			    break;
 			}
 		    }
+		    if (!p) {
+			xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+				   " %dx%d is not supported by the device\n",
+				   width, height);
+		    }
 		}
 	    }
-
+	    /* just for sanity check, if maxVirtX and maxVirtY are not
+	     * specified, set max resolution that panel support for the max
+	     * virtual dimensions */
+	    if ((!maxVirtX) || (!maxVirtY)) {
+		maxVirtX = maxXRes;
+		maxVirtY = maxYRes;
+	    }
+	    
 	    /*
 	     * Add remaining DDC modes if they're smaller than the user
 	     * specified modes


More information about the xorg-commit mailing list