etnaviv: add rs-operations sw query
authorChristian Gmeiner <christian.gmeiner@gmail.com>
Fri, 9 Jun 2017 10:34:49 +0000 (12:34 +0200)
committerChristian Gmeiner <christian.gmeiner@gmail.com>
Fri, 16 Jun 2017 13:28:12 +0000 (15:28 +0200)
It could be useful to get the number of emited resolve operations when
doing driver optimizations.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
src/gallium/drivers/etnaviv/etnaviv_context.h
src/gallium/drivers/etnaviv/etnaviv_emit.c
src/gallium/drivers/etnaviv/etnaviv_query.c
src/gallium/drivers/etnaviv/etnaviv_query.h
src/gallium/drivers/etnaviv/etnaviv_query_sw.c

index 2bb8cf51af22f14d31c84964f5671168078ffcf0..2c9b24dfd439c1eb1659cd98f4a7588c37ccf5e1 100644 (file)
@@ -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;
index 81aaca96deb33b34c5797d2da3ac57e73fb67f3b..bfff699ad88eca14f11c7e0c77578fee5e123ee2 100644 (file)
@@ -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);
index b33e58046324d9669c9e86ac6b33e1172492655f..617e47562d6c67b48dad81f465635d118ee15cd8 100644 (file)
@@ -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)
index 9a8d579e184667a86341889415b4e2492c097edf..cebd66238e064aaec360f4783f8fa96f71026616 100644 (file)
@@ -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);
index d6420d960855bc3be6acf51db134649a6c0ac253..213c61f38b309e316854b4e52c22bb3035472e1d 100644 (file)
@@ -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;