summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Engestrom <eric.engestrom@intel.com>2019-02-19 09:39:43 +0000
committerEric Engestrom <eric.engestrom@intel.com>2019-02-19 09:50:26 +0000
commite09f327765902f3b7d31874ccf0f45b783299bc0 (patch)
tree0b6e0b22b2372042a81c7656a8f2546ffb74907a
parenteba6609b7bee5a56fa5334992b1e6f3aef8d244a (diff)
downloadlibdrm-e09f327765902f3b7d31874ccf0f45b783299bc0.tar.gz
libdrm-e09f327765902f3b7d31874ccf0f45b783299bc0.tar.bz2
libdrm-e09f327765902f3b7d31874ccf0f45b783299bc0.zip
freedreno: revert bad freedreno/atomic_ops commits
This reverts 6d2379857b6fccc1cade "xf86atomic: #undef internal define" and b541d21a0a908bf98d44 "freedreno: remove always-defined #ifdef". I didn't realise at the time that freedreno/freedreno_ringbuffer.h gets installed, and then used by Mesa for instance. These two commits were fine in libdrm, but broke Mesa which needs to use struct fd_ringbuffer but doesn't need to access ::refcnt. The hack that I removed serves to keep the struct at the correct size while only exposing the ::refcnt member within libdrm. Fixes: 6d2379857b6fccc1cade "xf86atomic: #undef internal define" Fixes: b541d21a0a908bf98d44 "freedreno: remove always-defined #ifdef" Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
-rw-r--r--freedreno/freedreno_ringbuffer.h3
-rw-r--r--xf86atomic.h2
2 files changed, 2 insertions, 3 deletions
diff --git a/freedreno/freedreno_ringbuffer.h b/freedreno/freedreno_ringbuffer.h
index 1a1e8425..bc41a31c 100644
--- a/freedreno/freedreno_ringbuffer.h
+++ b/freedreno/freedreno_ringbuffer.h
@@ -29,7 +29,6 @@
#ifndef FREEDRENO_RINGBUFFER_H_
#define FREEDRENO_RINGBUFFER_H_
-#include <xf86atomic.h>
#include <freedreno_drmif.h>
/* the ringbuffer object is not opaque so that OUT_RING() type stuff
@@ -84,7 +83,9 @@ struct fd_ringbuffer {
* be inlined for performance reasons.
*/
union {
+#ifdef HAS_ATOMIC_OPS
atomic_t refcnt;
+#endif
uint64_t __pad;
};
};
diff --git a/xf86atomic.h b/xf86atomic.h
index e268d274..2d733bd5 100644
--- a/xf86atomic.h
+++ b/xf86atomic.h
@@ -101,8 +101,6 @@ typedef struct { LIBDRM_ATOMIC_TYPE atomic; } atomic_t;
#error libdrm requires atomic operations, please define them for your CPU/compiler.
#endif
-#undef HAS_ATOMIC_OPS
-
static inline int atomic_add_unless(atomic_t *v, int add, int unless)
{
int c, old;