refactor: move eu per dss topology type detection to separate file

Related-To: NEO-12012


Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2024-08-23 16:28:10 +00:00
committed by Compute-Runtime-Automation
parent 0f310036a0
commit 3e96dcf969
6 changed files with 29 additions and 4 deletions

View File

@@ -11,6 +11,7 @@ set(NEO_CORE_OS_INTERFACE_LINUX_XE
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_xe.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_xe.h
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/ioctl_helper_xe_perf.cpp
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/ioctl_helper_xe_eu_dss.cpp
)
if(NEO_ENABLE_XE_EU_DEBUG_SUPPORT)

View File

@@ -542,11 +542,12 @@ bool IoctlHelperXe::getTopologyDataAndMap(const HardwareInfo &hwInfo, DrmQueryTo
fillMask(computeDss[tileId], topo);
receivedDssInfo = true;
break;
case DRM_XE_TOPO_EU_PER_DSS:
fillMask(euDss[tileId], topo);
break;
default:
xeLog("Unhandle GT Topo type: %d\n", topo->type);
if (isEuPerDssTopologyType(topo->type)) {
fillMask(euDss[tileId], topo);
} else {
xeLog("Unhandle GT Topo type: %d\n", topo->type);
}
}
}

View File

@@ -174,6 +174,7 @@ class IoctlHelperXe : public IoctlHelper {
uint16_t revision;
};
bool queryHwIpVersion(GtIpVersion &gtIpVersion);
static bool isEuPerDssTopologyType(uint16_t topologyType);
int maxExecQueuePriority = 0;
std::mutex xeLock;

View File

@@ -0,0 +1,15 @@
/*
* Copyright (C) 2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/os_interface/linux/xe/ioctl_helper_xe.h"
#include "shared/source/os_interface/linux/xe/xedrm.h"
namespace NEO {
bool IoctlHelperXe::isEuPerDssTopologyType(uint16_t topologyType) {
return topologyType == DRM_XE_TOPO_EU_PER_DSS;
}
} // namespace NEO

View File

@@ -2396,3 +2396,9 @@ TEST_F(IoctlHelperXeHwIpVersionTests, WhenSetupIpVersionIsCalledAndIoctlReturnsN
xeIoctlHelper->setupIpVersion();
EXPECT_EQ(config, hwInfo.ipVersion.value);
}
TEST(IoctlHelperXeTest, givenCorrectEuPerDssTypeWhenCheckingIfTopologyIsEuPerDssThenSuccessIsReturned) {
EXPECT_TRUE(MockIoctlHelperXe::isEuPerDssTopologyType(DRM_XE_TOPO_EU_PER_DSS));
EXPECT_FALSE(MockIoctlHelperXe::isEuPerDssTopologyType(DRM_XE_TOPO_DSS_GEOMETRY));
EXPECT_FALSE(MockIoctlHelperXe::isEuPerDssTopologyType(DRM_XE_TOPO_DSS_COMPUTE));
}

View File

@@ -19,6 +19,7 @@ struct MockIoctlHelperXe : IoctlHelperXe {
using IoctlHelperXe::getFdFromVmExport;
using IoctlHelperXe::ioctl;
using IoctlHelperXe::IoctlHelperXe;
using IoctlHelperXe::isEuPerDssTopologyType;
using IoctlHelperXe::maxContextSetProperties;
using IoctlHelperXe::maxExecQueuePriority;
using IoctlHelperXe::queryGtListData;