diff options
author | Marek Olšák <[email protected]> | 2015-02-24 01:26:13 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2015-04-28 16:05:45 +0200 |
commit | 6d05396b0047c74d740c53156eda1a8574403498 (patch) | |
tree | 72ef5fdda0559f8c693acd8ebc7f98e85bdbc8fe /src/gallium/winsys | |
parent | 0b8e73a6ae2a77d0e9a7810cca5b181ba5f0893e (diff) |
r600g,radeonsi: add a driver query returning GPU load
Reviewed-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r-- | src/gallium/winsys/radeon/drm/radeon_drm_winsys.c | 16 | ||||
-rw-r--r-- | src/gallium/winsys/radeon/drm/radeon_winsys.h | 3 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c index b3e3cb29429..a6f847f6bd5 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c @@ -582,6 +582,21 @@ static uint64_t radeon_query_value(struct radeon_winsys *rws, return 0; } +static void radeon_read_registers(struct radeon_winsys *rws, + unsigned reg_offset, + unsigned num_registers, uint32_t *out) +{ + struct radeon_drm_winsys *ws = (struct radeon_drm_winsys*)rws; + unsigned i; + + for (i = 0; i < num_registers; i++) { + uint32_t reg = reg_offset + i*4; + + radeon_get_drm_value(ws->fd, RADEON_INFO_READ_REG, "read-reg", ®); + out[i] = reg; + } +} + static unsigned hash_fd(void *key) { int fd = pointer_to_intptr(key); @@ -728,6 +743,7 @@ radeon_drm_winsys_create(int fd, radeon_screen_create_t screen_create) ws->base.surface_init = radeon_drm_winsys_surface_init; ws->base.surface_best = radeon_drm_winsys_surface_best; ws->base.query_value = radeon_query_value; + ws->base.read_registers = radeon_read_registers; radeon_bomgr_init_functions(ws); radeon_drm_cs_init_functions(ws); diff --git a/src/gallium/winsys/radeon/drm/radeon_winsys.h b/src/gallium/winsys/radeon/drm/radeon_winsys.h index 996a2017b07..ee0a9040709 100644 --- a/src/gallium/winsys/radeon/drm/radeon_winsys.h +++ b/src/gallium/winsys/radeon/drm/radeon_winsys.h @@ -589,6 +589,9 @@ struct radeon_winsys { uint64_t (*query_value)(struct radeon_winsys *ws, enum radeon_value_id value); + + void (*read_registers)(struct radeon_winsys *ws, unsigned reg_offset, + unsigned num_registers, uint32_t *out); }; |