Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 311743 Details for
Bug 415931
app-admin/gkrellm patch for ATI radeon temperature support
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
ATI temperature support patch
gkrellm-2.3.5-alt-aticonfig.patch (text/plain), 3.46 KB, created by
Tomasz Golinski
on 2012-05-14 13:26:27 UTC
(
hide
)
Description:
ATI temperature support patch
Filename:
MIME Type:
Creator:
Tomasz Golinski
Created:
2012-05-14 13:26:27 UTC
Size:
3.46 KB
patch
obsolete
>--- src/sysdeps/linux.c >+++ src/sysdeps/linux.c >@@ -2345,6 +2345,7 @@ > #define UNINORTH_INTERFACE 7 > #define WINDFARM_INTERFACE 8 > #define SYS_THERMAL_INTERFACE 9 >+#define ATICONFIG_INTERFACE 10 > > #define IBM_ACPI_FAN_FILE "/proc/acpi/ibm/fan" > #define IBM_ACPI_THERMAL "/proc/acpi/ibm/thermal" >@@ -3092,6 +3093,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); >@@ -3525,6 +3556,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) > { >@@ -3698,7 +3751,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; >@@ -3744,7 +3797,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, >@@ -3756,6 +3808,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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 415931
: 311743