Don't hide gpu_metrics behind HAVE_LIBDRM_AMDGPU

xone-gamepad
jackun 2 years ago
parent 93f389dd62
commit a029dfaaf2
No known key found for this signature in database
GPG Key ID: 119DB3F1D05A9ED3

@ -1,5 +1,5 @@
#include "amdgpu.h"
#include "overlay.h"
#include "gpu.h"
#include "cpu.h"
std::string metrics_path = "";

@ -631,14 +631,14 @@ void init_gpu_stats(uint32_t& vendorID, uint32_t reported_deviceID, overlay_para
SPDLOG_DEBUG("using amdgpu path: {}", path);
#ifdef HAVE_LIBDRM_AMDGPU
struct stat buffer;
std::string gpu_metrics_path = path + "/device/gpu_metrics";
if (stat(gpu_metrics_path.c_str(), &buffer) == 0 ){
if (file_exists(gpu_metrics_path)) {
gpu_metrics_exists = true;
metrics_path = gpu_metrics_path;
SPDLOG_DEBUG("Using gpu_metrics");
} else {
}
#ifdef HAVE_LIBDRM_AMDGPU
else {
int idx = -1;
//TODO make neater
int res = sscanf(path.c_str(), "/sys/class/drm/card%d", &idx);

Loading…
Cancel
Save