aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/hud/hud_context.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/hud/hud_context.c')
-rw-r--r--src/gallium/auxiliary/hud/hud_context.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/hud/hud_context.c b/src/gallium/auxiliary/hud/hud_context.c
index a82cdf273e0..34454888831 100644
--- a/src/gallium/auxiliary/hud/hud_context.c
+++ b/src/gallium/auxiliary/hud/hud_context.c
@@ -261,6 +261,7 @@ number_to_human_readable(uint64_t num, uint64_t max_value,
static const char *temperature_units[] = {" C"};
static const char *volt_units[] = {" mV", " V"};
static const char *amp_units[] = {" mA", " A"};
+ static const char *watt_units[] = {" mW", " W"};
const char **units;
unsigned max_unit;
@@ -301,6 +302,10 @@ number_to_human_readable(uint64_t num, uint64_t max_value,
max_unit = ARRAY_SIZE(hz_units)-1;
units = hz_units;
break;
+ case PIPE_DRIVER_QUERY_TYPE_WATTS:
+ max_unit = ARRAY_SIZE(watt_units)-1;
+ units = watt_units;
+ break;
default:
if (max_value == 100) {
max_unit = ARRAY_SIZE(percent_units)-1;
@@ -1067,6 +1072,11 @@ hud_parse_env_var(struct hud_context *hud, const char *env)
SENSORS_CURRENT_CURRENT);
pane->type = PIPE_DRIVER_QUERY_TYPE_AMPS;
}
+ else if (sscanf(name, "sensors_pow_cu-%s", arg_name) == 1) {
+ hud_sensors_temp_graph_install(pane, arg_name,
+ SENSORS_POWER_CURRENT);
+ pane->type = PIPE_DRIVER_QUERY_TYPE_WATTS;
+ }
#endif
else if (strcmp(name, "samples-passed") == 0 &&
has_occlusion_query(hud->pipe->screen)) {