diff --git a/shared/source/os_interface/linux/drm_neo.cpp b/shared/source/os_interface/linux/drm_neo.cpp index 82bf6a4a5a..d61e20802b 100644 --- a/shared/source/os_interface/linux/drm_neo.cpp +++ b/shared/source/os_interface/linux/drm_neo.cpp @@ -431,11 +431,20 @@ int Drm::setupHardwareInfo(const DeviceDescriptor *device, bool setupFeatureTabl hwInfo->gtSystemInfo.SubSliceCount = static_cast(topologyData.subSliceCount); hwInfo->gtSystemInfo.DualSubSliceCount = static_cast(topologyData.subSliceCount); hwInfo->gtSystemInfo.EUCount = static_cast(topologyData.euCount); + if (topologyData.maxSubSliceCount > 0) { + hwInfo->gtSystemInfo.MaxSubSlicesSupported = static_cast(topologyData.maxSubSliceCount); + hwInfo->gtSystemInfo.MaxDualSubSlicesSupported = static_cast(topologyData.maxSubSliceCount); + } status = querySystemInfo(); if (status) { setupSystemInfo(hwInfo, systemInfo.get()); + + uint32_t bankCount = (hwInfo->gtSystemInfo.L3BankCount > 0) ? hwInfo->gtSystemInfo.L3BankCount : hwInfo->gtSystemInfo.MaxDualSubSlicesSupported; + + hwInfo->gtSystemInfo.L3CacheSizeInKb = systemInfo->getL3BankSizeInKb() * bankCount; } + device->setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); if (systemInfo) { @@ -891,12 +900,10 @@ void Drm::setupSystemInfo(HardwareInfo *hwInfo, SystemInfo *sysInfo) { gtSysInfo->TotalPsThreadsWindowerRange = sysInfo->getTotalPsThreads(); gtSysInfo->MaxEuPerSubSlice = sysInfo->getMaxEuPerDualSubSlice(); gtSysInfo->MaxSlicesSupported = sysInfo->getMaxSlicesSupported(); - gtSysInfo->MaxSubSlicesSupported = sysInfo->getMaxDualSubSlicesSupported(); - gtSysInfo->MaxDualSubSlicesSupported = sysInfo->getMaxDualSubSlicesSupported(); - - uint32_t bankCount = (hwInfo->gtSystemInfo.L3BankCount > 0) ? hwInfo->gtSystemInfo.L3BankCount : hwInfo->gtSystemInfo.DualSubSliceCount; - - gtSysInfo->L3CacheSizeInKb = sysInfo->getL3BankSizeInKb() * bankCount; + if (sysInfo->getMaxDualSubSlicesSupported() > 0) { + gtSysInfo->MaxSubSlicesSupported = sysInfo->getMaxDualSubSlicesSupported(); + gtSysInfo->MaxDualSubSlicesSupported = sysInfo->getMaxDualSubSlicesSupported(); + } } void Drm::setupCacheInfo(const HardwareInfo &hwInfo) { diff --git a/shared/test/common/os_interface/linux/drm_mock_device_blob.h b/shared/test/common/os_interface/linux/drm_mock_device_blob.h index ee235e841d..e4bdaa69f6 100644 --- a/shared/test/common/os_interface/linux/drm_mock_device_blob.h +++ b/shared/test/common/os_interface/linux/drm_mock_device_blob.h @@ -15,7 +15,7 @@ static constexpr uint32_t dummyDeviceBlobData[] = { 0x01, INTEL_HWCONFIG_MAX_DUAL_SUBSLICES_SUPPORTED, 1, - 0x02, + 0x04, INTEL_HWCONFIG_MAX_NUM_EU_PER_DSS, 1, 0x03, diff --git a/shared/test/unit_test/os_interface/linux/drm_system_info_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_system_info_tests.cpp index edb4a1d69e..de28ff3405 100644 --- a/shared/test/unit_test/os_interface/linux/drm_system_info_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_system_info_tests.cpp @@ -114,8 +114,7 @@ TEST(DrmSystemInfoTest, givenSystemInfoCreatedFromDeviceBlobWhenQueryingSpecific EXPECT_EQ(0x15u, systemInfo.getTotalPsThreads()); EXPECT_EQ(0x03u, systemInfo.getMaxEuPerDualSubSlice()); EXPECT_EQ(0x01u, systemInfo.getMaxSlicesSupported()); - EXPECT_EQ(0x02u, systemInfo.getMaxDualSubSlicesSupported()); - EXPECT_EQ(0x02u, systemInfo.getMaxDualSubSlicesSupported()); + EXPECT_EQ(0x04u, systemInfo.getMaxDualSubSlicesSupported()); EXPECT_EQ(0x17u, systemInfo.getMaxRCS()); EXPECT_EQ(0x18u, systemInfo.getMaxCCS()); EXPECT_EQ(0x2Du, systemInfo.getL3BankSizeInKb()); @@ -193,7 +192,7 @@ TEST(DrmSystemInfoTest, givenZeroBankCountWhenCreatingSystemInfoThenUseDualSubsl EXPECT_EQ(0u, gtSystemInfo.L3BankCount); - uint64_t expectedL3Size = gtSystemInfo.DualSubSliceCount * drm.getSystemInfo()->getL3BankSizeInKb(); + uint64_t expectedL3Size = gtSystemInfo.MaxDualSubSlicesSupported * drm.getSystemInfo()->getL3BankSizeInKb(); uint64_t calculatedL3Size = gtSystemInfo.L3CacheSizeInKb; EXPECT_EQ(expectedL3Size, calculatedL3Size);