From patchwork Fri Nov 22 04:25:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Packard X-Patchwork-Id: 3221281 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E0AF0C045B for ; Fri, 22 Nov 2013 04:25:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1025520789 for ; Fri, 22 Nov 2013 04:25:50 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 308FD2074B for ; Fri, 22 Nov 2013 04:25:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4138CFAEAC; Thu, 21 Nov 2013 20:25:44 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from keithp.com (home.keithp.com [63.227.221.253]) by gabe.freedesktop.org (Postfix) with ESMTP id A72DEFAEAC; Thu, 21 Nov 2013 20:25:42 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by keithp.com (Postfix) with ESMTP id 8D9D81488005; Thu, 21 Nov 2013 20:25:42 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at keithp.com Received: from keithp.com ([127.0.0.1]) by localhost (keithp.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id dRLnx5J3GoJe; Thu, 21 Nov 2013 20:25:39 -0800 (PST) Received: by keithp.com (Postfix, from userid 1033) id 55C5B1488002; Thu, 21 Nov 2013 20:25:39 -0800 (PST) Received: from miki.keithp.com (localhost [127.0.0.1]) by keithp.com (Postfix) with ESMTP id 24D0115803D; Thu, 21 Nov 2013 20:25:39 -0800 (PST) Received: by miki.keithp.com (Postfix, from userid 1001) id BDE3AB0C; Thu, 21 Nov 2013 20:25:38 -0800 (PST) From: Keith Packard To: mesa-dev@lists.freedesktop.org Subject: [PATCH] dri3: Prepare for API change in libxshmfence Date: Thu, 21 Nov 2013 20:25:37 -0800 Message-Id: <1385094337-23283-1-git-send-email-keithp@keithp.com> X-Mailer: git-send-email 1.8.4.2 Cc: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP libxshmfence foolishly advertises the type of a fence as 'int32_t *', which works when the fence is a linux futex. However, that library is going to change the exported datatype to 'struct xshmfence *', which will provide some nice typechecking. Anticipate the change by just using 'void *' in mesa, which works with both the int32_t* and struct xshmfence* versions. Signed-off-by: Keith Packard --- libxshmfence will also be providing a HAVE_STRUCT_XSHMFENCE define, so we could actually check for that and use struct xshmfence when available. Just using 'void *' avoids a bunch of clutter, but if people think they'd rather have extra type checking, I can do the other version instead. src/glx/dri3_glx.c | 4 ++-- src/glx/dri3_priv.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c index 5861317..239d58b 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; + void *shm_fence; int buffer_fd, fence_fd; int stride; @@ -922,7 +922,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; + void *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..0d21e67 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 */ + void *shm_fence; /* pointer to xshmfence object */ GLboolean busy; /* Set on swap, cleared on IdleNotify */ void *driverPrivate;