diff options
author | bjs <bjs> | 2008-05-06 06:20:25 +0000 |
---|---|---|
committer | bjs <bjs> | 2008-05-06 06:20:25 +0000 |
commit | 6ef5123774d4f8c42373869f03d61c434b76ff06 (patch) | |
tree | 3f15654e8da5e1c567e0f81a8faf6435cc23833e /x11/libdrm/patches | |
parent | 37887cd7f57bdc0b08041549c825d955fb030c71 (diff) | |
download | pkgsrc-6ef5123774d4f8c42373869f03d61c434b76ff06.tar.gz |
Add support for the userland atomic ops of NetBSD-current.
As per the comment in xf86drm.h, this should be reflected here, as we
now use atomic_cas_uint() in drm_atomic.h.
Diffstat (limited to 'x11/libdrm/patches')
-rw-r--r-- | x11/libdrm/patches/patch-ac | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/x11/libdrm/patches/patch-ac b/x11/libdrm/patches/patch-ac new file mode 100644 index 00000000000..58b61d9d73b --- /dev/null +++ b/x11/libdrm/patches/patch-ac @@ -0,0 +1,30 @@ +$NetBSD: patch-ac,v 1.1 2008/05/06 06:20:25 bjs Exp $ + +--- libdrm/xf86drm.h.orig 2006-11-08 16:55:14.000000000 -0500 ++++ libdrm/xf86drm.h +@@ -37,7 +37,11 @@ + #define _XF86DRM_H_ + + #include <stdarg.h> ++#if @ATOMIC_OPS_CHECK@ /* configured by pkgsrc */ ++#include <sys/atomic.h> ++#else + #include <sys/types.h> ++#endif + #include <drm.h> + + /* Defaults, if nothing set in xf86config */ +@@ -305,7 +309,12 @@ typedef struct _drmSetVersion { + #define DRM_LOCK_HELD 0x80000000U /**< Hardware lock is held */ + #define DRM_LOCK_CONT 0x40000000U /**< Hardware lock is contended */ + +-#if defined(__GNUC__) && (__GNUC__ >= 2) ++#if @ATOMIC_OPS_CHECK@ /* configured by pkgsrc */ ++ ++#define DRM_CAS(lock, old, new, __ret) \ ++ (__ret = atomic_cas_uint(&__drm_dummy_lock(lock), (old), (new)) != (old)); ++ ++#elif defined(__GNUC__) && (__GNUC__ >= 2) + # if defined(__i386) || defined(__AMD64__) || defined(__x86_64__) || defined(__amd64__) + /* Reflect changes here to drmP.h */ + #define DRM_CAS(lock,old,new,__ret) \ |