diff --git a/shared/source/debug_settings/debug_variables_base.inl b/shared/source/debug_settings/debug_variables_base.inl index bd18faa2ee..f4913ceb4b 100644 --- a/shared/source/debug_settings/debug_variables_base.inl +++ b/shared/source/debug_settings/debug_variables_base.inl @@ -31,6 +31,7 @@ DECLARE_DEBUG_VARIABLE(int32_t, ClDeviceGlobalMemSizeAvailablePercent, -1, "Perc DECLARE_DEBUG_VARIABLE(int32_t, SetCommandStreamReceiver, -1, "Set command stream receiver to: 0 - HW, 1 - AUB, 2 - TBX, 3 - HW & AUB, 4 - TBX & AUB, 5 - NULL AUB") DECLARE_DEBUG_VARIABLE(int32_t, TbxPort, 4321, "TCP-IP port of TBX server") DECLARE_DEBUG_VARIABLE(int32_t, HBMSizePerTileInGigabytes, 0, "Size of HBM memory in GigaBytes per tile.") +DECLARE_DEBUG_VARIABLE(int32_t, MaxSubSlicesSupportedOverride, -1, "Value to override MaxSubSlicesSupported") DECLARE_DEBUG_VARIABLE(bool, TbxFrontdoorMode, false, "Set TBX frontdoor mode for read and write memory accesses (the default mode is via backdoor)") DECLARE_DEBUG_VARIABLE(bool, FlattenBatchBufferForAUBDump, false, "Dump multi-level batch buffers to AUB as single, flat batch buffer") DECLARE_DEBUG_VARIABLE(bool, AddPatchInfoCommentsForAUBDump, false, "Dump comments containing allocations and patching information") diff --git a/shared/source/os_interface/device_factory.cpp b/shared/source/os_interface/device_factory.cpp index 0504fc0952..8ad6b43dd2 100644 --- a/shared/source/os_interface/device_factory.cpp +++ b/shared/source/os_interface/device_factory.cpp @@ -97,6 +97,11 @@ bool DeviceFactory::prepareDeviceEnvironmentsForProductFamilyOverride(ExecutionE setHwInfoValuesFromConfig(hwInfoConfig, *hardwareInfo); hardwareInfoSetup[hwInfoConst->platform.eProductFamily](hardwareInfo, true, hwInfoConfig, rootDeviceEnvironment.getReleaseHelper()); + if (debugManager.flags.MaxSubSlicesSupportedOverride.get() > 0) { + hardwareInfo->gtSystemInfo.MaxSubSlicesSupported = debugManager.flags.MaxSubSlicesSupportedOverride.get(); + hardwareInfo->gtSystemInfo.MaxDualSubSlicesSupported = debugManager.flags.MaxSubSlicesSupportedOverride.get(); + } + if (debugManager.flags.BlitterEnableMaskOverride.get() > 0) { hardwareInfo->featureTable.ftrBcsInfo = debugManager.flags.BlitterEnableMaskOverride.get(); } diff --git a/shared/test/common/test_files/igdrcl.config b/shared/test/common/test_files/igdrcl.config index 525a4df5f5..3e9b128a2d 100644 --- a/shared/test/common/test_files/igdrcl.config +++ b/shared/test/common/test_files/igdrcl.config @@ -629,4 +629,5 @@ DirectSubmissionSwitchSemaphoreMode = -1 OverrideTimestampWidth = -1 IgnoreZebinUnknownAttributes = 0 FifoPollInterval = -1 +MaxSubSlicesSupportedOverride = -1 # Please don't edit below this line diff --git a/shared/test/unit_test/os_interface/hw_info_override_tests.cpp b/shared/test/unit_test/os_interface/hw_info_override_tests.cpp index da91f2d47a..7179744263 100644 --- a/shared/test/unit_test/os_interface/hw_info_override_tests.cpp +++ b/shared/test/unit_test/os_interface/hw_info_override_tests.cpp @@ -43,3 +43,17 @@ HWTEST2_F(HwInfoOverrideTest, givenBlitterEnableMaskOverrideWhenPrepareDeviceEnv auto hwInfo = executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo(); EXPECT_EQ(hwInfo->featureTable.ftrBcsInfo, 0x6); } + +TEST_F(HwInfoOverrideTest, givenMaxSubSlicesSupportedOverrideWhenPrepareDeviceEnvironmentsForProductFamilyOverrideThenMaxSubSlicesSupportedValueIsReturned) { + DebugManagerStateRestore stateRestore; + debugManager.flags.MaxSubSlicesSupportedOverride.set(128); + + MockExecutionEnvironment executionEnvironment{}; + + bool success = DeviceFactory::prepareDeviceEnvironmentsForProductFamilyOverride(executionEnvironment); + EXPECT_TRUE(success); + + auto hwInfo = executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo(); + EXPECT_EQ(hwInfo->gtSystemInfo.MaxSubSlicesSupported, 128u); + EXPECT_EQ(hwInfo->gtSystemInfo.MaxDualSubSlicesSupported, 128u); +} \ No newline at end of file