diff options
author | Marek Olšák <[email protected]> | 2016-08-18 01:18:14 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2016-08-26 15:50:10 +0200 |
commit | 971ef7518fe06033222b53ea843792d3018c6ab2 (patch) | |
tree | 6a0656a76cf1578283a6519483c26e5e78d6384f /src/gallium/drivers/radeon | |
parent | 7172906c0c5943141cbf23bc15de0aba8e565dae (diff) |
gallium/radeon: add a driver query for AMDGPU_INFO_NUM_EVICTIONS
If the kernel driver doesn't support it, it returns 0.
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeon')
-rw-r--r-- | src/gallium/drivers/radeon/r600_query.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/r600_query.h | 1 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/radeon_winsys.h | 1 |
3 files changed, 8 insertions, 2 deletions
diff --git a/src/gallium/drivers/radeon/r600_query.c b/src/gallium/drivers/radeon/r600_query.c index 5825e8b7add..bd0a9066938 100644 --- a/src/gallium/drivers/radeon/r600_query.c +++ b/src/gallium/drivers/radeon/r600_query.c @@ -56,6 +56,7 @@ static enum radeon_value_id winsys_id_from_type(unsigned type) 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; + case R600_QUERY_NUM_EVICTIONS: return RADEON_NUM_EVICTIONS; case R600_QUERY_VRAM_USAGE: return RADEON_VRAM_USAGE; case R600_QUERY_GTT_USAGE: return RADEON_GTT_USAGE; case R600_QUERY_GPU_TEMPERATURE: return RADEON_GPU_TEMPERATURE; @@ -103,7 +104,8 @@ static bool r600_query_sw_begin(struct r600_common_context *rctx, break; case R600_QUERY_BUFFER_WAIT_TIME: case R600_QUERY_NUM_CS_FLUSHES: - case R600_QUERY_NUM_BYTES_MOVED: { + case R600_QUERY_NUM_BYTES_MOVED: + case R600_QUERY_NUM_EVICTIONS: { enum radeon_value_id ws_id = winsys_id_from_type(query->b.type); query->begin_result = rctx->ws->query_value(rctx->ws, ws_id); break; @@ -167,7 +169,8 @@ static bool r600_query_sw_end(struct r600_common_context *rctx, case R600_QUERY_CURRENT_GPU_MCLK: case R600_QUERY_BUFFER_WAIT_TIME: case R600_QUERY_NUM_CS_FLUSHES: - case R600_QUERY_NUM_BYTES_MOVED: { + case R600_QUERY_NUM_BYTES_MOVED: + case R600_QUERY_NUM_EVICTIONS: { enum radeon_value_id ws_id = winsys_id_from_type(query->b.type); query->end_result = rctx->ws->query_value(rctx->ws, ws_id); break; @@ -1186,6 +1189,7 @@ static struct pipe_driver_query_info r600_driver_query_list[] = { 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), + X("num-evictions", NUM_EVICTIONS, UINT64, CUMULATIVE), X("VRAM-usage", VRAM_USAGE, BYTES, AVERAGE), X("GTT-usage", GTT_USAGE, BYTES, AVERAGE), X("back-buffer-ps-draw-ratio", BACK_BUFFER_PS_DRAW_RATIO, UINT64, AVERAGE), diff --git a/src/gallium/drivers/radeon/r600_query.h b/src/gallium/drivers/radeon/r600_query.h index 7aa684c4dad..0bb7cddabde 100644 --- a/src/gallium/drivers/radeon/r600_query.h +++ b/src/gallium/drivers/radeon/r600_query.h @@ -53,6 +53,7 @@ enum { R600_QUERY_BUFFER_WAIT_TIME, R600_QUERY_NUM_CS_FLUSHES, R600_QUERY_NUM_BYTES_MOVED, + R600_QUERY_NUM_EVICTIONS, R600_QUERY_VRAM_USAGE, R600_QUERY_GTT_USAGE, R600_QUERY_GPU_TEMPERATURE, diff --git a/src/gallium/drivers/radeon/radeon_winsys.h b/src/gallium/drivers/radeon/radeon_winsys.h index f4e37733e2f..741dc99f51b 100644 --- a/src/gallium/drivers/radeon/radeon_winsys.h +++ b/src/gallium/drivers/radeon/radeon_winsys.h @@ -160,6 +160,7 @@ enum radeon_value_id { RADEON_TIMESTAMP, RADEON_NUM_CS_FLUSHES, RADEON_NUM_BYTES_MOVED, + RADEON_NUM_EVICTIONS, RADEON_VRAM_USAGE, RADEON_GTT_USAGE, RADEON_GPU_TEMPERATURE, /* DRM 2.42.0 */ |