[PATCH 1/6] xfree86: Remove ConfiguredMonitor

Adam Jackson ajax at redhat.com
Thu Dec 1 13:50:56 PST 2011


The only purpose this served was to serialize VBE-fetched EDID into the
config file when running with -configure.

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 hw/xfree86/common/xf86Configure.c |   94 +------------------------------------
 hw/xfree86/ddc/edid.h             |    2 -
 2 files changed, 1 insertions(+), 95 deletions(-)

diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
index 24f367e..4bbcd94 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -53,7 +53,6 @@ typedef struct _DevToConfig {
 static DevToConfigPtr DevToConfig = NULL;
 static int nDevToConfig = 0, CurrentDriver;
 
-xf86MonPtr ConfiguredMonitor;
 Bool xf86DoConfigurePass1 = TRUE;
 static Bool foundMouse = FALSE;
 
@@ -429,89 +428,6 @@ configureMonitorSection (int screennum)
     return ptr;
 }
 
-/* Initialize Configure Monitor from Detailed Timing Block */
-static void handle_detailed_input(struct detailed_monitor_section *det_mon,
-                                  void *data)
-{
-    XF86ConfMonitorPtr ptr = (XF86ConfMonitorPtr) data;
-
-    switch (det_mon->type) {
-    case DS_NAME:
-        ptr->mon_modelname = realloc(ptr->mon_modelname,
-                                     strlen((char*)(det_mon->section.name)) +
-                                     1);
-        strcpy(ptr->mon_modelname,
-	      (char*)(det_mon->section.name));
-        break;
-    case DS_RANGES:
-        ptr->mon_hsync[ptr->mon_n_hsync].lo =
-            det_mon->section.ranges.min_h;
-        ptr->mon_hsync[ptr->mon_n_hsync].hi =
-            det_mon->section.ranges.max_h;
-        ptr->mon_n_vrefresh = 1;
-        ptr->mon_vrefresh[ptr->mon_n_hsync].lo =
-            det_mon->section.ranges.min_v;
-        ptr->mon_vrefresh[ptr->mon_n_hsync].hi =
-            det_mon->section.ranges.max_v;
-        ptr->mon_n_hsync++;
-    default:
-        break;
-    }
-}
-
-static XF86ConfMonitorPtr
-configureDDCMonitorSection (int screennum)
-{
-    int len, mon_width, mon_height;
-#define displaySizeMaxLen 80
-    char displaySize_string[displaySizeMaxLen];
-    int displaySizeLen;
-
-    parsePrologue (XF86ConfMonitorPtr, XF86ConfMonitorRec)
-
-    XNFasprintf(&ptr->mon_identifier, "Monitor%d", screennum);
-    ptr->mon_vendor = strdup(ConfiguredMonitor->vendor.name);
-    XNFasprintf(&ptr->mon_modelname, "%x", ConfiguredMonitor->vendor.prod_id);
-
-    /* features in centimetres, we want millimetres */
-    mon_width  = 10 * ConfiguredMonitor->features.hsize ;
-    mon_height = 10 * ConfiguredMonitor->features.vsize ;
-
-#ifdef CONFIGURE_DISPLAYSIZE
-    ptr->mon_width  = mon_width;
-    ptr->mon_height = mon_height;
-#else
-    if (mon_width && mon_height) {
-      /* when values available add DisplaySize option AS A COMMENT */
-
-      displaySizeLen = snprintf(displaySize_string, displaySizeMaxLen,
-				"\t#DisplaySize\t%5d %5d\t# mm\n",
-				mon_width, mon_height);
-
-      if (displaySizeLen>0 && displaySizeLen<displaySizeMaxLen) {
-	if (ptr->mon_comment) {
-	  len = strlen(ptr->mon_comment);
-	} else {
-	  len = 0;
-	}
-	if ((ptr->mon_comment =
-	     realloc(ptr->mon_comment, len + strlen(displaySize_string) + 1))) {
-	  strcpy(ptr->mon_comment + len, displaySize_string);
-	}
-      }
-    }
-#endif /* def CONFIGURE_DISPLAYSIZE */
-
-    xf86ForEachDetailedBlock(ConfiguredMonitor, handle_detailed_input,
-                             ptr);
-
-    if (ConfiguredMonitor->features.dpms) {
-      ptr->mon_option_lst = xf86addNewOption(ptr->mon_option_lst, strdup("DPMS"), NULL);
-    }
-
-    return ptr;
-}
-
 void
 DoConfigure(void)
 {
@@ -708,15 +624,7 @@ DoConfigure(void)
 	XF86ConfMonitorPtr MonitorPtr;
 	XF86ConfScreenPtr ScreenPtr;
 
-	ConfiguredMonitor = NULL;
-
-	if ((*xf86Screens[dev2screen[j]]->PreInit)(xf86Screens[dev2screen[j]], 
-						   PROBE_DETECT) &&
-	    ConfiguredMonitor) {
-	    MonitorPtr = configureDDCMonitorSection(j);
-	} else {
-	    MonitorPtr = configureMonitorSection(j);
-	}
+	MonitorPtr = configureMonitorSection(j);
 	ScreenPtr = configureScreenSection(j);
 	xf86config->conf_monitor_lst = (XF86ConfMonitorPtr)xf86addListItem(
 		(glp)xf86config->conf_monitor_lst, (glp)MonitorPtr);
diff --git a/hw/xfree86/ddc/edid.h b/hw/xfree86/ddc/edid.h
index cc4bd02..749d864 100644
--- a/hw/xfree86/ddc/edid.h
+++ b/hw/xfree86/ddc/edid.h
@@ -560,8 +560,6 @@ typedef struct {
   Uchar *rawData;
 } xf86Monitor, *xf86MonPtr;
 
-extern _X_EXPORT xf86MonPtr ConfiguredMonitor;
-
 #define EXT_TAG 0
 #define EXT_REV 1
 #define CEA_EXT   0x02
-- 
1.7.6.4



More information about the xorg-devel mailing list