diff options
| -rw-r--r-- | hardinfo/gpu_util.c | 1 | ||||
| -rw-r--r-- | includes/gpu_util.h | 2 | ||||
| -rw-r--r-- | modules/devices/gpu.c | 10 | 
3 files changed, 10 insertions, 3 deletions
| diff --git a/hardinfo/gpu_util.c b/hardinfo/gpu_util.c index 94654eb4..ba72b907 100644 --- a/hardinfo/gpu_util.c +++ b/hardinfo/gpu_util.c @@ -305,6 +305,7 @@ gpud *dt_soc_gpu() {      gpu->dt_opp = dtr_get_opp_range(dt, dt_gpu_path);      if (gpu->dt_opp) {          gpu->khz_max = gpu->dt_opp->khz_max; +        gpu->khz_min = gpu->dt_opp->khz_min;      }      EMPIFNULL(gpu->dt_name);      EMPIFNULL(gpu->dt_status); diff --git a/includes/gpu_util.h b/includes/gpu_util.h index 1eb3c6c4..f053dbc8 100644 --- a/includes/gpu_util.h +++ b/includes/gpu_util.h @@ -35,7 +35,7 @@ typedef struct gpud {      char *vendor_str;      char *device_str;      char *location; -    uint32_t khz_max; +    uint32_t khz_min, khz_max; /* core */      char *drm_dev;      char *sysfs_drm_path; diff --git a/modules/devices/gpu.c b/modules/devices/gpu.c index 75776d7e..48877897 100644 --- a/modules/devices/gpu.c +++ b/modules/devices/gpu.c @@ -129,7 +129,10 @@ static void _gpu_pci_dev(gpud* gpu) {      gchar *freq = g_strdup(_("(Unknown)"));      if (gpu->khz_max > 0) { -        freq = g_strdup_printf("%0.2f %s", (double) gpu->khz_max / 1000, _("MHz")); +        if (gpu->khz_min > 0) +            freq = g_strdup_printf("%0.2f-%0.2f %s", (double) gpu->khz_min / 1000, (double) gpu->khz_max / 1000, _("MHz")); +        else +            freq = g_strdup_printf("%0.2f %s", (double) gpu->khz_max / 1000, _("MHz"));      }      str = g_strdup_printf("[%s]\n" @@ -180,7 +183,10 @@ int _dt_soc_gpu(gpud *gpu) {      if (device == NULL) device = UNKSOC;      gchar *freq = g_strdup(_("(Unknown)"));      if (gpu->khz_max > 0) { -        freq = g_strdup_printf("%0.2f %s", (double) gpu->khz_max / 1000, _("MHz")); +        if (gpu->khz_min > 0) +            freq = g_strdup_printf("%0.2f-%0.2f %s", (double) gpu->khz_min / 1000, (double) gpu->khz_max / 1000, _("MHz")); +        else +            freq = g_strdup_printf("%0.2f %s", (double) gpu->khz_max / 1000, _("MHz"));      }      gchar *key = g_strdup(gpu->id);      gchar *name = (vendor == UNKSOC && device == UNKSOC) | 
