summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2009-05-22 12:01:55 -0400
committerAdam Jackson <ajax@redhat.com>2009-05-22 13:27:16 -0400
commit99e22b86c5f1a3653f3caaf01368a777d2b208d0 (patch)
tree109d5603490cfdff34a8fb303fa2f05d14f82cbd /hw
parent525aa17f804d37d1cfcbbf6b8e6cddb45e999b20 (diff)
EDID: Add modes from Established Timings III descriptor to mode pool
EDID 1.4, section 3.10.3.9
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/ddc/edid.h2
-rw-r--r--hw/xfree86/ddc/interpret_edid.c1
-rw-r--r--hw/xfree86/modes/xf86EdidModes.c87
3 files changed, 86 insertions, 4 deletions
diff --git a/hw/xfree86/ddc/edid.h b/hw/xfree86/ddc/edid.h
index b55600329..42ee9d15e 100644
--- a/hw/xfree86/ddc/edid.h
+++ b/hw/xfree86/ddc/edid.h
@@ -533,7 +533,7 @@ struct detailed_monitor_section {
struct whitePoints wp[2]; /* 32 */
/* color management data */
struct cvt_timings cvt[4]; /* 64 */
- /* established timings III */
+ Uchar est_iii[6]; /* 6 */
} section; /* max: 80 */
};
diff --git a/hw/xfree86/ddc/interpret_edid.c b/hw/xfree86/ddc/interpret_edid.c
index bdcc92e64..12a52545e 100644
--- a/hw/xfree86/ddc/interpret_edid.c
+++ b/hw/xfree86/ddc/interpret_edid.c
@@ -330,6 +330,7 @@ get_dt_md_section(Uchar *c, struct edid_version *ver,
break;
case ADD_EST_TIMINGS:
det_mon[i].type = DS_EST_III;
+ memcpy(det_mon[i].section.est_iii, c + 6, 6);
break;
case ADD_DUMMY:
det_mon[i].type = DS_DUMMY;
diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c
index 4340edd1f..50b669c3e 100644
--- a/hw/xfree86/modes/xf86EdidModes.c
+++ b/hw/xfree86/modes/xf86EdidModes.c
@@ -641,6 +641,85 @@ DDCModesFromCVT(int scrnIndex, struct cvt_timings *t)
}
#endif
+static const struct {
+ short w;
+ short h;
+ short r;
+ short rb;
+} EstIIIModes[] = {
+ /* byte 6 */
+ { 640, 350, 85, 0 },
+ { 640, 400, 85, 0 },
+ { 720, 400, 85, 0 },
+ { 640, 480, 85, 0 },
+ { 848, 480, 60, 0 },
+ { 800, 600, 85, 0 },
+ { 1024, 768, 85, 0 },
+ { 1152, 864, 75, 0 },
+ /* byte 7 */
+ { 1280, 768, 60, 1 },
+ { 1280, 768, 60, 0 },
+ { 1280, 768, 75, 0 },
+ { 1280, 768, 85, 0 },
+ { 1280, 960, 60, 0 },
+ { 1280, 960, 85, 0 },
+ { 1280, 1024, 60, 0 },
+ { 1280, 1024, 85, 0 },
+ /* byte 8 */
+ { 1360, 768, 60, 0 },
+ { 1440, 900, 60, 1 },
+ { 1440, 900, 60, 0 },
+ { 1440, 900, 75, 0 },
+ { 1440, 900, 85, 0 },
+ { 1400, 1050, 60, 1 },
+ { 1400, 1050, 60, 0 },
+ { 1400, 1050, 75, 0 },
+ /* byte 9 */
+ { 1400, 1050, 85, 0 },
+ { 1680, 1050, 60, 1 },
+ { 1680, 1050, 60, 0 },
+ { 1680, 1050, 75, 0 },
+ { 1680, 1050, 85, 0 },
+ { 1600, 1200, 60, 0 },
+ { 1600, 1200, 65, 0 },
+ { 1600, 1200, 70, 0 },
+ /* byte 10 */
+ { 1600, 1200, 75, 0 },
+ { 1600, 1200, 85, 0 },
+ { 1792, 1344, 60, 0 },
+ { 1792, 1344, 85, 0 },
+ { 1856, 1392, 60, 0 },
+ { 1856, 1392, 75, 0 },
+ { 1920, 1200, 60, 1 },
+ { 1920, 1200, 60, 0 },
+ /* byte 11 */
+ { 1920, 1200, 75, 0 },
+ { 1920, 1200, 85, 0 },
+ { 1920, 1440, 60, 0 },
+ { 1920, 1440, 75, 0 },
+};
+
+static DisplayModePtr
+DDCModesFromEstIII(unsigned char *est)
+{
+ DisplayModePtr modes = NULL;
+ int i, j, m;
+
+ for (i = 0; i < 6; i++) {
+ for (j = 7; j > 0; j--) {
+ if (est[i] & (1 << j)) {
+ m = (i * 8) + (7 - j);
+ modes = xf86ModesAdd(modes,
+ FindDMTMode(EstIIIModes[m].w,
+ EstIIIModes[m].h,
+ EstIIIModes[m].r,
+ EstIIIModes[m].rb));
+ }
+ }
+ }
+
+ return modes;
+}
/*
* This is only valid when the sink claims to be continuous-frequency
@@ -811,6 +890,7 @@ xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC)
for (i = 0; i < DET_TIMINGS; i++) {
struct detailed_monitor_section *det_mon = &DDC->det_mon[i];
+ Mode = NULL;
switch (det_mon->type) {
case DT:
Mode = DDCModeFromDetailedTiming(scrnIndex,
@@ -818,22 +898,23 @@ xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC)
preferred,
quirks);
preferred = FALSE;
- Modes = xf86ModesAdd(Modes, Mode);
break;
case DS_STD_TIMINGS:
Mode = DDCModesFromStandardTiming(det_mon->section.std_t,
quirks, timing_level, rb);
- Modes = xf86ModesAdd(Modes, Mode);
break;
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
case DS_CVT:
Mode = DDCModesFromCVT(scrnIndex, det_mon->section.cvt);
- Modes = xf86ModesAdd(Modes, Mode);
break;
#endif
+ case DS_EST_III:
+ Mode = DDCModesFromEstIII(det_mon->section.est_iii);
+ break;
default:
break;
}
+ Modes = xf86ModesAdd(Modes, Mode);
}
/* Add established timings */