summaryrefslogtreecommitdiffstats
path: root/pts-core/functions/pts-functions_system_parsing.php
diff options
context:
space:
mode:
authorMichael Larabel <michael@phx-laptop.(none)>2008-08-09 21:11:42 -0400
committerMichael Larabel <michael@phx-laptop.(none)>2008-08-09 21:11:42 -0400
commita35aa0be6157abad67dbb19630682cf36ea4860c (patch)
tree98567f15ce2c044f9f91cbf7e067f2190f57d6c4 /pts-core/functions/pts-functions_system_parsing.php
parentb0b2843c1cadc2903df2e5e5f786662e61831cdb (diff)
downloadphoronix-test-suite-upstream-a35aa0be6157abad67dbb19630682cf36ea4860c.tar.gz
phoronix-test-suite-upstream-a35aa0be6157abad67dbb19630682cf36ea4860c.tar.xz
phoronix-test-suite-upstream-a35aa0be6157abad67dbb19630682cf36ea4860c.zip
pts-core: Improve video RAM detection
Diffstat (limited to 'pts-core/functions/pts-functions_system_parsing.php')
-rw-r--r--pts-core/functions/pts-functions_system_parsing.php49
1 files changed, 49 insertions, 0 deletions
diff --git a/pts-core/functions/pts-functions_system_parsing.php b/pts-core/functions/pts-functions_system_parsing.php
index 32c85b5..520f821 100644
--- a/pts-core/functions/pts-functions_system_parsing.php
+++ b/pts-core/functions/pts-functions_system_parsing.php
@@ -382,4 +382,53 @@ function read_ati_extension($attribute)
return $ati_info;
}
+function read_ati_overdrive($attribute, $adapter = 0)
+{
+ $value = -1;
+
+ if($attribute == "Temperature")
+ {
+ $info = shell_exec("aticonfig --adapter=" . $adapter . " --od-gettemperature 2>&1");
+
+ if(($start = strpos($info, "Temperature -")) !== FALSE)
+ {
+ $info = substr($info, $start + 14);
+ $value = substr($info, 0, strpos($info, " C"));
+ }
+ }
+ else
+ {
+ $info = shell_exec("aticonfig --adapter=" . $adapter . " --od-getclocks 2>&1");
+
+ if(strpos($info, "GPU") !== FALSE)
+ {
+ foreach(explode("\n", $info) as $line)
+ {
+ $line_r = explode(":", $line);
+
+ if(count($line_r) == 2)
+ {
+ $od_option = str_replace(" ", "", trim($line_r[0]));
+
+ if($od_option == $attribute)
+ {
+ $od_value = trim($line_r[1]);
+ $od_value = preg_replace("/\s+/", " ", $od_value);
+ $od_value = str_replace(array("%"), "", $od_value);
+
+ $od_value_r = explode(" ", $od_value);
+
+ if(count($od_value_r) == 1)
+ $value = $od_value_r[0];
+ else
+ $value = $od_value_r;
+ }
+ }
+ }
+ }
+ }
+
+ return $value;
+}
+
?>