diff mbox

[04/18] dri3: Switch to libxshmfence version 1.1

Message ID 1386984330-26074-5-git-send-email-keithp@keithp.com (mailing list archive)
State New, archived
Headers show

Commit Message

Keith Packard Dec. 14, 2013, 1:25 a.m. UTC
libxshmfence v1.0 foolishly used 'int32_t *' for the fence type, which
works when the fence is a linux futex. However, version 1.1
changes the exported datatype to 'struct xshmfence *'

Require libxshmfence version 1.1 and switch the API around.

Signed-off-by: Keith Packard <keithp@keithp.com>
---
 configure.ac        | 2 +-
 src/glx/dri3_glx.c  | 4 ++--
 src/glx/dri3_priv.h | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

Comments

Kenneth Graunke Dec. 14, 2013, 2:35 a.m. UTC | #1
On 12/13/2013 05:25 PM, Keith Packard wrote:
> libxshmfence v1.0 foolishly used 'int32_t *' for the fence type, which
> works when the fence is a linux futex. However, version 1.1
> changes the exported datatype to 'struct xshmfence *'
> 
> Require libxshmfence version 1.1 and switch the API around.
> 
> Signed-off-by: Keith Packard <keithp@keithp.com>
> ---
>  configure.ac        | 2 +-
>  src/glx/dri3_glx.c  | 4 ++--
>  src/glx/dri3_priv.h | 2 +-
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 1193cff..db0debc 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -833,7 +833,7 @@ xyesno)
>      dri_modules="x11 xext xdamage xfixes x11-xcb xcb-glx >= 1.8.1 xcb-dri2 >= 1.8"
>  
>      if test x"$enable_dri3" = xyes; then
> -        dri_modules="$dri_modules xcb-dri3 xcb-present xcb-sync xshmfence"
> +        dri_modules="$dri_modules xcb-dri3 xcb-present xcb-sync xshmfence >= 1.1"
>      fi
>  
>      # add xf86vidmode if available
> diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c
> index b047cc8..1834c6d 100644
> --- a/src/glx/dri3_glx.c
> +++ b/src/glx/dri3_glx.c
> @@ -676,7 +676,7 @@ dri3_alloc_render_buffer(struct glx_screen *glx_screen, Drawable draw,
>     xcb_connection_t *c = XGetXCBConnection(dpy);
>     xcb_pixmap_t pixmap;
>     xcb_sync_fence_t sync_fence;
> -   int32_t *shm_fence;
> +   struct xshmfence *shm_fence;
>     int buffer_fd, fence_fd;
>     int stride;
>  
> @@ -921,7 +921,7 @@ dri3_get_pixmap_buffer(__DRIdrawable *driDrawable,
>     struct dri3_screen                   *psc;
>     xcb_connection_t                     *c;
>     xcb_sync_fence_t                     sync_fence;
> -   int32_t                              *shm_fence;
> +   struct xshmfence                     *shm_fence;
>     int                                  fence_fd;
>     __DRIimage                           *image_planar;
>     int                                  stride, offset;
> diff --git a/src/glx/dri3_priv.h b/src/glx/dri3_priv.h
> index c892800..4bffeb7 100644
> --- a/src/glx/dri3_priv.h
> +++ b/src/glx/dri3_priv.h
> @@ -87,7 +87,7 @@ struct dri3_buffer {
>      */
>  
>     uint32_t     sync_fence;     /* XID of X SyncFence object */
> -   int32_t      *shm_fence;     /* pointer to xshmfence object */
> +   struct xshmfence *shm_fence;     /* pointer to xshmfence object */

Would be great to line these comments up.  Patches 2 and 4-6 are:
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

>     GLboolean    busy;           /* Set on swap, cleared on IdleNotify */
>     void         *driverPrivate;
>  
>
Keith Packard Dec. 14, 2013, 7 a.m. UTC | #2
Kenneth Graunke <kenneth@whitecape.org> writes:

> Would be great to line these comments up.

Fixed.

> Patches 2 and 4-6 are:
> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

Review marked. Thanks much!
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index 1193cff..db0debc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -833,7 +833,7 @@  xyesno)
     dri_modules="x11 xext xdamage xfixes x11-xcb xcb-glx >= 1.8.1 xcb-dri2 >= 1.8"
 
     if test x"$enable_dri3" = xyes; then
-        dri_modules="$dri_modules xcb-dri3 xcb-present xcb-sync xshmfence"
+        dri_modules="$dri_modules xcb-dri3 xcb-present xcb-sync xshmfence >= 1.1"
     fi
 
     # add xf86vidmode if available
diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c
index b047cc8..1834c6d 100644
--- a/src/glx/dri3_glx.c
+++ b/src/glx/dri3_glx.c
@@ -676,7 +676,7 @@  dri3_alloc_render_buffer(struct glx_screen *glx_screen, Drawable draw,
    xcb_connection_t *c = XGetXCBConnection(dpy);
    xcb_pixmap_t pixmap;
    xcb_sync_fence_t sync_fence;
-   int32_t *shm_fence;
+   struct xshmfence *shm_fence;
    int buffer_fd, fence_fd;
    int stride;
 
@@ -921,7 +921,7 @@  dri3_get_pixmap_buffer(__DRIdrawable *driDrawable,
    struct dri3_screen                   *psc;
    xcb_connection_t                     *c;
    xcb_sync_fence_t                     sync_fence;
-   int32_t                              *shm_fence;
+   struct xshmfence                     *shm_fence;
    int                                  fence_fd;
    __DRIimage                           *image_planar;
    int                                  stride, offset;
diff --git a/src/glx/dri3_priv.h b/src/glx/dri3_priv.h
index c892800..4bffeb7 100644
--- a/src/glx/dri3_priv.h
+++ b/src/glx/dri3_priv.h
@@ -87,7 +87,7 @@  struct dri3_buffer {
     */
 
    uint32_t     sync_fence;     /* XID of X SyncFence object */
-   int32_t      *shm_fence;     /* pointer to xshmfence object */
+   struct xshmfence *shm_fence;     /* pointer to xshmfence object */
    GLboolean    busy;           /* Set on swap, cleared on IdleNotify */
    void         *driverPrivate;