Allow to query memory info with prelim ioctl

If prelims are supported, query memory info with
specific ioctl.

Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
Szymon Morek
2021-12-28 15:56:13 +00:00
committed by Compute-Runtime-Automation
parent df2e31dbb0
commit e07b27c0e2
8 changed files with 42 additions and 22 deletions

View File

@@ -930,4 +930,18 @@ void Drm::appendDrmContextFlags(drm_i915_gem_context_create_ext &gcc, bool isDir
}
}
std::vector<uint8_t> Drm::getMemoryRegions() {
return this->query(IoctlHelper::get(this)->getMemRegionsIoctlVal(), DrmQueryItemFlags::empty);
}
bool Drm::queryMemoryInfo() {
auto dataQuery = getMemoryRegions();
if (!dataQuery.empty()) {
auto memRegions = IoctlHelper::get(this)->translateToMemoryRegions(dataQuery);
this->memoryInfo.reset(new MemoryInfo(memRegions));
return true;
}
return false;
}
} // namespace NEO