[Intel-gfx] [PATCH v2 5/7] lib/igt_draw: Use igt_bitops
Michel Thierry
michel.thierry at intel.com
Thu Feb 9 18:20:12 UTC 2017
Moving bit operations to the new header file.
v2: rename the args for consistency with the other macros (Joonas)
Reviewed-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
Signed-off-by: Michel Thierry <michel.thierry at intel.com>
---
lib/igt_bitops.h | 1 +
lib/igt_draw.c | 3 +--
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/igt_bitops.h b/lib/igt_bitops.h
index 11e0d8b5..59e8f6ce 100644
--- a/lib/igt_bitops.h
+++ b/lib/igt_bitops.h
@@ -31,6 +31,7 @@
#define BIT_ULL(nr) (1ULL << (nr))
#define BITS_PER_CHAR 8
#define BITS_PER_LONG (sizeof(long)*BITS_PER_CHAR)
+#define BIT_GET(val, nr) (((val) >> (nr)) & 1)
static inline unsigned long __bit__(unsigned long nr)
{
diff --git a/lib/igt_draw.c b/lib/igt_draw.c
index 2b321715..3f81161c 100644
--- a/lib/igt_draw.c
+++ b/lib/igt_draw.c
@@ -28,6 +28,7 @@
#include "drmtest.h"
#include "intel_chipset.h"
+#include "igt_bitops.h"
#include "igt_core.h"
#include "igt_fb.h"
#include "ioctl_wrappers.h"
@@ -96,8 +97,6 @@ const char *igt_draw_get_method_name(enum igt_draw_method method)
}
}
-#define BIT_GET(num, bit) ((num >> bit) & 1)
-
static int swizzle_addr(int addr, int swizzle)
{
int bit6;
--
2.11.0
More information about the Intel-gfx
mailing list