aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/common/xf86Configure.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-11-17 15:53:57 +0000
committermarha <marha@users.sourceforge.net>2009-11-17 15:53:57 +0000
commit3fce787ffe938bb3e959ff0b3ec231e54d086c76 (patch)
tree198f537b43a34301bf781c67193c572f6743f925 /xorg-server/hw/xfree86/common/xf86Configure.c
parent236c69d6034b152598ce35abaf3559b0eaa89c12 (diff)
parent578938f1cdd5a06dd6fa28167d575ec980322a5d (diff)
downloadvcxsrv-3fce787ffe938bb3e959ff0b3ec231e54d086c76.tar.gz
vcxsrv-3fce787ffe938bb3e959ff0b3ec231e54d086c76.tar.bz2
vcxsrv-3fce787ffe938bb3e959ff0b3ec231e54d086c76.zip
svn merge ^/branches/released
Diffstat (limited to 'xorg-server/hw/xfree86/common/xf86Configure.c')
-rw-r--r--xorg-server/hw/xfree86/common/xf86Configure.c56
1 files changed, 32 insertions, 24 deletions
diff --git a/xorg-server/hw/xfree86/common/xf86Configure.c b/xorg-server/hw/xfree86/common/xf86Configure.c
index 3b7828a3f..2df6b4ec3 100644
--- a/xorg-server/hw/xfree86/common/xf86Configure.c
+++ b/xorg-server/hw/xfree86/common/xf86Configure.c
@@ -544,6 +544,36 @@ 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)
{
@@ -590,30 +620,8 @@ configureDDCMonitorSection (int screennum)
}
#endif /* def CONFIGURE_DISPLAYSIZE */
- for (i=0;i<4;i++) {
- switch (ConfiguredMonitor->det_mon[i].type) {
- case DS_NAME:
- ptr->mon_modelname = realloc(ptr->mon_modelname,
- strlen((char*)(ConfiguredMonitor->det_mon[i].section.name))
- + 1);
- strcpy(ptr->mon_modelname,
- (char*)(ConfiguredMonitor->det_mon[i].section.name));
- break;
- case DS_RANGES:
- ptr->mon_hsync[ptr->mon_n_hsync].lo =
- ConfiguredMonitor->det_mon[i].section.ranges.min_h;
- ptr->mon_hsync[ptr->mon_n_hsync].hi =
- ConfiguredMonitor->det_mon[i].section.ranges.max_h;
- ptr->mon_n_vrefresh = 1;
- ptr->mon_vrefresh[ptr->mon_n_hsync].lo =
- ConfiguredMonitor->det_mon[i].section.ranges.min_v;
- ptr->mon_vrefresh[ptr->mon_n_hsync].hi =
- ConfiguredMonitor->det_mon[i].section.ranges.max_v;
- ptr->mon_n_hsync++;
- default:
- break;
- }
- }
+ xf86ForEachDetailedBlock(ConfiguredMonitor, handle_detailed_input,
+ ptr);
if (ConfiguredMonitor->features.dpms) {
ptr->mon_option_lst = xf86addNewOption(ptr->mon_option_lst, xstrdup("DPMS"), NULL);