From d25fcf4d69a56346987b4a5e32098eab30fa847c Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Mon, 28 Sep 2009 14:39:35 +0200 Subject: [PATCH] xorg-server: - add patch from debian to fix some EDID aspect ratio issues --- .../patches/164_trap-aspect-ratios.diff | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 packages/x11/xserver/xorg-server/patches/164_trap-aspect-ratios.diff diff --git a/packages/x11/xserver/xorg-server/patches/164_trap-aspect-ratios.diff b/packages/x11/xserver/xorg-server/patches/164_trap-aspect-ratios.diff new file mode 100644 index 0000000000..aa6d5c2f6b --- /dev/null +++ b/packages/x11/xserver/xorg-server/patches/164_trap-aspect-ratios.diff @@ -0,0 +1,61 @@ +diff --git a/hw/xfree86/ddc/interpret_edid.c b/hw/xfree86/ddc/interpret_edid.c +index c0e3df9..32288f7 100644 +--- a/hw/xfree86/ddc/interpret_edid.c ++++ b/hw/xfree86/ddc/interpret_edid.c +@@ -51,6 +51,15 @@ static void get_whitepoint_section(Uchar *, struct whitePoints *); + static void get_detailed_timing_section(Uchar*, struct detailed_timings *); + static Bool validate_version(int scrnIndex, struct edid_version *); + ++static Bool ++is_standard_aspect_ratio(int x, int y) ++{ ++ return ((x == 16 && y == 9) || ++ (x == 16 && y == 10) || ++ (x == 4 && y == 3) || ++ (x == 5 && y == 4)); ++} ++ + static void + handle_edid_quirks(xf86MonPtr m) + { +@@ -91,10 +100,7 @@ handle_edid_quirks(xf86MonPtr m) + * try to find the largest detailed timing that matches that aspect + * ratio and use that to fill in the feature section. + */ +- if ((m->features.hsize == 16 && m->features.vsize == 9) || +- (m->features.hsize == 16 && m->features.vsize == 10) || +- (m->features.hsize == 4 && m->features.vsize == 3) || +- (m->features.hsize == 5 && m->features.vsize == 4)) { ++ if (is_standard_aspect_ratio(m->features.hsize, m->features.vsize)) { + int real_hsize = 0, real_vsize = 0; + float target_aspect, timing_aspect; + +@@ -130,6 +136,28 @@ handle_edid_quirks(xf86MonPtr m) + xf86Msg(X_INFO, "Quirked EDID physical size to %dx%d cm\n", + m->features.hsize, m->features.vsize); + } ++ ++ /* ++ * Some monitors do the reverse, putting real size in the global block ++ * and aspect ratios in the detailed timings. Check, but only if we ++ * think we've got a real physical size. ++ */ ++ if (m->features.hsize && m->features.vsize) { ++ for (i = 0; i < 4; i++) { ++ if (m->det_mon[i].type == DT) { ++ struct detailed_timings *timing; ++ timing = &m->det_mon[i].section.d_timings; ++ ++ if (is_standard_aspect_ratio(timing->h_size, timing->v_size)) { ++ timing->h_size = m->features.hsize * 10; ++ timing->v_size = m->features.vsize * 10; ++ xf86Msg(X_INFO, "Quirked timing size to %dx%d mm\n", ++ timing->h_size, timing->v_size); ++ ++ } ++ } ++ } ++ } + } + + xf86MonPtr