ALT Linux Bugzilla
– Attachment 5045 Details for
Bug 26063
Missing aticonfig support patch
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
gkrellm-2.3.5-aticonfig.patch
gkrellm-2.3.5-aticonfig.patch (text/plain), 4.06 KB, created by
Konstantin A Lepikhov (L.A. Kostis)
on 2011-08-15 00:55:38 MSK
(
hide
)
Description:
gkrellm-2.3.5-aticonfig.patch
Filename:
MIME Type:
Creator:
Konstantin A Lepikhov (L.A. Kostis)
Created:
2011-08-15 00:55:38 MSK
Size:
4.06 KB
patch
obsolete
>diff --git a/gkrellm/src/sysdeps/linux.c b/gkrellm/src/sysdeps/linux.c >index e4ff625..a9a00c6 100644 >--- a/gkrellm/src/sysdeps/linux.c >+++ b/gkrellm/src/sysdeps/linux.c >@@ -2337,14 +2337,15 @@ gkrellm_sys_uptime_init(void) > /* mbmon and hddtemp sensor interfaces are handled in sensors-common.c > */ > #define LIBSENSORS_INTERFACE 1 >-#define THERMAL_INTERFACE 2 >+#define THERMAL_INTERFACE 2 > #define THERMAL_ZONE_INTERFACE 3 > #define NVIDIA_SETTINGS_INTERFACE 4 >-#define NVCLOCK_INTERFACE 5 >-#define IBM_ACPI_INTERFACE 6 >-#define UNINORTH_INTERFACE 7 >-#define WINDFARM_INTERFACE 8 >-#define SYS_THERMAL_INTERFACE 9 >+#define NVCLOCK_INTERFACE 5 >+#define IBM_ACPI_INTERFACE 6 >+#define UNINORTH_INTERFACE 7 >+#define WINDFARM_INTERFACE 8 >+#define ATICONFIG_INTERFACE 9 >+#define SYS_THERMAL_INTERFACE 10 > > #define IBM_ACPI_FAN_FILE "/proc/acpi/ibm/fan" > #define IBM_ACPI_THERMAL "/proc/acpi/ibm/thermal" >@@ -3177,6 +3178,36 @@ gkrellm_sys_sensors_get_temperature(gchar *sensor_path, gint id, > return FALSE; > } > >+ if (interface == ATICONFIG_INTERFACE) >+ { >+#if GLIB_CHECK_VERSION(2,0,0) >+ gchar *args[] = { "aticonfig", "--odgt", "--adapter", sensor_path, NULL }; >+ gchar *output = NULL; >+ gchar *s = NULL; >+ >+ result = g_spawn_sync(NULL, args, NULL, >+ G_SPAWN_SEARCH_PATH | G_SPAWN_STDERR_TO_DEV_NULL, >+ NULL, NULL, &output, NULL, NULL, NULL); >+ >+ if(result && output) >+ { >+ gfloat dummy; >+ >+ if(!temp) >+ temp = &dummy; >+ s = strstr(output, "Sensor"); >+ if (s) >+ result = (sscanf(s,"Sensor %*s Temperature - %f", temp) == 1); >+ else >+ result = FALSE; >+ } >+ >+ g_free(output); >+ return result; >+#else >+ return FALSE; >+#endif >+ } > #ifdef HAVE_LIBSENSORS > if (interface == LIBSENSORS_INTERFACE) > return libsensors_get_value(sensor_path, id, iodev, temp); >@@ -3639,6 +3670,28 @@ sensors_nvclock_ngpus(void) > return n; > } > >+static gint >+sensors_aticonfig_ngpus(void) >+ { >+ gint n = 0, s = 0; >+#if GLIB_CHECK_VERSION(2,0,0) >+ gchar *args[] = { "aticonfig", "--list-adapters", NULL }; >+ gchar *output = NULL; >+ gboolean result; >+ >+ result = g_spawn_sync(NULL, args, NULL, >+ G_SPAWN_SEARCH_PATH | G_SPAWN_STDERR_TO_DEV_NULL, >+ NULL, NULL, &output, NULL, NULL, NULL); >+ >+ if(result && output) >+ n = sscanf(output, "* %d.", &s); >+ g_free(output); >+#endif >+ if (_GK.debug_level & DEBUG_SENSORS) >+ printf("aticonfig gpus = %d\n", n); >+ return n; >+ } >+ > static void > sensors_nvclock_init(gboolean enable) > { >@@ -3830,7 +3883,7 @@ gkrellm_sys_sensors_init(void) > fclose(f); > } > >- /* nvidia-settings GPU core & ambient temperatues >+ /* nvidia-settings/aticonfig GPU core & ambient temperatures > */ > cnt = sensors_nvidia_settings_ngpus(); > ngpus_added = 0; >@@ -3876,7 +3929,6 @@ gkrellm_sys_sensors_init(void) > gkrellm_sensors_sysdep_option("use_nvclock", > _("Use nvclock for NVIDIA GPU temperatures"), > sensors_nvclock_init); >- > id = 0; > /* Try for ambient only for gpu:0 for now */ > if (gkrellm_sys_sensors_get_temperature("GPUAmbientTemp", id, 0, >@@ -3888,6 +3940,43 @@ gkrellm_sys_sensors_init(void) > 1.0, 0.0, NULL, "GPU A"); > } > >+ /* aticonfig temperature display - >+ | it's very simular to nvidia case >+ */ >+ cnt = sensors_aticonfig_ngpus(); >+ ngpus_added = 0; >+ if (cnt < 2) >+ { >+ if (gkrellm_sys_sensors_get_temperature("0", id, 0, >+ ATICONFIG_INTERFACE, NULL)) >+ { >+ gkrellm_sensors_add_sensor(SENSOR_TEMPERATURE, >+ "0", "ATI/AMD GPU Core", >+ id, 0, ATICONFIG_INTERFACE, >+ 1.0, 0.0, NULL, "GPU C"); >+ ++ngpus_added; >+ } >+ } >+ else >+ { >+ for (id = 0; id < cnt; ++id) >+ { >+ sensor_path = g_strdup_printf("%d", id); >+ if (gkrellm_sys_sensors_get_temperature(sensor_path, id, 0, >+ ATICONFIG_INTERFACE, NULL)) >+ { >+ snprintf(id_name, sizeof(id_name), "ATI/AMD GPU:%d Core", id); >+ default_label = g_strdup_printf("GPU:%d", id); >+ gkrellm_sensors_add_sensor(SENSOR_TEMPERATURE, >+ sensor_path, id_name, >+ id, 0, ATICONFIG_INTERFACE, >+ 1.0, 0.0, NULL, default_label); >+ g_free(default_label); >+ ++ngpus_added; >+ } >+ g_free(sensor_path); >+ } >+ } > > /* UNINORTH sensors > */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 26063
: 5045