gallium/radeon: add HUD queries for mapped VRAM/GTT
authorMarek Olšák <marek.olsak@amd.com>
Thu, 4 Aug 2016 23:38:23 +0000 (01:38 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 9 Aug 2016 23:11:10 +0000 (01:11 +0200)
mainly for monitoring visible VRAM congestion

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeon/r600_query.c
src/gallium/drivers/radeon/r600_query.h

index f6a65a6c22c1da24f91a522076ae3cd52b062de8..87352032ad7e326f31f9e19dfd1f923fe2481f9c 100644 (file)
@@ -51,6 +51,8 @@ static enum radeon_value_id winsys_id_from_type(unsigned type)
        switch (type) {
        case R600_QUERY_REQUESTED_VRAM: return RADEON_REQUESTED_VRAM_MEMORY;
        case R600_QUERY_REQUESTED_GTT: return RADEON_REQUESTED_GTT_MEMORY;
+       case R600_QUERY_MAPPED_VRAM: return RADEON_MAPPED_VRAM;
+       case R600_QUERY_MAPPED_GTT: return RADEON_MAPPED_GTT;
        case R600_QUERY_BUFFER_WAIT_TIME: return RADEON_BUFFER_WAIT_TIME_NS;
        case R600_QUERY_NUM_CS_FLUSHES: return RADEON_NUM_CS_FLUSHES;
        case R600_QUERY_NUM_BYTES_MOVED: return RADEON_NUM_BYTES_MOVED;
@@ -89,6 +91,8 @@ static bool r600_query_sw_begin(struct r600_common_context *rctx,
                break;
        case R600_QUERY_REQUESTED_VRAM:
        case R600_QUERY_REQUESTED_GTT:
+       case R600_QUERY_MAPPED_VRAM:
+       case R600_QUERY_MAPPED_GTT:
        case R600_QUERY_VRAM_USAGE:
        case R600_QUERY_GTT_USAGE:
        case R600_QUERY_GPU_TEMPERATURE:
@@ -154,6 +158,8 @@ static bool r600_query_sw_end(struct r600_common_context *rctx,
                break;
        case R600_QUERY_REQUESTED_VRAM:
        case R600_QUERY_REQUESTED_GTT:
+       case R600_QUERY_MAPPED_VRAM:
+       case R600_QUERY_MAPPED_GTT:
        case R600_QUERY_VRAM_USAGE:
        case R600_QUERY_GTT_USAGE:
        case R600_QUERY_GPU_TEMPERATURE:
@@ -1175,6 +1181,8 @@ static struct pipe_driver_query_info r600_driver_query_list[] = {
        X("dma-calls",                  DMA_CALLS,              UINT64, AVERAGE),
        X("requested-VRAM",             REQUESTED_VRAM,         BYTES, AVERAGE),
        X("requested-GTT",              REQUESTED_GTT,          BYTES, AVERAGE),
+       X("mapped-VRAM",                MAPPED_VRAM,            BYTES, AVERAGE),
+       X("mapped-GTT",                 MAPPED_GTT,             BYTES, AVERAGE),
        X("buffer-wait-time",           BUFFER_WAIT_TIME,       MICROSECONDS, CUMULATIVE),
        X("num-cs-flushes",             NUM_CS_FLUSHES,         UINT64, AVERAGE),
        X("num-bytes-moved",            NUM_BYTES_MOVED,        BYTES, CUMULATIVE),
@@ -1237,10 +1245,12 @@ static int r600_get_driver_query_info(struct pipe_screen *screen,
        switch (info->query_type) {
        case R600_QUERY_REQUESTED_VRAM:
        case R600_QUERY_VRAM_USAGE:
+       case R600_QUERY_MAPPED_VRAM:
                info->max_value.u64 = rscreen->info.vram_size;
                break;
        case R600_QUERY_REQUESTED_GTT:
        case R600_QUERY_GTT_USAGE:
+       case R600_QUERY_MAPPED_GTT:
                info->max_value.u64 = rscreen->info.gart_size;
                break;
        case R600_QUERY_GPU_TEMPERATURE:
index f3c03f592622e8278db86661cd5b199177581f45..7aa684c4dade80fe85ab23c62411fe73c0064d57 100644 (file)
@@ -48,6 +48,8 @@ enum {
        R600_QUERY_DMA_CALLS,
        R600_QUERY_REQUESTED_VRAM,
        R600_QUERY_REQUESTED_GTT,
+       R600_QUERY_MAPPED_VRAM,
+       R600_QUERY_MAPPED_GTT,
        R600_QUERY_BUFFER_WAIT_TIME,
        R600_QUERY_NUM_CS_FLUSHES,
        R600_QUERY_NUM_BYTES_MOVED,