diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2013-09-08 17:20:31 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2013-09-08 17:20:31 +0200 |
commit | 2b36e9ad5993c9f73a1c92505b6c806e24c16b7e (patch) | |
tree | 453148dd31fec739896df68abd1b9cfe6d910caf | |
parent | ea7c5aaaf0fb4efb46125856716ee41c636003cf (diff) |
driver: add additional debug flags `flush_all` and `finish_all`
-rw-r--r-- | native/driver/etna_debug.h | 2 | ||||
-rw-r--r-- | native/driver/etna_pipe.c | 12 | ||||
-rw-r--r-- | native/driver/etna_screen.c | 4 |
3 files changed, 17 insertions, 1 deletions
diff --git a/native/driver/etna_debug.h b/native/driver/etna_debug.h index 22b8691..49cc2ef 100644 --- a/native/driver/etna_debug.h +++ b/native/driver/etna_debug.h @@ -42,6 +42,8 @@ #define ETNA_DBG_CFLUSH_ALL 0x2000 /* Flush before every state update + draw call */ #define ETNA_DBG_MSAA_2X 0x4000 /* Force 2X MSAA for screen */ #define ETNA_DBG_MSAA_4X 0x8000 /* Force 4X MSAA for screen */ +#define ETNA_DBG_FINISH_ALL 0x10000 /* Finish on every flush */ +#define ETNA_DBG_FLUSH_ALL 0x20000 /* Flush after every rendered primitive */ extern uint32_t etna_mesa_debug; /* set in etna_screen.c from ETNA_DEBUG */ diff --git a/native/driver/etna_pipe.c b/native/driver/etna_pipe.c index ac74f6d..ed17941 100644 --- a/native/driver/etna_pipe.c +++ b/native/driver/etna_pipe.c @@ -780,6 +780,10 @@ static void etna_pipe_draw_vbo(struct pipe_context *pipe, etna_draw_primitives(priv->ctx, translate_draw_mode(info->mode), info->start, prims); } + if(DBG_ENABLED(ETNA_DBG_FLUSH_ALL)) + { + pipe->flush(pipe, NULL, 0); + } } /** Create vertex element states, which define a layout for fetching @@ -1175,6 +1179,14 @@ static void etna_pipe_flush(struct pipe_context *pipe, { printf("Error: %s: etna_flush failed, GPU may be in unpredictable state\n", __func__); } + if(DBG_ENABLED(ETNA_DBG_FINISH_ALL)) + { + if(etna_finish(priv->ctx) != ETNA_OK) + { + printf("Error: %s: etna_finish failed, GPU may be in unpredictable state\n", __func__); + abort(); + } + } } static void etna_pipe_set_clip_state(struct pipe_context *pipe, const struct pipe_clip_state *pcs) diff --git a/native/driver/etna_screen.c b/native/driver/etna_screen.c index c981941..54e9953 100644 --- a/native/driver/etna_screen.c +++ b/native/driver/etna_screen.c @@ -60,7 +60,9 @@ static void etna_set_debug_flags(const char *str) { "no_ts", ETNA_DBG_NO_TS }, { "cflush_all", ETNA_DBG_CFLUSH_ALL }, { "msaa2x", ETNA_DBG_MSAA_2X }, - { "msaa4x", ETNA_DBG_MSAA_4X } + { "msaa4x", ETNA_DBG_MSAA_4X }, + { "finish_all", ETNA_DBG_FINISH_ALL }, + { "flush_all", ETNA_DBG_FLUSH_ALL } }; int i; |