xserver: Branch 'master' - 2 commits

Keith Packard keithp at kemper.freedesktop.org
Fri Jul 6 12:13:16 PDT 2012


 hw/xfree86/modes/xf86EdidModes.c |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

New commits:
commit 7c9d8cbd368cac53e7aed9308292614337db3be2
Author: Torsten Kaiser <just.for.lkml at googlemail.com>
Date:   Fri Jul 6 12:10:25 2012 -0700

    xfree86: EDID Est III parsing skips some modes
    
    This loop needs to count from 7 to 0, not only from 7 to 1.
    The current code always skips the modes {1152, 864, 75, 0}, {1280, 1024, 85, 0},
    {1400, 1050, 75, 0}, {1600, 1200, 70, 0} and {1920, 1200, 60, 0}.
    
    Signed-off-by: Torsten Kaiser <x11 at ariolc.dyndns.org>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c
index 47c169c..258ada5 100644
--- a/hw/xfree86/modes/xf86EdidModes.c
+++ b/hw/xfree86/modes/xf86EdidModes.c
@@ -738,7 +738,7 @@ DDCModesFromEstIII(unsigned char *est)
     int i, j, m;
 
     for (i = 0; i < 6; i++) {
-        for (j = 7; j > 0; j--) {
+        for (j = 7; j >= 0; j--) {
             if (est[i] & (1 << j)) {
                 m = (i * 8) + (7 - j);
                 if (EstIIIModes[m].w)
commit 0b3abacb6430e6593c4358420ba457d8149bd32b
Author: Torsten Kaiser <just.for.lkml at googlemail.com>
Date:   Fri Jul 6 12:06:13 2012 -0700

    xfree86: EDID Est III parsing can walk off end of array
    
    Using -O3 gcc notes that m could reach beyound the end of the EstIIIModes array,
    if the last bits of the 11s byte where set.
    Fix this, by extending the array to cover all possible bits from est.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=45623
    
    Signed-off-by: Torsten Kaiser <x11 at ariolc.dyndns.org>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c
index 8aa82d1..47c169c 100644
--- a/hw/xfree86/modes/xf86EdidModes.c
+++ b/hw/xfree86/modes/xf86EdidModes.c
@@ -723,7 +723,13 @@ static const struct {
     1920, 1200, 75, 0}, {
     1920, 1200, 85, 0}, {
     1920, 1440, 60, 0}, {
-1920, 1440, 75, 0},};
+    1920, 1440, 75, 0},
+        /* fill up last byte */
+    {
+    0,0,0,0}, {
+    0,0,0,0}, {
+    0,0,0,0}, {
+    0,0,0,0}, };
 
 static DisplayModePtr
 DDCModesFromEstIII(unsigned char *est)
@@ -735,7 +741,8 @@ DDCModesFromEstIII(unsigned char *est)
         for (j = 7; j > 0; j--) {
             if (est[i] & (1 << j)) {
                 m = (i * 8) + (7 - j);
-                modes = xf86ModesAdd(modes,
+                if (EstIIIModes[m].w)
+                    modes = xf86ModesAdd(modes,
                                      FindDMTMode(EstIIIModes[m].w,
                                                  EstIIIModes[m].h,
                                                  EstIIIModes[m].r,


More information about the xorg-commit mailing list