mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-19 16:24:18 +08:00
Resolves: NEO-4718 Change-Id: I0547c109b961c3732e64b6f22ec761a5943c65ef Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
45 lines
878 B
C++
45 lines
878 B
C++
/*
|
|
* Copyright (C) 2019-2020 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#include "shared/source/os_interface/linux/drm_engine_mapper.h"
|
|
|
|
#include "drm_neo.h"
|
|
|
|
#include <fstream>
|
|
|
|
namespace NEO {
|
|
|
|
int Drm::getMaxGpuFrequency(HardwareInfo &hwInfo, int &maxGpuFrequency) {
|
|
maxGpuFrequency = 0;
|
|
std::string clockSysFsPath = getSysFsPciPath();
|
|
|
|
clockSysFsPath += "/gt_max_freq_mhz";
|
|
|
|
std::ifstream ifs(clockSysFsPath.c_str(), std::ifstream::in);
|
|
if (ifs.fail()) {
|
|
return -1;
|
|
}
|
|
|
|
ifs >> maxGpuFrequency;
|
|
ifs.close();
|
|
return 0;
|
|
}
|
|
|
|
bool Drm::queryEngineInfo() {
|
|
return true;
|
|
}
|
|
|
|
bool Drm::queryMemoryInfo() {
|
|
return true;
|
|
}
|
|
|
|
unsigned int Drm::bindDrmContext(uint32_t drmContextId, uint32_t deviceIndex, aub_stream::EngineType engineType) {
|
|
return DrmEngineMapper::engineNodeMap(engineType);
|
|
}
|
|
|
|
} // namespace NEO
|