diff options
author | Marek Olšák <[email protected]> | 2017-02-11 21:21:10 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-02-14 21:47:51 +0100 |
commit | b8f3b00742eab6ee1868407b876f69195a51f3b6 (patch) | |
tree | 360a9bda5dfb75f2dbea67063c219f5aa353c85a /src/gallium/drivers/radeon | |
parent | 579ffe81f1365d5cbe785283b2a7f96ccaabafcc (diff) |
gallium/radeon: include SDMA in the GPU load query
Reviewed-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeon')
-rw-r--r-- | src/gallium/drivers/radeon/r600_gpu_load.c | 10 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/r600_pipe_common.h | 3 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeon/r600_gpu_load.c b/src/gallium/drivers/radeon/r600_gpu_load.c index 3b491188fb1..24f54c0e68e 100644 --- a/src/gallium/drivers/radeon/r600_gpu_load.c +++ b/src/gallium/drivers/radeon/r600_gpu_load.c @@ -70,6 +70,8 @@ #define SCRATCH_RAM_BUSY(x) (((x) >> 24) & 0x1) #define CE_BUSY(x) (((x) >> 26) & 0x1) +#define IDENTITY(x) x + #define UPDATE_COUNTER(field, mask) \ do { \ if (mask(value)) \ @@ -82,6 +84,7 @@ static void r600_update_mmio_counters(struct r600_common_screen *rscreen, union r600_mmio_counters *counters) { uint32_t value = 0; + bool gui_busy, sdma_busy = false; /* GRBM_STATUS */ rscreen->ws->read_registers(rscreen->ws, GRBM_STATUS, 1, &value); @@ -100,12 +103,14 @@ static void r600_update_mmio_counters(struct r600_common_screen *rscreen, UPDATE_COUNTER(cp, CP_BUSY); UPDATE_COUNTER(cb, CB_BUSY); UPDATE_COUNTER(gui, GUI_ACTIVE); + gui_busy = GUI_ACTIVE(value); if (rscreen->chip_class >= EVERGREEN) { /* SRBM_STATUS2 */ rscreen->ws->read_registers(rscreen->ws, SRBM_STATUS2, 1, &value); UPDATE_COUNTER(sdma, SDMA_BUSY); + sdma_busy = SDMA_BUSY(value); } if (rscreen->chip_class >= VI) { @@ -120,6 +125,9 @@ static void r600_update_mmio_counters(struct r600_common_screen *rscreen, UPDATE_COUNTER(scratch_ram, SCRATCH_RAM_BUSY); UPDATE_COUNTER(ce, CE_BUSY); } + + value = gui_busy || sdma_busy; + UPDATE_COUNTER(gpu, IDENTITY); } #undef UPDATE_COUNTER @@ -216,7 +224,7 @@ static unsigned busy_index_from_type(struct r600_common_screen *rscreen, { switch (type) { case R600_QUERY_GPU_LOAD: - return BUSY_INDEX(rscreen, gui); + return BUSY_INDEX(rscreen, gpu); case R600_QUERY_GPU_SHADERS_BUSY: return BUSY_INDEX(rscreen, spi); case R600_QUERY_GPU_TA_BUSY: diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h index a01351c93bc..1fe44d9dd84 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.h +++ b/src/gallium/drivers/radeon/r600_pipe_common.h @@ -359,6 +359,9 @@ struct r600_mmio_counter { union r600_mmio_counters { struct { + /* For global GPU load including SDMA. */ + struct r600_mmio_counter gpu; + /* GRBM_STATUS */ struct r600_mmio_counter spi; struct r600_mmio_counter gui; |