Re: [Mesa-dev] [PATCH] gallium/hud: fix power sensor readings for amdgpu users

2018-10-30 Thread Marek Olšák
Pushed, thanks!

Marek

On Sat, Oct 27, 2018 at 3:46 AM Andre Heider  wrote:

> amdgpu doesn't use the INPUT but the AVERAGE subfeature:
>
> $ sensors -u
> amdgpu-pci-0100
> Adapter: PCI adapter
> power1:
>   power1_average: 17.233
>   power1_cap: 180.000
>
> Signed-off-by: Andre Heider 
> ---
>  src/gallium/auxiliary/hud/hud_sensors_temp.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/src/gallium/auxiliary/hud/hud_sensors_temp.c
> b/src/gallium/auxiliary/hud/hud_sensors_temp.c
> index c26e7b9b2a..c226e89cc4 100644
> --- a/src/gallium/auxiliary/hud/hud_sensors_temp.c
> +++ b/src/gallium/auxiliary/hud/hud_sensors_temp.c
> @@ -122,6 +122,9 @@ get_sensor_values(struct sensors_temp_info *sti)
> case SENSORS_POWER_CURRENT:
>sf = sensors_get_subfeature(sti->chip, sti->feature,
>SENSORS_SUBFEATURE_POWER_INPUT);
> +  if (!sf)
> +  sf = sensors_get_subfeature(sti->chip, sti->feature,
> +  SENSORS_SUBFEATURE_POWER_AVERAGE);
>if (sf) {
>   /* Sensors API returns in WATTs, even though driver is reporting
> mW,
>* convert back to mW */
> --
> 2.19.1
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] gallium/hud: fix power sensor readings for amdgpu users

2018-10-27 Thread Andre Heider
amdgpu doesn't use the INPUT but the AVERAGE subfeature:

$ sensors -u
amdgpu-pci-0100
Adapter: PCI adapter
power1:
  power1_average: 17.233
  power1_cap: 180.000

Signed-off-by: Andre Heider 
---
 src/gallium/auxiliary/hud/hud_sensors_temp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gallium/auxiliary/hud/hud_sensors_temp.c 
b/src/gallium/auxiliary/hud/hud_sensors_temp.c
index c26e7b9b2a..c226e89cc4 100644
--- a/src/gallium/auxiliary/hud/hud_sensors_temp.c
+++ b/src/gallium/auxiliary/hud/hud_sensors_temp.c
@@ -122,6 +122,9 @@ get_sensor_values(struct sensors_temp_info *sti)
case SENSORS_POWER_CURRENT:
   sf = sensors_get_subfeature(sti->chip, sti->feature,
   SENSORS_SUBFEATURE_POWER_INPUT);
+  if (!sf)
+  sf = sensors_get_subfeature(sti->chip, sti->feature,
+  SENSORS_SUBFEATURE_POWER_AVERAGE);
   if (sf) {
  /* Sensors API returns in WATTs, even though driver is reporting mW,
   * convert back to mW */
-- 
2.19.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev