summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk@arm.linux.org.uk>2015-06-20 15:30:56 +0100
committerRussell King <rmk@arm.linux.org.uk>2015-06-29 12:58:38 +0100
commit12253e547fb5362f672ed75a5e772f5d05a6de77 (patch)
tree079899608b477ea86e87c90a15ae9e6e4feee150
parentf5b4fa2132dc5b350e25ac3376f0f759ebe8eec7 (diff)
etnaviv: move batch building macros into etnaviv_op.c
Move the batch building macros into etnaviv_op.c, which is the only place they're used. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
-rw-r--r--etnaviv/etnaviv_accel.h81
-rw-r--r--etnaviv/etnaviv_op.c81
2 files changed, 81 insertions, 81 deletions
diff --git a/etnaviv/etnaviv_accel.h b/etnaviv/etnaviv_accel.h
index 83d5c2e..f9b5436 100644
--- a/etnaviv/etnaviv_accel.h
+++ b/etnaviv/etnaviv_accel.h
@@ -169,87 +169,6 @@ struct etnaviv_usermem_node {
void etnaviv_add_freemem(struct etnaviv *etnaviv,
struct etnaviv_usermem_node *n);
-#define BATCH_SETUP_START(etp) \
- do { \
- struct etnaviv *_et = etp; \
- _et->batch_setup_size = 0; \
- _et->batch_size = 0; \
- _et->reloc_size = 0; \
- } while (0)
-
-#define BATCH_SETUP_END(etp) \
- do { \
- struct etnaviv *__et = etp; \
- __et->batch_setup_size = __et->batch_size; \
- __et->reloc_setup_size = __et->reloc_size; \
- } while (0)
-
-#define BATCH_OP_START(etp) \
- do { \
- struct etnaviv *__et = etp; \
- __et->batch_size = __et->batch_setup_size; \
- __et->reloc_size = __et->reloc_setup_size; \
- } while (0)
-
-#define EMIT(etp, val) \
- do { \
- struct etnaviv *_et = etp; \
- assert(_et->batch_size < MAX_BATCH_SIZE); \
- _et->batch[_et->batch_size++] = val; \
- } while (0)
-
-#define EMIT_RELOC(etp, _bo, _off, _wr) \
- do { \
- struct etnaviv *__et = etp; \
- struct etnaviv_reloc *r = &__et->reloc[__et->reloc_size++]; \
- r->bo = _bo; \
- r->batch_index = __et->batch_size; \
- r->write = _wr; \
- EMIT(__et, _off); \
- } while (0)
-
-#define EMIT_LOADSTATE(etp, st, num) \
- do { \
- struct etnaviv *__et = etp; \
- assert(!(__et->batch_size & 1)); \
- EMIT(__et, VIV_FE_LOAD_STATE_HEADER_OP_LOAD_STATE | \
- VIV_FE_LOAD_STATE_HEADER_COUNT(num) | \
- VIV_FE_LOAD_STATE_HEADER_OFFSET((st) >> 2)); \
- } while (0)
-
-#define EMIT_DRAW_2D(etp, count) \
- do { \
- struct etnaviv *__et = etp; \
- assert(!(__et->batch_size & 1)); \
- EMIT(__et, VIV_FE_DRAW_2D_HEADER_OP_DRAW_2D | \
- VIV_FE_DRAW_2D_HEADER_COUNT(count)); \
- /* next word is unused */ \
- __et->batch_size ++; \
- } while (0)
-
-#define EMIT_STALL(etp, from, to) \
- do { \
- struct etnaviv *__et = etp; \
- assert(!(__et->batch_size & 1)); \
- EMIT(__et, VIV_FE_STALL_HEADER_OP_STALL); \
- EMIT(__et, VIV_FE_STALL_TOKEN_FROM(from) | \
- VIV_FE_STALL_TOKEN_TO(to)); \
- } while (0)
-
-#define EMIT_NOP(etp) \
- do { \
- struct etnaviv *__et = etp; \
- assert(!(__et->batch_size & 1)); \
- EMIT(__et, VIV_FE_NOP_HEADER_OP_NOP); \
- EMIT(__et, 0); \
- } while (0)
-
-#define EMIT_ALIGN(etp) \
- do { \
- struct etnaviv *__et = etp; \
- __et->batch_size += __et->batch_size & 1; \
- } while (0)
-
static inline void etnaviv_enable_bugfix(struct etnaviv *etnaviv,
unsigned int bug)
{
diff --git a/etnaviv/etnaviv_op.c b/etnaviv/etnaviv_op.c
index 9ef6b33..b65ee5e 100644
--- a/etnaviv/etnaviv_op.c
+++ b/etnaviv/etnaviv_op.c
@@ -13,6 +13,87 @@
#include <etnaviv/state.xml.h>
#include <etnaviv/state_2d.xml.h>
+#define BATCH_SETUP_START(etp) \
+ do { \
+ struct etnaviv *_et = etp; \
+ _et->batch_setup_size = 0; \
+ _et->batch_size = 0; \
+ _et->reloc_size = 0; \
+ } while (0)
+
+#define BATCH_SETUP_END(etp) \
+ do { \
+ struct etnaviv *__et = etp; \
+ __et->batch_setup_size = __et->batch_size; \
+ __et->reloc_setup_size = __et->reloc_size; \
+ } while (0)
+
+#define BATCH_OP_START(etp) \
+ do { \
+ struct etnaviv *__et = etp; \
+ __et->batch_size = __et->batch_setup_size; \
+ __et->reloc_size = __et->reloc_setup_size; \
+ } while (0)
+
+#define EMIT(etp, val) \
+ do { \
+ struct etnaviv *_et = etp; \
+ assert(_et->batch_size < MAX_BATCH_SIZE); \
+ _et->batch[_et->batch_size++] = val; \
+ } while (0)
+
+#define EMIT_RELOC(etp, _bo, _off, _wr) \
+ do { \
+ struct etnaviv *__et = etp; \
+ struct etnaviv_reloc *r = &__et->reloc[__et->reloc_size++]; \
+ r->bo = _bo; \
+ r->batch_index = __et->batch_size; \
+ r->write = _wr; \
+ EMIT(__et, _off); \
+ } while (0)
+
+#define EMIT_LOADSTATE(etp, st, num) \
+ do { \
+ struct etnaviv *__et = etp; \
+ assert(!(__et->batch_size & 1)); \
+ EMIT(__et, VIV_FE_LOAD_STATE_HEADER_OP_LOAD_STATE | \
+ VIV_FE_LOAD_STATE_HEADER_COUNT(num) | \
+ VIV_FE_LOAD_STATE_HEADER_OFFSET((st) >> 2)); \
+ } while (0)
+
+#define EMIT_DRAW_2D(etp, count) \
+ do { \
+ struct etnaviv *__et = etp; \
+ assert(!(__et->batch_size & 1)); \
+ EMIT(__et, VIV_FE_DRAW_2D_HEADER_OP_DRAW_2D | \
+ VIV_FE_DRAW_2D_HEADER_COUNT(count)); \
+ /* next word is unused */ \
+ __et->batch_size ++; \
+ } while (0)
+
+#define EMIT_STALL(etp, from, to) \
+ do { \
+ struct etnaviv *__et = etp; \
+ assert(!(__et->batch_size & 1)); \
+ EMIT(__et, VIV_FE_STALL_HEADER_OP_STALL); \
+ EMIT(__et, VIV_FE_STALL_TOKEN_FROM(from) | \
+ VIV_FE_STALL_TOKEN_TO(to)); \
+ } while (0)
+
+#define EMIT_NOP(etp) \
+ do { \
+ struct etnaviv *__et = etp; \
+ assert(!(__et->batch_size & 1)); \
+ EMIT(__et, VIV_FE_NOP_HEADER_OP_NOP); \
+ EMIT(__et, 0); \
+ } while (0)
+
+#define EMIT_ALIGN(etp) \
+ do { \
+ struct etnaviv *__et = etp; \
+ __et->batch_size += __et->batch_size & 1; \
+ } while (0)
+
static inline uint32_t etnaviv_src_config(struct etnaviv_format fmt,
Bool relative)
{