Check i915 version at runtime

Related-To: NEO-6510

Check which prelim version is being used.
Select proper IoctlHelper based on that version.
If no version found, switch to upstream instead.

Source of prelim headers:
https://github.com/intel-gpu/drm-uapi-helper


Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
Szymon Morek
2021-12-08 10:10:27 +00:00
committed by Compute-Runtime-Automation
parent abb91a7dae
commit 5a3fd1dc94
28 changed files with 3116 additions and 1133 deletions

View File

@@ -895,4 +895,18 @@ void Drm::setupSystemInfo(HardwareInfo *hwInfo, SystemInfo *sysInfo) {
gtSysInfo->MaxDualSubSlicesSupported = sysInfo->getMaxDualSubSlicesSupported();
}
void Drm::getPrelimVersion(std::string &prelimVersion) {
std::string sysFsPciPath = getSysFsPciPath();
std::string prelimVersionPath = sysFsPciPath + "/prelim_uapi_version";
std::ifstream ifs(prelimVersionPath.c_str(), std::ifstream::in);
if (ifs.fail()) {
prelimVersion = "";
} else {
ifs >> prelimVersion;
}
ifs.close();
}
} // namespace NEO