Refactor Drm::queryTopology() to take struct

Related-To: NEO-5640

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2021-04-22 20:53:25 +00:00
committed by Compute-Runtime-Automation
parent 495841812f
commit f83b51e628
6 changed files with 109 additions and 29 deletions

View File

@@ -307,33 +307,40 @@ int Drm::getErrno() {
int Drm::setupHardwareInfo(DeviceDescriptor *device, bool setupFeatureTableAndWorkaroundTable) {
HardwareInfo *hwInfo = const_cast<HardwareInfo *>(device->pHwInfo);
int ret;
int sliceTotal;
int subSliceTotal;
int euTotal;
bool status = queryTopology(*hwInfo, sliceTotal, subSliceTotal, euTotal);
Drm::QueryTopologyData topologyData = {};
bool status = queryTopology(*hwInfo, topologyData);
if (!status) {
PRINT_DEBUG_STRING(DebugManager.flags.PrintDebugMessages.get(), stderr, "%s", "WARNING: Topology query failed!\n");
sliceTotal = hwInfo->gtSystemInfo.SliceCount;
topologyData.sliceCount = hwInfo->gtSystemInfo.SliceCount;
ret = getEuTotal(euTotal);
ret = getEuTotal(topologyData.euCount);
if (ret != 0) {
PRINT_DEBUG_STRING(DebugManager.flags.PrintDebugMessages.get(), stderr, "%s", "FATAL: Cannot query EU total parameter!\n");
return ret;
}
ret = getSubsliceTotal(subSliceTotal);
ret = getSubsliceTotal(topologyData.subSliceCount);
if (ret != 0) {
PRINT_DEBUG_STRING(DebugManager.flags.PrintDebugMessages.get(), stderr, "%s", "FATAL: Cannot query subslice total parameter!\n");
return ret;
}
topologyData.maxEuCount = topologyData.euCount;
topologyData.maxSliceCount = topologyData.sliceCount;
topologyData.maxSubSliceCount = topologyData.subSliceCount;
}
hwInfo->gtSystemInfo.SliceCount = static_cast<uint32_t>(sliceTotal);
hwInfo->gtSystemInfo.SubSliceCount = static_cast<uint32_t>(subSliceTotal);
hwInfo->gtSystemInfo.EUCount = static_cast<uint32_t>(euTotal);
hwInfo->gtSystemInfo.SliceCount = static_cast<uint32_t>(topologyData.sliceCount);
hwInfo->gtSystemInfo.SubSliceCount = static_cast<uint32_t>(topologyData.subSliceCount);
hwInfo->gtSystemInfo.EUCount = static_cast<uint32_t>(topologyData.euCount);
hwInfo->gtSystemInfo.MaxSubSlicesSupported = topologyData.maxSubSliceCount;
hwInfo->gtSystemInfo.MaxDualSubSlicesSupported = topologyData.maxSubSliceCount;
hwInfo->gtSystemInfo.MaxSlicesSupported = topologyData.maxSliceCount;
status = querySystemInfo();
if (!status) {