freedreno: revert bad freedreno/atomic_ops commits

This reverts 6d2379857b "xf86atomic: #undef internal define"
and b541d21a0a "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: 6d2379857b "xf86atomic: #undef internal define"
Fixes: b541d21a0a "freedreno: remove always-defined #ifdef"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
main
Eric Engestrom 2019-02-19 09:39:43 +00:00
parent eba6609b7b
commit e09f327765
2 changed files with 2 additions and 3 deletions

View File

@ -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;
};
};

View File

@ -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;