diff options
author | Christian Gmeiner <[email protected]> | 2017-06-09 12:34:49 +0200 |
---|---|---|
committer | Christian Gmeiner <[email protected]> | 2017-06-16 15:28:12 +0200 |
commit | 82db591155ca2f79b522deaa5cd582fa0cf9461f (patch) | |
tree | 72994221550c45f84331f79f7f2b6560f1f48e2e /src/gallium | |
parent | 5065549e2a75e2a56cd3bc8b0fbb6c9013e86cb4 (diff) |
etnaviv: add rs-operations sw query
It could be useful to get the number of emited resolve operations when
doing driver optimizations.
Signed-off-by: Christian Gmeiner <[email protected]>
Reviewed-by: Lucas Stach <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/etnaviv/etnaviv_context.h | 1 | ||||
-rw-r--r-- | src/gallium/drivers/etnaviv/etnaviv_emit.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/etnaviv/etnaviv_query.c | 1 | ||||
-rw-r--r-- | src/gallium/drivers/etnaviv/etnaviv_query.h | 1 | ||||
-rw-r--r-- | src/gallium/drivers/etnaviv/etnaviv_query_sw.c | 3 |
5 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_context.h b/src/gallium/drivers/etnaviv/etnaviv_context.h index 2bb8cf51af2..2c9b24dfd43 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_context.h +++ b/src/gallium/drivers/etnaviv/etnaviv_context.h @@ -174,6 +174,7 @@ struct etna_context { struct { uint64_t prims_emitted; uint64_t draw_calls; + uint64_t rs_operations; } stats; struct pipe_debug_callback debug; diff --git a/src/gallium/drivers/etnaviv/etnaviv_emit.c b/src/gallium/drivers/etnaviv/etnaviv_emit.c index 81aaca96deb..bfff699ad88 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_emit.c +++ b/src/gallium/drivers/etnaviv/etnaviv_emit.c @@ -171,6 +171,8 @@ etna_submit_rs_state(struct etna_context *ctx, struct etna_cmd_stream *stream = ctx->stream; struct etna_coalesce coalesce; + ctx->stats.rs_operations++; + if (screen->specs.pixel_pipes == 1) { etna_cmd_stream_reserve(stream, 22); etna_coalesce_start(stream, &coalesce); diff --git a/src/gallium/drivers/etnaviv/etnaviv_query.c b/src/gallium/drivers/etnaviv/etnaviv_query.c index b33e5804632..617e47562d6 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_query.c +++ b/src/gallium/drivers/etnaviv/etnaviv_query.c @@ -84,6 +84,7 @@ etna_get_driver_query_info(struct pipe_screen *pscreen, unsigned index, struct pipe_driver_query_info list[] = { {"prims-emitted", PIPE_QUERY_PRIMITIVES_EMITTED, { 0 }}, {"draw-calls", ETNA_QUERY_DRAW_CALLS, { 0 }}, + {"rs-operations", ETNA_QUERY_RS_OPERATIONS, { 0 }}, }; if (!info) diff --git a/src/gallium/drivers/etnaviv/etnaviv_query.h b/src/gallium/drivers/etnaviv/etnaviv_query.h index 9a8d579e184..cebd66238e0 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_query.h +++ b/src/gallium/drivers/etnaviv/etnaviv_query.h @@ -54,6 +54,7 @@ etna_query(struct pipe_query *pq) } #define ETNA_QUERY_DRAW_CALLS (PIPE_QUERY_DRIVER_SPECIFIC + 0) +#define ETNA_QUERY_RS_OPERATIONS (PIPE_QUERY_DRIVER_SPECIFIC + 1) void etna_query_screen_init(struct pipe_screen *pscreen); diff --git a/src/gallium/drivers/etnaviv/etnaviv_query_sw.c b/src/gallium/drivers/etnaviv/etnaviv_query_sw.c index d6420d96085..213c61f38b3 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_query_sw.c +++ b/src/gallium/drivers/etnaviv/etnaviv_query_sw.c @@ -50,6 +50,8 @@ read_counter(struct etna_context *ctx, int type) return ctx->stats.prims_emitted; case ETNA_QUERY_DRAW_CALLS: return ctx->stats.draw_calls; + case ETNA_QUERY_RS_OPERATIONS: + return ctx->stats.rs_operations; } return 0; @@ -106,6 +108,7 @@ etna_sw_create_query(struct etna_context *ctx, unsigned query_type) switch (query_type) { case PIPE_QUERY_PRIMITIVES_EMITTED: case ETNA_QUERY_DRAW_CALLS: + case ETNA_QUERY_RS_OPERATIONS: break; default: return NULL; |