diff options
author | Marek Olšák <marek.olsak@amd.com> | 2015-08-02 17:06:17 +0200 |
---|---|---|
committer | Marek Olšák <marek.olsak@amd.com> | 2015-08-06 20:44:36 +0200 |
commit | 6b47b8978101897cc0dab8f2017e3aa25d31582d (patch) | |
tree | 9e7798ef0ed541ff821232c68d8345756264f33b /src/gallium/auxiliary | |
parent | 60159bcfc66a067b50da06f5cabfa20d72e898ed (diff) | |
download | external_mesa3d-6b47b8978101897cc0dab8f2017e3aa25d31582d.zip external_mesa3d-6b47b8978101897cc0dab8f2017e3aa25d31582d.tar.gz external_mesa3d-6b47b8978101897cc0dab8f2017e3aa25d31582d.tar.bz2 |
gallium,hud: add support for Hz units in driver queries
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r-- | src/gallium/auxiliary/hud/hud_context.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/hud/hud_context.c b/src/gallium/auxiliary/hud/hud_context.c index 4631cd3..e10152e 100644 --- a/src/gallium/auxiliary/hud/hud_context.c +++ b/src/gallium/auxiliary/hud/hud_context.c @@ -240,6 +240,8 @@ number_to_human_readable(uint64_t num, enum pipe_driver_query_type type, {"", " k", " M", " G", " T", " P", " E"}; static const char *time_units[] = {" us", " ms", " s"}; /* based on microseconds */ + static const char *hz_units[] = + {" Hz", " KHz", " MHz", " GHz"}; const char *suffix; double divisor = (type == PIPE_DRIVER_QUERY_TYPE_BYTES) ? 1024 : 1000; int unit = 0; @@ -262,6 +264,10 @@ number_to_human_readable(uint64_t num, enum pipe_driver_query_type type, assert(unit < ARRAY_SIZE(byte_units)); suffix = byte_units[unit]; break; + case PIPE_DRIVER_QUERY_TYPE_HZ: + assert(unit < ARRAY_SIZE(hz_units)); + suffix = hz_units[unit]; + break; default: assert(unit < ARRAY_SIZE(metric_units)); suffix = metric_units[unit]; |