radeonsi: add separate HUD counters for CB and DB cache flushes
authorMarek Olšák <marek.olsak@amd.com>
Wed, 14 Jun 2017 22:29:41 +0000 (00:29 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 21 Jun 2017 23:51:02 +0000 (01:51 +0200)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeon/r600_pipe_common.h
src/gallium/drivers/radeon/r600_query.c
src/gallium/drivers/radeon/r600_query.h
src/gallium/drivers/radeonsi/si_state_draw.c

index 006b795fe29ca292bf5cac8b987d79859417dc8c..310fb57684703bf45337dd1def70643184609ec9 100644 (file)
@@ -595,7 +595,8 @@ struct r600_common_context {
        unsigned                        num_vs_flushes;
        unsigned                        num_ps_flushes;
        unsigned                        num_cs_flushes;
-       unsigned                        num_fb_cache_flushes;
+       unsigned                        num_cb_cache_flushes;
+       unsigned                        num_db_cache_flushes;
        unsigned                        num_L2_invalidates;
        unsigned                        num_L2_writebacks;
        unsigned                        num_resident_handles;
index 8bd94e6a940bd2234f1b248f0ee1a6052cc9ee9b..3308ad82c3d63894933995d4c231a6f0c1ac54de 100644 (file)
@@ -125,8 +125,11 @@ static bool r600_query_sw_begin(struct r600_common_context *rctx,
        case R600_QUERY_NUM_CS_FLUSHES:
                query->begin_result = rctx->num_cs_flushes;
                break;
-       case R600_QUERY_NUM_FB_CACHE_FLUSHES:
-               query->begin_result = rctx->num_fb_cache_flushes;
+       case R600_QUERY_NUM_CB_CACHE_FLUSHES:
+               query->begin_result = rctx->num_cb_cache_flushes;
+               break;
+       case R600_QUERY_NUM_DB_CACHE_FLUSHES:
+               query->begin_result = rctx->num_db_cache_flushes;
                break;
        case R600_QUERY_NUM_L2_INVALIDATES:
                query->begin_result = rctx->num_L2_invalidates;
@@ -270,8 +273,11 @@ static bool r600_query_sw_end(struct r600_common_context *rctx,
        case R600_QUERY_NUM_CS_FLUSHES:
                query->end_result = rctx->num_cs_flushes;
                break;
-       case R600_QUERY_NUM_FB_CACHE_FLUSHES:
-               query->end_result = rctx->num_fb_cache_flushes;
+       case R600_QUERY_NUM_CB_CACHE_FLUSHES:
+               query->end_result = rctx->num_cb_cache_flushes;
+               break;
+       case R600_QUERY_NUM_DB_CACHE_FLUSHES:
+               query->end_result = rctx->num_db_cache_flushes;
                break;
        case R600_QUERY_NUM_L2_INVALIDATES:
                query->end_result = rctx->num_L2_invalidates;
@@ -1837,7 +1843,8 @@ static struct pipe_driver_query_info r600_driver_query_list[] = {
        X("num-vs-flushes",             NUM_VS_FLUSHES,         UINT64, AVERAGE),
        X("num-ps-flushes",             NUM_PS_FLUSHES,         UINT64, AVERAGE),
        X("num-cs-flushes",             NUM_CS_FLUSHES,         UINT64, AVERAGE),
-       X("num-fb-cache-flushes",       NUM_FB_CACHE_FLUSHES,   UINT64, AVERAGE),
+       X("num-CB-cache-flushes",       NUM_CB_CACHE_FLUSHES,   UINT64, AVERAGE),
+       X("num-DB-cache-flushes",       NUM_DB_CACHE_FLUSHES,   UINT64, AVERAGE),
        X("num-L2-invalidates",         NUM_L2_INVALIDATES,     UINT64, AVERAGE),
        X("num-L2-writebacks",          NUM_L2_WRITEBACKS,      UINT64, AVERAGE),
        X("num-resident-handles",       NUM_RESIDENT_HANDLES,   UINT64, AVERAGE),
index 9e6617f342a109dd517e5ad818f96585ab144e87..1f97e115906d666a3763ae6fd608e7cecd01ab2d 100644 (file)
@@ -51,7 +51,8 @@ enum {
        R600_QUERY_NUM_VS_FLUSHES,
        R600_QUERY_NUM_PS_FLUSHES,
        R600_QUERY_NUM_CS_FLUSHES,
-       R600_QUERY_NUM_FB_CACHE_FLUSHES,
+       R600_QUERY_NUM_CB_CACHE_FLUSHES,
+       R600_QUERY_NUM_DB_CACHE_FLUSHES,
        R600_QUERY_NUM_L2_INVALIDATES,
        R600_QUERY_NUM_L2_WRITEBACKS,
        R600_QUERY_NUM_RESIDENT_HANDLES,
index ec564c1a05789a215b05fdc1fa1b18b2233a3724..d039e015cc67a2252e34454e36861187006d87ea 100644 (file)
@@ -861,9 +861,10 @@ void si_emit_cache_flush(struct si_context *sctx)
        uint32_t flush_cb_db = rctx->flags & (SI_CONTEXT_FLUSH_AND_INV_CB |
                                              SI_CONTEXT_FLUSH_AND_INV_DB);
 
-       if (rctx->flags & (SI_CONTEXT_FLUSH_AND_INV_CB |
-                          SI_CONTEXT_FLUSH_AND_INV_DB))
-               sctx->b.num_fb_cache_flushes++;
+       if (rctx->flags & SI_CONTEXT_FLUSH_AND_INV_CB)
+               sctx->b.num_cb_cache_flushes++;
+       if (rctx->flags & SI_CONTEXT_FLUSH_AND_INV_DB)
+               sctx->b.num_db_cache_flushes++;
 
        /* SI has a bug that it always flushes ICACHE and KCACHE if either
         * bit is set. An alternative way is to write SQC_CACHES, but that