gallium/radeon: add threaded context counter monitoring for HUD
authorMarek Olšák <marek.olsak@amd.com>
Fri, 10 Mar 2017 11:17:20 +0000 (12:17 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 15 May 2017 11:01:33 +0000 (13:01 +0200)
"tc" will be initialized by the next commit.

v2: rename stuff according to v2 changes in u_threaded_context

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (v1)
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
src/gallium/drivers/radeon/r600_pipe_common.h
src/gallium/drivers/radeon/r600_query.c
src/gallium/drivers/radeon/r600_query.h

index f9c9f115b88e719d53471d81982441946343f76e..b17b690faba2cf9748c0a6ee043f56b4e44b1c3f 100644 (file)
@@ -553,6 +553,7 @@ struct r600_common_context {
        unsigned                        last_dirty_tex_counter;
        unsigned                        last_compressed_colortex_counter;
 
+       struct threaded_context         *tc;
        struct u_suballocator           *allocator_zeroed_memory;
        struct slab_child_pool          pool_transfers;
        struct slab_child_pool          pool_transfers_unsync; /* for threaded_context */
index dac9b9cbc6285670387299020c5f3b54fceaf0fb..9878745edc848e7226c3e47ec30b549b4b601b4d 100644 (file)
@@ -133,6 +133,15 @@ static bool r600_query_sw_begin(struct r600_common_context *rctx,
        case R600_QUERY_NUM_L2_WRITEBACKS:
                query->begin_result = rctx->num_L2_writebacks;
                break;
+       case R600_QUERY_TC_OFFLOADED_SLOTS:
+               query->begin_result = rctx->tc ? rctx->tc->num_offloaded_slots : 0;
+               break;
+       case R600_QUERY_TC_DIRECT_SLOTS:
+               query->begin_result = rctx->tc ? rctx->tc->num_direct_slots : 0;
+               break;
+       case R600_QUERY_TC_NUM_SYNCS:
+               query->begin_result = rctx->tc ? rctx->tc->num_syncs : 0;
+               break;
        case R600_QUERY_REQUESTED_VRAM:
        case R600_QUERY_REQUESTED_GTT:
        case R600_QUERY_MAPPED_VRAM:
@@ -260,6 +269,15 @@ static bool r600_query_sw_end(struct r600_common_context *rctx,
        case R600_QUERY_NUM_L2_WRITEBACKS:
                query->end_result = rctx->num_L2_writebacks;
                break;
+       case R600_QUERY_TC_OFFLOADED_SLOTS:
+               query->end_result = rctx->tc ? rctx->tc->num_offloaded_slots : 0;
+               break;
+       case R600_QUERY_TC_DIRECT_SLOTS:
+               query->end_result = rctx->tc ? rctx->tc->num_direct_slots : 0;
+               break;
+       case R600_QUERY_TC_NUM_SYNCS:
+               query->end_result = rctx->tc ? rctx->tc->num_syncs : 0;
+               break;
        case R600_QUERY_REQUESTED_VRAM:
        case R600_QUERY_REQUESTED_GTT:
        case R600_QUERY_MAPPED_VRAM:
@@ -1785,6 +1803,9 @@ static struct pipe_driver_query_info r600_driver_query_list[] = {
        X("num-fb-cache-flushes",       NUM_FB_CACHE_FLUSHES,   UINT64, AVERAGE),
        X("num-L2-invalidates",         NUM_L2_INVALIDATES,     UINT64, AVERAGE),
        X("num-L2-writebacks",          NUM_L2_WRITEBACKS,      UINT64, AVERAGE),
+       X("tc-offloaded-slots",         TC_OFFLOADED_SLOTS,     UINT64, AVERAGE),
+       X("tc-direct-slots",            TC_DIRECT_SLOTS,        UINT64, AVERAGE),
+       X("tc-num-syncs",               TC_NUM_SYNCS,           UINT64, AVERAGE),
        X("CS-thread-busy",             CS_THREAD_BUSY,         UINT64, AVERAGE),
        X("requested-VRAM",             REQUESTED_VRAM,         BYTES, AVERAGE),
        X("requested-GTT",              REQUESTED_GTT,          BYTES, AVERAGE),
index 485bb61b70073d0e86798fd94a89e1dca52404af..cf99d3ab76a2051409e904b315727c19a94f0e11 100644 (file)
@@ -54,6 +54,9 @@ enum {
        R600_QUERY_NUM_FB_CACHE_FLUSHES,
        R600_QUERY_NUM_L2_INVALIDATES,
        R600_QUERY_NUM_L2_WRITEBACKS,
+       R600_QUERY_TC_OFFLOADED_SLOTS,
+       R600_QUERY_TC_DIRECT_SLOTS,
+       R600_QUERY_TC_NUM_SYNCS,
        R600_QUERY_CS_THREAD_BUSY,
        R600_QUERY_REQUESTED_VRAM,
        R600_QUERY_REQUESTED_GTT,