freedreno: remove always-defined #ifdef
PATCH 1/2 freedreno: remove always-defined #ifdef
While at it, let's include xf86atomic.h explicitly, instead of relying on some other file accidentally including it before including this file.
--- freedreno/freedreno_ringbuffer.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
freedreno/freedreno_ringbuffer.h +1 -2
@@ -29,6 +29,7 @@#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
@@ -83,9 +84,7 @@ struct fd_ringbuffer {* be inlined for performance reasons. */ union { -#ifdef HAS_ATOMIC_OPS atomic_t refcnt; -#endif uint64_t __pad; }; };
Signature · 7 lines
Cheers, Eric _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/2 xf86atomic: #undef internal define
Thanks to the #error just above, any file including this header can only see one state for this macro: defined, with the value 1. Let's just #undef it once we're done using it in here so that other files don't misconstrue any meaning to it.
--- xf86atomic.h | 2 ++ 1 file changed, 2 insertions(+)
xf86atomic.h +2 -0
@@ -101,6 +101,8 @@ 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;
Signature · 7 lines
Cheers, Eric _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH libdrm 2/2] xf86atomic: #undef internal define
Quoted 7 lines · Eric Engestrom
Thanks to the #error just above, any file including this header can only see one state for this macro: defined, with the value
1. Let's just #undef it once we're done using it in here so that other files don't misconstrue any meaning to it.Signed-off-by Eric Engestrom <[email protected]>
For the series:
-Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel