[Mesa-dev] [PATCH 16/53] i965/drm: Use Mesa's macros.h instead of duplicating them.

Kenneth Graunke kenneth at whitecape.org
Wed Apr 5 00:10:06 UTC 2017


---
 src/mesa/drivers/dri/i965/intel_bufmgr_gem.c  |  5 ++---
 src/mesa/drivers/dri/i965/intel_bufmgr_priv.h |  4 ----
 src/mesa/drivers/dri/i965/libdrm_macros.h     | 10 +---------
 3 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_bufmgr_gem.c b/src/mesa/drivers/dri/i965/intel_bufmgr_gem.c
index d2bc3ed66cb..b981658e920 100644
--- a/src/mesa/drivers/dri/i965/intel_bufmgr_gem.c
+++ b/src/mesa/drivers/dri/i965/intel_bufmgr_gem.c
@@ -57,6 +57,8 @@
 #define ETIME ETIMEDOUT
 #endif
 #include "libdrm_macros.h"
+#include "main/macros.h"
+#include "util/macros.h"
 #include "util/list.h"
 #include "brw_bufmgr.h"
 #include "intel_bufmgr_priv.h"
@@ -81,9 +83,6 @@
 		fprintf(stderr, __VA_ARGS__);		\
 } while (0)
 
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
-#define MAX2(A, B) ((A) > (B) ? (A) : (B))
-
 static inline int
 atomic_add_unless(int *v, int add, int unless)
 {
diff --git a/src/mesa/drivers/dri/i965/intel_bufmgr_priv.h b/src/mesa/drivers/dri/i965/intel_bufmgr_priv.h
index 58c21982001..26ffd18234a 100644
--- a/src/mesa/drivers/dri/i965/intel_bufmgr_priv.h
+++ b/src/mesa/drivers/dri/i965/intel_bufmgr_priv.h
@@ -285,8 +285,4 @@ struct _drm_bacon_context {
 	struct _drm_bacon_bufmgr *bufmgr;
 };
 
-#define ALIGN(value, alignment)	((value + alignment - 1) & ~(alignment - 1))
-#define ROUND_UP_TO(x, y)	(((x) + (y) - 1) / (y) * (y))
-#define ROUND_UP_TO_MB(x)	ROUND_UP_TO((x), 1024*1024)
-
 #endif /* INTEL_BUFMGR_PRIV_H */
diff --git a/src/mesa/drivers/dri/i965/libdrm_macros.h b/src/mesa/drivers/dri/i965/libdrm_macros.h
index 7427fb18989..8be103c5b7a 100644
--- a/src/mesa/drivers/dri/i965/libdrm_macros.h
+++ b/src/mesa/drivers/dri/i965/libdrm_macros.h
@@ -23,15 +23,7 @@
 #ifndef LIBDRM_LIBDRM_H
 #define LIBDRM_LIBDRM_H
 
-/**
- * Static (compile-time) assertion.
- * Basically, use COND to dimension an array.  If COND is false/zero the
- * array size will be -1 and we'll get a compilation error.
- */
-#define STATIC_ASSERT(COND) \
-   do { \
-      (void) sizeof(char [1 - 2*!(COND)]); \
-   } while (0)
+#include "util/macros.h"
 
 
 #include <sys/mman.h>
-- 
2.12.1



More information about the mesa-dev mailing list