L0 Win Debugger - fix slice mapping bug

Related-to: LOCI-3429
Signed-off-by: Yates, Brandon <brandon.yates@intel.com>
This commit is contained in:
Yates, Brandon
2022-09-19 20:49:57 +00:00
committed by Compute-Runtime-Automation
parent 645600d141
commit 7dc36ca422
2 changed files with 32 additions and 8 deletions

View File

@@ -153,28 +153,26 @@ void Wddm::setPlatformSupportEvictIfNecessaryFlag(const HwInfoConfig &hwInfoConf
bool Wddm::buildTopologyMapping() {
auto hwInfo = rootDeviceEnvironment.getHardwareInfo();
bool ret = true;
UNRECOVERABLE_IF(hwInfo->gtSystemInfo.MultiTileArchInfo.TileCount > 1);
TopologyMapping mapping;
if (!translateTopologyInfo(mapping)) {
ret = false;
return ret;
PRINT_DEBUGGER_ERROR_LOG("translateTopologyInfo Failed\n", "");
return false;
}
this->topologyMap[0] = mapping;
return ret;
return true;
}
bool Wddm::translateTopologyInfo(TopologyMapping &mapping) {
int sliceCount = 0;
int subSliceCount = 0;
uint32_t dualSubSliceCount = 0;
int euCount = 0;
std::vector<int> sliceIndices;
auto gtSystemInfo = rootDeviceEnvironment.getHardwareInfo()->gtSystemInfo;
sliceIndices.reserve(gtSystemInfo.SliceCount);
for (uint32_t x = 0; x < gtSystemInfo.MaxSlicesSupported; x++) {
for (uint32_t x = 0; x < GT_MAX_SLICE; x++) {
if (!gtSystemInfo.SliceInfo[x].Enabled) {
continue;
}
@@ -191,7 +189,6 @@ bool Wddm::translateTopologyInfo(TopologyMapping &mapping) {
subSliceIndex += 2;
continue;
}
dualSubSliceCount++;
for (uint32_t y = 0; y < GT_MAX_SUBSLICE_PER_DSS; y++) {
subSliceIndex++;
@@ -218,7 +215,7 @@ bool Wddm::translateTopologyInfo(TopologyMapping &mapping) {
if (sliceCount != 1) {
mapping.subsliceIndices.clear();
}
PRINT_DEBUGGER_INFO_LOG("Topology Mapping: sliceCount=%d subSliceCount=%d euCount=%d\n", sliceCount, subSliceCount, euCount);
return (sliceCount && subSliceCount && euCount);
}

View File

@@ -159,6 +159,33 @@ TEST_F(WddmTests, givenDebugFlagForceEvictOnlyIfNecessaryAllValuesThenForceSetti
EXPECT_EQ(1, wddm->forceEvictOnlyIfNecessary);
}
TEST_F(WddmTests, GivengtSystemInfoSliceInfoHasEnabledSlicesAtHigherIndicesThenExpectTopologyMapCreateAndReturnTrue) {
VariableBackup<HardwareInfo> backupHwInfo(defaultHwInfo.get());
defaultHwInfo.get()->gtSystemInfo.MaxSlicesSupported = 2;
defaultHwInfo.get()->gtSystemInfo.SliceCount = 1; // Only one slice enabled
defaultHwInfo.get()->gtSystemInfo.SliceInfo[0].Enabled = false;
defaultHwInfo.get()->gtSystemInfo.SliceInfo[1].Enabled = false;
defaultHwInfo.get()->gtSystemInfo.SliceInfo[2].Enabled = false;
defaultHwInfo.get()->gtSystemInfo.SliceInfo[3].Enabled = true;
defaultHwInfo.get()->gtSystemInfo.SliceInfo[3].DualSubSliceEnabledCount = 1;
defaultHwInfo.get()->gtSystemInfo.SliceInfo[3].DSSInfo[0].Enabled = true;
defaultHwInfo.get()->gtSystemInfo.SliceInfo[3].DSSInfo[0].SubSlice[0].Enabled = true;
defaultHwInfo.get()->gtSystemInfo.SliceInfo[3].DSSInfo[0].SubSlice[0].EuEnabledCount = 4;
defaultHwInfo.get()->gtSystemInfo.SliceInfo[3].DSSInfo[0].SubSlice[1].Enabled = true;
defaultHwInfo.get()->gtSystemInfo.SliceInfo[3].DSSInfo[0].SubSlice[1].EuEnabledCount = 4;
const HardwareInfo *hwInfo = defaultHwInfo.get();
std::unique_ptr<OsLibrary> mockGdiDll(setAdapterInfo(&hwInfo->platform,
&hwInfo->gtSystemInfo,
hwInfo->capabilityTable.gpuAddressSpace));
wddm->rootDeviceEnvironment.executionEnvironment.setDebuggingEnabled();
EXPECT_TRUE(wddm->init());
const auto &topologyMap = wddm->getTopologyMap();
EXPECT_EQ(topologyMap.size(), 1u);
}
TEST_F(WddmTests, GivenProperTopologyDataAndDebugFlagsEnabledWhenInitializingWddmThenExpectTopologyMapCreateAndReturnTrue) {
VariableBackup<HardwareInfo> backupHwInfo(defaultHwInfo.get());
defaultHwInfo.get()->gtSystemInfo.MaxSlicesSupported = 10;