xserver: Branch 'server-1.12-branch' - 4 commits

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Wed Aug 1 17:06:11 PDT 2012


 glx/glxdri2.c                  |    8 ++++++--
 hw/xfree86/common/xf86Module.h |    2 +-
 hw/xfree86/dri2/dri2.c         |   15 +++++++++++++--
 hw/xfree86/dri2/dri2.h         |    7 ++++++-
 4 files changed, 26 insertions(+), 6 deletions(-)

New commits:
commit e08f1c261c75d50a3581e8791700436cba6e4b21
Author: Julien Cristau <jcristau at debian.org>
Date:   Mon Jul 30 19:24:38 2012 +0200

    Bump video ABI version to 12.1
    
    Track the addition of DRI2CreateDrawable2.
    
    Signed-off-by: Julien Cristau <jcristau at debian.org>

diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h
index 894b93f..0036c59 100644
--- a/hw/xfree86/common/xf86Module.h
+++ b/hw/xfree86/common/xf86Module.h
@@ -82,7 +82,7 @@ typedef enum {
  * mask is 0xFFFF0000.
  */
 #define ABI_ANSIC_VERSION	SET_ABI_VERSION(0, 4)
-#define ABI_VIDEODRV_VERSION	SET_ABI_VERSION(12, 0)
+#define ABI_VIDEODRV_VERSION	SET_ABI_VERSION(12, 1)
 #define ABI_XINPUT_VERSION	SET_ABI_VERSION(16, 0)
 #define ABI_EXTENSION_VERSION	SET_ABI_VERSION(6, 0)
 #define ABI_FONT_VERSION	SET_ABI_VERSION(0, 6)
commit 953c8df9fb7515f70ee6dac7e210e909d26e1490
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Thu Jul 12 13:16:37 2012 +0200

    glx: Free DRI2 drawable reference to destroyed GLX drawable.
    
    Otherwise the reference can lead to use after free in
    __glXDRIinvalidateBuffers().
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50019
    
    Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
    Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit a2d0829531249e24dbca25fc20ed30a2bb2d8ed8)
    
    Signed-off-by: Julien Cristau <jcristau at debian.org>

diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index aa38295..29af190 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -95,6 +95,7 @@ struct __GLXDRIdrawable {
     int height;
     __DRIbuffer buffers[MAX_DRAWABLE_BUFFERS];
     int count;
+    XID dri2_id;
 };
 
 static void
@@ -103,6 +104,8 @@ __glXDRIdrawableDestroy(__GLXdrawable * drawable)
     __GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
     const __DRIcoreExtension *core = private->screen->core;
 
+    FreeResource(private->dri2_id, FALSE);
+
     (*core->destroyDrawable) (private->driDrawable);
 
     __glXDrawableRelease(drawable);
@@ -456,8 +459,9 @@ __glXDRIscreenCreateDrawable(ClientPtr client,
     private->base.waitGL = __glXDRIdrawableWaitGL;
     private->base.waitX = __glXDRIdrawableWaitX;
 
-    if (DRI2CreateDrawable(client, pDraw, drawId,
-                           __glXDRIinvalidateBuffers, private)) {
+    if (DRI2CreateDrawable2(client, pDraw, drawId,
+                            __glXDRIinvalidateBuffers, private,
+                            &private->dri2_id)) {
         free(private);
         return NULL;
     }
commit 60da5029634ca6258e4e2924ed204096437a0503
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Thu Jul 12 13:16:36 2012 +0200

    dri2: Add DRI2CreateDrawable2.
    
    Same as DRI2CreateDrawable, except it can return the DRI2 specific XID of the
    DRI2 drawable reference to the base drawable.
    
    Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
    Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 8a87acc9e57be740e3bd252567622246051a0723)
    
    Signed-off-by: Julien Cristau <jcristau at debian.org>

diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index 591ff3a..156d498 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -280,8 +280,9 @@ DRI2AddDrawableRef(DRI2DrawablePtr pPriv, XID id, XID dri2_id,
 }
 
 int
-DRI2CreateDrawable(ClientPtr client, DrawablePtr pDraw, XID id,
-                   DRI2InvalidateProcPtr invalidate, void *priv)
+DRI2CreateDrawable2(ClientPtr client, DrawablePtr pDraw, XID id,
+                    DRI2InvalidateProcPtr invalidate, void *priv,
+                    XID *dri2_id_out)
 {
     DRI2DrawablePtr pPriv;
     XID dri2_id;
@@ -298,9 +299,19 @@ DRI2CreateDrawable(ClientPtr client, DrawablePtr pDraw, XID id,
     if (rc != Success)
         return rc;
 
+    if (dri2_id_out)
+        *dri2_id_out = dri2_id;
+
     return Success;
 }
 
+int
+DRI2CreateDrawable(ClientPtr client, DrawablePtr pDraw, XID id,
+                   DRI2InvalidateProcPtr invalidate, void *priv)
+{
+    return DRI2CreateDrawable2(client, pDraw, id, invalidate, priv, NULL);
+}
+
 static int
 DRI2DrawableGone(pointer p, XID id)
 {
diff --git a/hw/xfree86/dri2/dri2.h b/hw/xfree86/dri2/dri2.h
index 204fec5..06546bb 100644
--- a/hw/xfree86/dri2/dri2.h
+++ b/hw/xfree86/dri2/dri2.h
@@ -235,6 +235,13 @@ extern _X_EXPORT int DRI2CreateDrawable(ClientPtr client,
                                         DRI2InvalidateProcPtr invalidate,
                                         void *priv);
 
+extern _X_EXPORT int DRI2CreateDrawable2(ClientPtr client,
+                                         DrawablePtr pDraw,
+                                         XID id,
+                                         DRI2InvalidateProcPtr invalidate,
+                                         void *priv,
+                                         XID *dri2_id_out);
+
 extern _X_EXPORT DRI2BufferPtr *DRI2GetBuffers(DrawablePtr pDraw,
                                                int *width,
                                                int *height,
commit cdeb178cd020bbbd0ebbdb512de1d1d16474858a
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Tue Jul 10 02:03:17 2012 +0100

    DRI2: Remove prototype for DRI2DestroyDrawable
    
    DRI2DestroyDrawable() was still being _X_EXPORTed, but hasn't existed
    since 1da1f33f last year.
    
    Signed-off-by: Daniel Stone <daniel at fooishbar.org>
    Reviewed-by: Cyril Brulebois <kibi at debian.org>
    Reviewed-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit b8a3267c36e2e335b888bd4f2ef2f2c477cdfdce)
    
    Signed-off-by: Julien Cristau <jcristau at debian.org>

diff --git a/hw/xfree86/dri2/dri2.h b/hw/xfree86/dri2/dri2.h
index 00b3668..204fec5 100644
--- a/hw/xfree86/dri2/dri2.h
+++ b/hw/xfree86/dri2/dri2.h
@@ -235,8 +235,6 @@ extern _X_EXPORT int DRI2CreateDrawable(ClientPtr client,
                                         DRI2InvalidateProcPtr invalidate,
                                         void *priv);
 
-extern _X_EXPORT void DRI2DestroyDrawable(DrawablePtr pDraw);
-
 extern _X_EXPORT DRI2BufferPtr *DRI2GetBuffers(DrawablePtr pDraw,
                                                int *width,
                                                int *height,


More information about the xorg-commit mailing list