diff options
author | Russell King <rmk@arm.linux.org.uk> | 2015-12-28 10:31:39 +0000 |
---|---|---|
committer | Russell King <rmk@arm.linux.org.uk> | 2015-12-29 11:49:10 +0000 |
commit | 28f0c70e2f1d014cdbd6fab82512caed5201b5cc (patch) | |
tree | 2e26ac487409eed23d14a9f47be89b6b290d290d | |
parent | c5e6ba8f0e2ff2efc23bb1840b77bb0af7b1f915 (diff) |
etnaviv: use definitions for workaround batch sizes
Provide and use definitions for the workaround batch sizes, rather than
open-coding these constants.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
-rw-r--r-- | etnaviv/etnaviv_accel.c | 4 | ||||
-rw-r--r-- | etnaviv/etnaviv_accel.h | 7 | ||||
-rw-r--r-- | etnaviv/etnaviv_op.c | 4 |
3 files changed, 11 insertions, 4 deletions
diff --git a/etnaviv/etnaviv_accel.c b/etnaviv/etnaviv_accel.c index 2be63a6..74789e4 100644 --- a/etnaviv/etnaviv_accel.c +++ b/etnaviv/etnaviv_accel.c @@ -1036,7 +1036,7 @@ Bool etnaviv_accel_init(struct etnaviv *etnaviv) * We need room for a flush, semaphore, stall, and 20 NOPs * (46 words.) */ - etnaviv->batch_de_high_watermark = MAX_BATCH_SIZE - (6 + 20 * 2); + etnaviv->batch_de_high_watermark = MAX_BATCH_SIZE - BATCH_WA_FLUSH_SIZE; /* * GC320 at least seems to have a problem with corruption of @@ -1053,7 +1053,7 @@ Bool etnaviv_accel_init(struct etnaviv *etnaviv) etnaviv->gc320_wa_dst = INIT_BLIT_BO(bo, 64, fmt, ZERO_OFFSET); /* reserve some additional batch space */ - etnaviv->batch_de_high_watermark -= 22; + etnaviv->batch_de_high_watermark -= BATCH_WA_GC320_SIZE; etnaviv_enable_bugfix(etnaviv, BUGFIX_SINGLE_BITBLT_DRAW_OP); } diff --git a/etnaviv/etnaviv_accel.h b/etnaviv/etnaviv_accel.h index 9ee3dc9..bc25a75 100644 --- a/etnaviv/etnaviv_accel.h +++ b/etnaviv/etnaviv_accel.h @@ -66,6 +66,13 @@ enum { #define MAX_BATCH_SIZE 1024 #define MAX_RELOC_SIZE 8 +/* The size of the cache flush workaround, non-GC320 case */ +#define BATCH_WA_FLUSH_SIZE (2 + 2 + 2 + 2 * BATCH_WA_FLUSH_NOPS) +#define BATCH_WA_FLUSH_NOPS 20 + +/* The size of the additional blit for GC320 */ +#define BATCH_WA_GC320_SIZE (6 + 6 + 2 + 4 + 4) + struct etnaviv { struct viv_conn *conn; struct etna_ctx *ctx; diff --git a/etnaviv/etnaviv_op.c b/etnaviv/etnaviv_op.c index 0d5c7a7..8d5bf7f 100644 --- a/etnaviv/etnaviv_op.c +++ b/etnaviv/etnaviv_op.c @@ -266,7 +266,7 @@ void etnaviv_de_end(struct etnaviv *etnaviv) } /* Append a flush, semaphore and stall to ensure that the FE */ - EL_START(etnaviv, 46); + EL_START(etnaviv, BATCH_WA_FLUSH_SIZE); EL(LOADSTATE(VIVS_GL_FLUSH_CACHE, 1)); EL(VIVS_GL_FLUSH_CACHE_PE2D); EL(LOADSTATE(VIVS_GL_SEMAPHORE_TOKEN, 1)); @@ -277,7 +277,7 @@ void etnaviv_de_end(struct etnaviv *etnaviv) if (etnaviv->gc320_etna_bo) { int i; - for (i = 0; i < 20; i++) + for (i = 0; i < BATCH_WA_FLUSH_NOPS; i++) EL_NOP(); } EL_END(); |