Module: Mesa
Branch: master
Commit: 895de1d03d5bd0f7a4e46ad5128cdb3a0add7ec1
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=895de1d03d5bd0f7a4e46ad5128cdb3a0add7ec1

Author: Marek Olšák <marek.ol...@amd.com>
Date:   Fri Aug  4 15:26:55 2017 +0200

radeonsi: expose the number of decompress calls to the HUD

Tested-by: Dieter Nützel <die...@nuetzel-hh.de>
Reviewed-by: Nicolai Hähnle <nicolai.haeh...@amd.com>

---

 src/gallium/drivers/radeon/r600_pipe_common.h |  1 +
 src/gallium/drivers/radeon/r600_query.c       |  7 +++++++
 src/gallium/drivers/radeon/r600_query.h       |  1 +
 src/gallium/drivers/radeonsi/si_state_draw.c  | 18 +++++++++++-------
 4 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h 
b/src/gallium/drivers/radeon/r600_pipe_common.h
index 9105875345..67b3c874f4 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.h
+++ b/src/gallium/drivers/radeon/r600_pipe_common.h
@@ -595,6 +595,7 @@ struct r600_common_context {
        unsigned                        num_cs_dw_queries_suspend;
        /* Misc stats. */
        unsigned                        num_draw_calls;
+       unsigned                        num_decompress_calls;
        unsigned                        num_mrt_draw_calls;
        unsigned                        num_prim_restart_calls;
        unsigned                        num_spill_draw_calls;
diff --git a/src/gallium/drivers/radeon/r600_query.c 
b/src/gallium/drivers/radeon/r600_query.c
index 5f1f7128b4..03ea04d48f 100644
--- a/src/gallium/drivers/radeon/r600_query.c
+++ b/src/gallium/drivers/radeon/r600_query.c
@@ -101,6 +101,9 @@ static bool r600_query_sw_begin(struct r600_common_context 
*rctx,
        case R600_QUERY_DRAW_CALLS:
                query->begin_result = rctx->num_draw_calls;
                break;
+       case R600_QUERY_DECOMPRESS_CALLS:
+               query->begin_result = rctx->num_decompress_calls;
+               break;
        case R600_QUERY_MRT_DRAW_CALLS:
                query->begin_result = rctx->num_mrt_draw_calls;
                break;
@@ -258,6 +261,9 @@ static bool r600_query_sw_end(struct r600_common_context 
*rctx,
        case R600_QUERY_DRAW_CALLS:
                query->end_result = rctx->num_draw_calls;
                break;
+       case R600_QUERY_DECOMPRESS_CALLS:
+               query->end_result = rctx->num_decompress_calls;
+               break;
        case R600_QUERY_MRT_DRAW_CALLS:
                query->end_result = rctx->num_mrt_draw_calls;
                break;
@@ -1992,6 +1998,7 @@ static struct pipe_driver_query_info 
r600_driver_query_list[] = {
        X("num-shaders-created",        NUM_SHADERS_CREATED,    UINT64, 
CUMULATIVE),
        X("num-shader-cache-hits",      NUM_SHADER_CACHE_HITS,  UINT64, 
CUMULATIVE),
        X("draw-calls",                 DRAW_CALLS,             UINT64, 
AVERAGE),
+       X("decompress-calls",           DECOMPRESS_CALLS,       UINT64, 
AVERAGE),
        X("MRT-draw-calls",             MRT_DRAW_CALLS,         UINT64, 
AVERAGE),
        X("prim-restart-calls",         PRIM_RESTART_CALLS,     UINT64, 
AVERAGE),
        X("spill-draw-calls",           SPILL_DRAW_CALLS,       UINT64, 
AVERAGE),
diff --git a/src/gallium/drivers/radeon/r600_query.h 
b/src/gallium/drivers/radeon/r600_query.h
index ca27be5c6e..815dc7fc3c 100644
--- a/src/gallium/drivers/radeon/r600_query.h
+++ b/src/gallium/drivers/radeon/r600_query.h
@@ -42,6 +42,7 @@ struct r600_resource;
 
 enum {
        R600_QUERY_DRAW_CALLS = PIPE_QUERY_DRIVER_SPECIFIC,
+       R600_QUERY_DECOMPRESS_CALLS,
        R600_QUERY_MRT_DRAW_CALLS,
        R600_QUERY_PRIM_RESTART_CALLS,
        R600_QUERY_SPILL_DRAW_CALLS,
diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c 
b/src/gallium/drivers/radeonsi/si_state_draw.c
index 605dfdbd0a..9df5b7a588 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.c
+++ b/src/gallium/drivers/radeonsi/si_state_draw.c
@@ -1394,13 +1394,17 @@ void si_draw_vbo(struct pipe_context *ctx, const struct 
pipe_draw_info *info)
                sctx->b.flags |= SI_CONTEXT_VGT_STREAMOUT_SYNC;
        }
 
-       sctx->b.num_draw_calls++;
-       if (sctx->framebuffer.state.nr_cbufs > 1)
-               sctx->b.num_mrt_draw_calls++;
-       if (info->primitive_restart)
-               sctx->b.num_prim_restart_calls++;
-       if (G_0286E8_WAVESIZE(sctx->spi_tmpring_size))
-               sctx->b.num_spill_draw_calls++;
+       if (unlikely(sctx->decompression_enabled)) {
+               sctx->b.num_decompress_calls++;
+       } else {
+               sctx->b.num_draw_calls++;
+               if (sctx->framebuffer.state.nr_cbufs > 1)
+                       sctx->b.num_mrt_draw_calls++;
+               if (info->primitive_restart)
+                       sctx->b.num_prim_restart_calls++;
+               if (G_0286E8_WAVESIZE(sctx->spi_tmpring_size))
+                       sctx->b.num_spill_draw_calls++;
+       }
        if (index_size && indexbuf != info->index.resource)
                pipe_resource_reference(&indexbuf, NULL);
 }

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to