summaryrefslogtreecommitdiff
path: root/retrace
diff options
context:
space:
mode:
authorMark Janes <mark.a.janes@intel.com>2017-10-05 13:56:40 -0700
committerMark Janes <mark.a.janes@intel.com>2017-10-05 13:56:40 -0700
commit67a9ce7dd92ee8c648cdc60b2371163869f5d735 (patch)
tree21bda8ef3e50b483ea2c931b8494c648df3dfffa /retrace
parenta21e1fc3ef168b37b21a9d3027e5f4e3016f8201 (diff)
Retrace: Fix Intel-specific gpu check
The check for pinned gpu clock rates only works for Intel platforms. A defensive check is necessary to enable AMD. suggested-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'retrace')
-rw-r--r--retrace/daemon/glframe_gpu_speed_linux.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/retrace/daemon/glframe_gpu_speed_linux.cpp b/retrace/daemon/glframe_gpu_speed_linux.cpp
index 31ac1e72..ac5f0010 100644
--- a/retrace/daemon/glframe_gpu_speed_linux.cpp
+++ b/retrace/daemon/glframe_gpu_speed_linux.cpp
@@ -47,6 +47,9 @@ glretrace::check_gpu_speed(OnFrameRetrace *callback) {
const int max_rate = atoi(reinterpret_cast<char*>(buf.data()));
fclose(fh);
fh = fopen("/sys/class/drm/card0/gt_min_freq_mhz", "r");
+ if (!fh)
+ // non-intel hardware
+ return;
bytes = fread(buf.data(), 1, 99, fh);
buf[bytes] = '\0';
const int min_rate = atoi(reinterpret_cast<char*>(buf.data()));