xserver: Branch 'master' - 5 commits

Keith Packard keithp at kemper.freedesktop.org
Fri Dec 13 12:50:29 PST 2013


 configure.ac                |    2 +-
 dri3/dri3_request.c         |    5 +++--
 dri3/dri3_screen.c          |    6 ++++++
 glx/glxext.c                |    4 +++-
 include/protocol-versions.h |    8 ++++++++
 present/present_request.c   |    5 +++--
 6 files changed, 24 insertions(+), 6 deletions(-)

New commits:
commit f4bfb14f53a939574da1f5995f0dad949898b86a
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Dec 12 10:57:40 2013 -0500

    configure: Fix a typo near dri3/shmfence detection
    
    " is not the mate of ].
    
    Reviewed-by: Jasper St. Pierre <jstpierre at mecheye.net>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/configure.ac b/configure.ac
index 8bedd35..3f2c2d0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1218,7 +1218,7 @@ case "$DRI3,$HAVE_XSHMFENCE" in
 	yes,yes | auto,yes)
 		;;
 	yes,no)
-		AC_MSG_ERROR("DRI3 requested, but xshmfence not found.])
+		AC_MSG_ERROR([DRI3 requested, but xshmfence not found.])
 		DRI3=no
 		;;
 	no,*)
commit 8248b4af31ef71ac03158871b77f20eb456dbe38
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Dec 13 15:07:48 2013 -0500

    glx: Add null pointer protection to __glGetProcAddress
    
    This can't happen when GLX is the backing window system, but can
    elsewhere.  We may as well protect against it at a high level.
    
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/glx/glxext.c b/glx/glxext.c
index 84ac43d..316b4f6 100644
--- a/glx/glxext.c
+++ b/glx/glxext.c
@@ -554,7 +554,9 @@ __glXsetGetProcAddress(glx_gpa_proc get_proc_address)
 
 void *__glGetProcAddress(const char *proc)
 {
-    return _get_proc_address(proc);
+    void *ret = _get_proc_address(proc);
+
+    return ret ? ret : NoopDDA;
 }
 
 /*
commit 128449dd6498a2f74c3770f89a9dae0f70e2b351
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Dec 13 11:39:16 2013 -0500

    present: Don't use the major/minor version from the protocol headers
    
    We want to advertise the version we implement, not the version the
    protocol headers happen to describe.
    
    Reviewed-by: Jasper St. Pierre <<jstpierre at mecheye.net>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/include/protocol-versions.h b/include/protocol-versions.h
index 7fe61e0..fc428c8 100644
--- a/include/protocol-versions.h
+++ b/include/protocol-versions.h
@@ -67,6 +67,10 @@
 #define SERVER_PANORAMIX_MAJOR_VERSION          1
 #define SERVER_PANORAMIX_MINOR_VERSION		1
 
+/* Present */
+#define SERVER_PRESENT_MAJOR_VERSION            1
+#define SERVER_PRESENT_MINOR_VERSION            0
+
 /* RandR */
 #define SERVER_RANDR_MAJOR_VERSION		1
 #define SERVER_RANDR_MINOR_VERSION		4
diff --git a/present/present_request.c b/present/present_request.c
index 095fa2d..1064dcb 100644
--- a/present/present_request.c
+++ b/present/present_request.c
@@ -26,6 +26,7 @@
 
 #include "present_priv.h"
 #include "randrstr.h"
+#include <protocol-versions.h>
 
 static int
 proc_present_query_version(ClientPtr client)
@@ -35,8 +36,8 @@ proc_present_query_version(ClientPtr client)
         .type = X_Reply,
         .sequenceNumber = client->sequence,
         .length = 0,
-        .majorVersion = PRESENT_MAJOR,
-        .minorVersion = PRESENT_MINOR
+        .majorVersion = SERVER_PRESENT_MAJOR_VERSION,
+        .minorVersion = SERVER_PRESENT_MINOR_VERSION
     };
 
     REQUEST_SIZE_MATCH(xPresentQueryVersionReq);
commit ec6087bf070131bc3a26848fb9fb840f09b0e19d
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Dec 13 11:36:38 2013 -0500

    dri3: Don't use the major/minor version from the protocol headers
    
    We want to advertise the version we implement, not the version the
    protocol headers happen to describe.
    
    Reviewed-by: Jasper St. Pierre <<jstpierre at mecheye.net>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/dri3/dri3_request.c b/dri3/dri3_request.c
index 3ebb9d5..4e1408f 100644
--- a/dri3/dri3_request.c
+++ b/dri3/dri3_request.c
@@ -29,6 +29,7 @@
 #include <unistd.h>
 #include <xace.h>
 #include "../Xext/syncsdk.h"
+#include <protocol-versions.h>
 
 static int
 proc_dri3_query_version(ClientPtr client)
@@ -38,8 +39,8 @@ proc_dri3_query_version(ClientPtr client)
         .type = X_Reply,
         .sequenceNumber = client->sequence,
         .length = 0,
-        .majorVersion = DRI3_MAJOR,
-        .minorVersion = DRI3_MINOR
+        .majorVersion = SERVER_DRI3_MAJOR_VERSION,
+        .minorVersion = SERVER_DRI3_MINOR_VERSION
     };
 
     REQUEST_SIZE_MATCH(xDRI3QueryVersionReq);
diff --git a/include/protocol-versions.h b/include/protocol-versions.h
index 95df8ce..7fe61e0 100644
--- a/include/protocol-versions.h
+++ b/include/protocol-versions.h
@@ -46,6 +46,10 @@
 #define SERVER_DAMAGE_MAJOR_VERSION		1
 #define SERVER_DAMAGE_MINOR_VERSION		1
 
+/* DRI3 */
+#define SERVER_DRI3_MAJOR_VERSION               1
+#define SERVER_DRI3_MINOR_VERSION               0
+
 /* DMX */
 #define SERVER_DMX_MAJOR_VERSION		2
 #define SERVER_DMX_MINOR_VERSION		2
commit e6fafd3de70d315130fb6e5732cfd02a5901b788
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Dec 13 11:28:59 2013 -0500

    dri3: Guard against buggy clients
    
    There's nothing to stop a client from sending these requests to screens
    without DRI3 support, and if they do, we'll crash.  Let's not do that.
    
    Reviewed-by: Jasper St. Pierre <<jstpierre at mecheye.net>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/dri3/dri3_screen.c b/dri3/dri3_screen.c
index cf2735b..c880296 100644
--- a/dri3/dri3_screen.c
+++ b/dri3/dri3_screen.c
@@ -55,6 +55,9 @@ dri3_pixmap_from_fd(PixmapPtr *ppixmap, ScreenPtr screen, int fd,
     dri3_screen_info_ptr        info = ds->info;
     PixmapPtr                   pixmap;
 
+    if (!info || !info->pixmap_from_fd)
+        return BadImplementation;
+
     pixmap = (*info->pixmap_from_fd) (screen, fd, width, height, stride, depth, bpp);
     if (!pixmap)
         return BadAlloc;
@@ -71,6 +74,9 @@ dri3_fd_from_pixmap(int *pfd, PixmapPtr pixmap, CARD16 *stride, CARD32 *size)
     dri3_screen_info_ptr        info = ds->info;
     int                         fd;
 
+    if (!info || !info->fd_from_pixmap)
+        return BadImplementation;
+
     fd = (*info->fd_from_pixmap)(screen, pixmap, stride, size);
     if (fd < 0)
         return BadAlloc;


More information about the xorg-commit mailing list