xf86-video-intel: 2 commits - src/compat-api.h src/sna/fb src/sna/sna_display.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Jul 10 02:24:35 PDT 2015


 src/compat-api.h      |    4 ++++
 src/sna/fb/fb.h       |    4 ----
 src/sna/fb/fbpict.h   |    4 ----
 src/sna/sna_display.c |   14 ++++++++++++++
 4 files changed, 18 insertions(+), 8 deletions(-)

New commits:
commit 2c5063938cc809f624e56efd4673041fa8141e81
Author: Martin Peres <martin.peres at linux.intel.com>
Date:   Thu Jul 9 11:26:38 2015 +0300

    uxa: fix the call to PixmapSyncDirtyHelper, broken by xserver's 90db5ed
    
    [ickle: switch to HAS_DIRTYTRACKING_ROTATION as suggested by Dave Airlie]
    Signed-off-by: Martin Peres <martin.peres at linux.intel.com>

diff --git a/src/compat-api.h b/src/compat-api.h
index aa93bee..293e9d7 100644
--- a/src/compat-api.h
+++ b/src/compat-api.h
@@ -247,3 +247,7 @@ static inline void FreePixmap(PixmapPtr pixmap)
 #endif
 
 #endif
+
+#if HAS_DIRTYTRACKING_ROTATION
+#define PixmapSyncDirtyHelper(d, dd) PixmapSyncDirtyHelper(d)
+#endif
commit 15d8b06d546c651300c0ee649673f15e0731715c
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jul 10 10:02:32 2015 +0100

    sna: Prevent a crash from an invalid EDID read
    
    Suppose that the kernel reported a truncated EDID, we will eventually
    crash by trying to access invalid memory. Prevent the crash by fixing up
    the EDID header to fit the size read from the kernel (though we don't
    fixup the checksum, so strict conformance tests will still complain, but
    we won't crash.)
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/fb/fb.h b/src/sna/fb/fb.h
index 8bf9008..9043174 100644
--- a/src/sna/fb/fb.h
+++ b/src/sna/fb/fb.h
@@ -24,10 +24,6 @@
 #ifndef FB_H
 #define FB_H
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
 #include <xorg-server.h>
 #include <servermd.h>
 #include <gcstruct.h>
diff --git a/src/sna/fb/fbpict.h b/src/sna/fb/fbpict.h
index 932032f..2087777 100644
--- a/src/sna/fb/fbpict.h
+++ b/src/sna/fb/fbpict.h
@@ -24,10 +24,6 @@
 #ifndef FBPICT_H
 #define FBPICT_H
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
 #include <xorg-server.h>
 #include <picturestr.h>
 
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 53eb9ca..3fa6c25 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -53,6 +53,11 @@
 void *alloca(size_t);
 #endif
 
+#define _PARSE_EDID_
+/* Jump through a few hoops in order to fixup EDIDs */
+#undef VERSION
+#undef REVISION
+
 #include "sna.h"
 #include "sna_reg.h"
 #include "fb/fbpict.h"
@@ -3226,6 +3231,15 @@ sna_output_attach_edid(xf86OutputPtr output)
 	    drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETPROPBLOB, &blob))
 		goto done;
 
+	if (blob.length < 128)
+		goto done;
+
+	if (blob.length & 127) {
+		/* Truncated EDID! Make sure no one reads too far */
+		*SECTION(NO_EDID, (uint8_t*)raw) = blob.length/128 - 1;
+		blob.length &= -128;
+	}
+
 	if (old &&
 	    blob.length == sna_output->edid_len &&
 	    memcmp(old, raw, blob.length) == 0) {


More information about the xorg-commit mailing list