xserver: Branch 'master' - 2 commits
Adam Jackson
ajax at kemper.freedesktop.org
Fri Dec 28 14:39:24 PST 2007
hw/xfree86/common/xf86Mode.c | 35 ++++++++++++++++++++++++++++-------
hw/xfree86/modes/xf86EdidModes.c | 2 ++
2 files changed, 30 insertions(+), 7 deletions(-)
New commits:
commit 85365ddf16e2b954d8249b380df53337420ed684
Author: Adam Jackson <ajax at redhat.com>
Date: Fri Dec 28 17:35:54 2007 -0500
EDID 1.4: If given a native pixel format, use it when inferring virtual.
diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c
index 782f08b..fb899a1 100644
--- a/hw/xfree86/common/xf86Mode.c
+++ b/hw/xfree86/common/xf86Mode.c
@@ -1215,20 +1215,40 @@ inferVirtualSize(ScrnInfoPtr scrp, DisplayModePtr modes, int *vx, int *vy)
{
float aspect = 0.0;
MonPtr mon = scrp->monitor;
+ xf86MonPtr DDC;
int x = 0, y = 0;
DisplayModePtr mode;
if (!mon) return 0;
+ DDC = mon->DDC;
+
+ if (DDC && DDC->ver.revision >= 4) {
+ /* For 1.4, we might actually get native pixel format. How novel. */
+ if (PREFERRED_TIMING_MODE(DDC->features.msc)) {
+ for (mode = modes; mode; mode = mode->next) {
+ if (mode->type & (M_T_DRIVER | M_T_PREFERRED)) {
+ x = mode->HDisplay;
+ y = mode->VDisplay;
+ goto found;
+ }
+ }
+ }
+ /*
+ * Even if we don't, we might get aspect ratio from extra CVT info
+ * or from the monitor size fields. TODO.
+ */
+ }
/*
- * technically this triggers if _either_ is zero, which is not what EDID
- * says, but if only one is zero this is best effort. also we don't
- * know that all projectors are 4:3, but we certainly suspect it.
+ * Technically this triggers if either is zero. That wasn't legal
+ * before EDID 1.4, but right now we'll get that wrong. TODO.
*/
- if (!mon->widthmm || !mon->heightmm)
- aspect = 4.0/3.0;
- else
- aspect = (float)mon->widthmm / (float)mon->heightmm;
+ if (!aspect) {
+ if (!mon->widthmm || !mon->heightmm)
+ aspect = 4.0/3.0;
+ else
+ aspect = (float)mon->widthmm / (float)mon->heightmm;
+ }
/* find the largest M_T_DRIVER mode with that aspect ratio */
for (mode = modes; mode; mode = mode->next) {
@@ -1252,6 +1272,7 @@ inferVirtualSize(ScrnInfoPtr scrp, DisplayModePtr modes, int *vx, int *vy)
return 0;
}
+found:
*vx = x;
*vy = y;
commit 312b30cb03e439644ea10e08fa93268116333f0d
Author: Adam Jackson <ajax at redhat.com>
Date: Fri Dec 28 17:18:30 2007 -0500
EDID 1.4: First detailed mode is always preferred.
... so act like it in the modelist generator, not just the parser.
diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c
index d8c6161..87a8127 100644
--- a/hw/xfree86/modes/xf86EdidModes.c
+++ b/hw/xfree86/modes/xf86EdidModes.c
@@ -534,6 +534,8 @@ xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC)
quirks = xf86DDCDetectQuirks(scrnIndex, DDC, TRUE);
preferred = PREFERRED_TIMING_MODE(DDC->features.msc);
+ if (DDC->ver.revision >= 4)
+ preferred = TRUE;
if (quirks & DDC_QUIRK_FIRST_DETAILED_PREFERRED)
preferred = TRUE;
if (quirks & (DDC_QUIRK_PREFER_LARGE_60 | DDC_QUIRK_PREFER_LARGE_75))
More information about the xorg-commit
mailing list