xserver: Branch 'master'

Adam Jackson ajax at kemper.freedesktop.org
Fri Aug 18 00:33:35 EEST 2006


 hw/xfree86/common/xf86Mode.c |   78 ++++++++++++-------------------------------
 1 files changed, 22 insertions(+), 56 deletions(-)

New commits:
diff-tree ee5e2cbd2bee610a95facc6b486c4a5070973099 (from 43e42eef1f5a22703eb64fc9cffecde036ea38e0)
Author: Adam Jackson <ajax at benzedrine.nwnk.net>
Date:   Thu Aug 17 17:29:32 2006 -0400

    Un-cut-and-paste the mode rejection message.

diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c
index 72dd1ca..cd57e99 100644
--- a/hw/xfree86/common/xf86Mode.c
+++ b/hw/xfree86/common/xf86Mode.c
@@ -47,6 +47,22 @@
 #include "xf86Priv.h"
 #include "xf86DDC.h"
 
+static void
+printModeRejectMessage(int index, DisplayModePtr p, int status)
+{
+    char *type;
+
+    if (p->type & M_T_BUILTIN)
+	type = "built-in ";
+    else if (p->type & M_T_DEFAULT)
+	type = "default ";
+    else
+	type = "";
+
+    xf86DrvMsg(index, X_INFO, "Not using %smode \"%s\" (%s)\n", type, p->name,
+	       xf86ModeStatusToString(status));
+}
+
 /*
  * xf86GetNearestClock --
  *	Find closest clock to given frequency (in kHz).  This assumes the
@@ -1644,18 +1660,7 @@ xf86ValidateModes(ScrnInfoPtr scrp, Disp
 		q->name = xnfstrdup(p->name);
 	        q->status = MODE_OK;
 	    } else {
-		if (p->type & M_T_BUILTIN)
-		    xf86DrvMsg(scrp->scrnIndex, X_INFO,
-			       "Not using built-in mode \"%s\" (%s)\n",
-			       p->name, xf86ModeStatusToString(status));
-		else if (p->type & M_T_DEFAULT)
-		    xf86DrvMsg(scrp->scrnIndex, X_INFO,
-			       "Not using default mode \"%s\" (%s)\n", p->name,
-			       xf86ModeStatusToString(status));
-		else
-		    xf86DrvMsg(scrp->scrnIndex, X_INFO,
-			       "Not using mode \"%s\" (%s)\n", p->name,
-			       xf86ModeStatusToString(status));
+		printModeRejectMessage(scrp->scrnIndex, p, status);
 	    }
 	}
 
@@ -1796,39 +1801,14 @@ xf86ValidateModes(ScrnInfoPtr scrp, Disp
 
 	repeat = FALSE;
     lookupNext:
-	if (repeat && ((status = p->status) != MODE_OK)) {
-		if (p->type & M_T_BUILTIN)
-		    xf86DrvMsg(scrp->scrnIndex, X_INFO,
-			       "Not using built-in mode \"%s\" (%s)\n",
-			       p->name, xf86ModeStatusToString(status));
-		else if (p->type & M_T_DEFAULT)
-		    xf86DrvMsg(scrp->scrnIndex, X_INFO,
-			       "Not using default mode \"%s\" (%s)\n", p->name,
-			       xf86ModeStatusToString(status));
-		else
-		    xf86DrvMsg(scrp->scrnIndex, X_INFO,
-			       "Not using mode \"%s\" (%s)\n", p->name,
-			       xf86ModeStatusToString(status));
-	}
+	if (repeat && ((status = p->status) != MODE_OK))
+	    printModeRejectMessage(scrp->scrnIndex, p, status);
 	saveType = p->type;
 	status = xf86LookupMode(scrp, p, clockRanges, strategy);
-	if (repeat && status == MODE_NOMODE) {
+	if (repeat && status == MODE_NOMODE)
 	    continue;
-	}
-	if (status != MODE_OK) {
-		if (p->type & M_T_BUILTIN)
-		    xf86DrvMsg(scrp->scrnIndex, X_INFO,
-			       "Not using built-in mode \"%s\" (%s)\n",
-			       p->name, xf86ModeStatusToString(status));
-		else if (p->type & M_T_DEFAULT)
-		    xf86DrvMsg(scrp->scrnIndex, X_INFO,
-			       "Not using default mode \"%s\" (%s)\n", p->name,
-			       xf86ModeStatusToString(status));
-		else
-		    xf86DrvMsg(scrp->scrnIndex, X_INFO,
-			       "Not using mode \"%s\" (%s)\n", p->name,
-			       xf86ModeStatusToString(status));
-	}
+	if (status != MODE_OK)
+	    printModeRejectMessage(scrp->scrnIndex, p, status);
 	if (status == MODE_ERROR) {
 	    ErrorF("xf86ValidateModes: "
 		   "unexpected result from xf86LookupMode()\n");
@@ -2023,20 +2003,6 @@ xf86PruneDriverModes(ScrnInfoPtr scrp)
 	    return;
 	n = p->next;
 	if (p->status != MODE_OK) {
-#if 0
-	    if (p->type & M_T_BUILTIN)
-		xf86DrvMsg(scrp->scrnIndex, X_INFO,
-			   "Not using built-in mode \"%s\" (%s)\n", p->name,
-			   xf86ModeStatusToString(p->status));
-	    else if (p->type & M_T_DEFAULT)
-		xf86DrvMsg(scrp->scrnIndex, X_INFO,
-			   "Not using default mode \"%s\" (%s)\n", p->name,
-			   xf86ModeStatusToString(p->status));
-	    else
-	        xf86DrvMsg(scrp->scrnIndex, X_INFO,
-			   "Not using mode \"%s\" (%s)\n", p->name,
-			   xf86ModeStatusToString(p->status));
-#endif
 	    xf86DeleteMode(&(scrp->modes), p);
 	}
 	p = n;



More information about the xorg-commit mailing list