diff --git a/shared/source/os_interface/linux/xe/CMakeLists.txt b/shared/source/os_interface/linux/xe/CMakeLists.txt index 812e35cad9..49570600a9 100644 --- a/shared/source/os_interface/linux/xe/CMakeLists.txt +++ b/shared/source/os_interface/linux/xe/CMakeLists.txt @@ -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) diff --git a/shared/source/os_interface/linux/xe/ioctl_helper_xe.cpp b/shared/source/os_interface/linux/xe/ioctl_helper_xe.cpp index 971bb6cef5..d59dd985c6 100644 --- a/shared/source/os_interface/linux/xe/ioctl_helper_xe.cpp +++ b/shared/source/os_interface/linux/xe/ioctl_helper_xe.cpp @@ -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); + } } } diff --git a/shared/source/os_interface/linux/xe/ioctl_helper_xe.h b/shared/source/os_interface/linux/xe/ioctl_helper_xe.h index d27b3f352a..e68dca6f55 100644 --- a/shared/source/os_interface/linux/xe/ioctl_helper_xe.h +++ b/shared/source/os_interface/linux/xe/ioctl_helper_xe.h @@ -174,6 +174,7 @@ class IoctlHelperXe : public IoctlHelper { uint16_t revision; }; bool queryHwIpVersion(GtIpVersion >IpVersion); + static bool isEuPerDssTopologyType(uint16_t topologyType); int maxExecQueuePriority = 0; std::mutex xeLock; diff --git a/shared/source/os_interface/linux/xe/ioctl_helper_xe_eu_dss.cpp b/shared/source/os_interface/linux/xe/ioctl_helper_xe_eu_dss.cpp new file mode 100644 index 0000000000..1a63294278 --- /dev/null +++ b/shared/source/os_interface/linux/xe/ioctl_helper_xe_eu_dss.cpp @@ -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 diff --git a/shared/test/unit_test/os_interface/linux/xe/ioctl_helper_xe_tests.cpp b/shared/test/unit_test/os_interface/linux/xe/ioctl_helper_xe_tests.cpp index e6d2bd8b81..1db7880cca 100644 --- a/shared/test/unit_test/os_interface/linux/xe/ioctl_helper_xe_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/xe/ioctl_helper_xe_tests.cpp @@ -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)); +} diff --git a/shared/test/unit_test/os_interface/linux/xe/mock_ioctl_helper_xe.h b/shared/test/unit_test/os_interface/linux/xe/mock_ioctl_helper_xe.h index 029d6b8ff6..44728e27b0 100644 --- a/shared/test/unit_test/os_interface/linux/xe/mock_ioctl_helper_xe.h +++ b/shared/test/unit_test/os_interface/linux/xe/mock_ioctl_helper_xe.h @@ -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;