diff --git a/shared/source/xe2_hpg_core/enable_compiler_product_helper_bmg.cpp b/shared/source/xe2_hpg_core/enable_compiler_product_helper_bmg.cpp index 3d962c3abc..636ad055c2 100644 --- a/shared/source/xe2_hpg_core/enable_compiler_product_helper_bmg.cpp +++ b/shared/source/xe2_hpg_core/enable_compiler_product_helper_bmg.cpp @@ -15,6 +15,7 @@ #include "shared/source/helpers/compiler_product_helper_xe_hpc_and_later.inl" #include "platforms.h" +#include "wmtp_setup_bmg.inl" namespace NEO { template <> @@ -22,6 +23,11 @@ uint32_t CompilerProductHelperHw::getDefaultHwIpVersion() const { return AOT::BMG_G21_B0; } +template <> +bool CompilerProductHelperHw::isMidThreadPreemptionSupported(const HardwareInfo &hwInfo) const { + return hwInfo.featureTable.flags.ftrWalkerMTP && wmtpSupported; +} + static EnableCompilerProductHelper enableCompilerProductHelperBMG; } // namespace NEO diff --git a/shared/source/xe2_hpg_core/enable_compiler_product_helper_lnl.cpp b/shared/source/xe2_hpg_core/enable_compiler_product_helper_lnl.cpp index a2863dbaf3..39ae2e8693 100644 --- a/shared/source/xe2_hpg_core/enable_compiler_product_helper_lnl.cpp +++ b/shared/source/xe2_hpg_core/enable_compiler_product_helper_lnl.cpp @@ -15,6 +15,7 @@ #include "shared/source/helpers/compiler_product_helper_xe_hpc_and_later.inl" #include "platforms.h" +#include "wmtp_setup_lnl.inl" namespace NEO { template <> @@ -22,6 +23,11 @@ uint32_t CompilerProductHelperHw::getDefaultHwIpVersion() const return AOT::LNL_B0; } +template <> +bool CompilerProductHelperHw::isMidThreadPreemptionSupported(const HardwareInfo &hwInfo) const { + return hwInfo.featureTable.flags.ftrWalkerMTP && wmtpSupported; +} + static EnableCompilerProductHelper enableCompilerProductHelperLNL; } // namespace NEO diff --git a/shared/source/xe2_hpg_core/linux/product_helper_bmg.cpp b/shared/source/xe2_hpg_core/linux/product_helper_bmg.cpp index b99ff7f226..a28586f30c 100644 --- a/shared/source/xe2_hpg_core/linux/product_helper_bmg.cpp +++ b/shared/source/xe2_hpg_core/linux/product_helper_bmg.cpp @@ -19,8 +19,6 @@ constexpr static auto gfxProduct = IGFX_BMG; #include "shared/source/xe2_hpg_core/bmg/os_agnostic_product_helper_bmg.inl" #include "shared/source/xe2_hpg_core/os_agnostic_product_helper_xe2_hpg_core.inl" -#include "wmtp_setup_bmg.inl" - namespace NEO { #include "shared/source/os_interface/linux/product_helper_xe_hpc_and_later.inl" @@ -29,7 +27,6 @@ int ProductHelperHw::configureHardwareCustom(HardwareInfo *hwInfo, O enableCompression(hwInfo); hwInfo->featureTable.flags.ftr57bGPUAddressing = (hwInfo->capabilityTable.gpuAddressSpace == maxNBitValue(57)); - hwInfo->featureTable.flags.ftrWalkerMTP &= wmtpSupported; enableBlitterOperationsSupport(hwInfo); diff --git a/shared/source/xe2_hpg_core/linux/product_helper_lnl.cpp b/shared/source/xe2_hpg_core/linux/product_helper_lnl.cpp index 7dc9177cdb..97d86a83a5 100644 --- a/shared/source/xe2_hpg_core/linux/product_helper_lnl.cpp +++ b/shared/source/xe2_hpg_core/linux/product_helper_lnl.cpp @@ -20,8 +20,6 @@ constexpr static auto gfxProduct = IGFX_LUNARLAKE; #include "shared/source/xe2_hpg_core/lnl/os_agnostic_product_helper_lnl.inl" #include "shared/source/xe2_hpg_core/os_agnostic_product_helper_xe2_hpg_core.inl" -#include "wmtp_setup_lnl.inl" - namespace NEO { #include "shared/source/os_interface/linux/product_helper_xe_hpc_and_later.inl" @@ -31,7 +29,6 @@ int ProductHelperHw::configureHardwareCustom(HardwareInfo *hwInfo, O enableCompression(hwInfo); hwInfo->featureTable.flags.ftr57bGPUAddressing = (hwInfo->capabilityTable.gpuAddressSpace == maxNBitValue(57)); - hwInfo->featureTable.flags.ftrWalkerMTP &= wmtpSupported; enableBlitterOperationsSupport(hwInfo); diff --git a/shared/test/unit_test/os_interface/linux/product_helper_linux_tests.cpp b/shared/test/unit_test/os_interface/linux/product_helper_linux_tests.cpp index 82deebb7a5..7f828a7c2f 100644 --- a/shared/test/unit_test/os_interface/linux/product_helper_linux_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/product_helper_linux_tests.cpp @@ -8,6 +8,7 @@ #include "shared/test/unit_test/os_interface/linux/product_helper_linux_tests.h" #include "shared/source/command_stream/preemption_mode.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/gfx_core_helper.h" #include "shared/source/os_interface/linux/i915.h" #include "shared/source/os_interface/os_interface.h" @@ -149,7 +150,9 @@ HWTEST_F(MockProductHelperTestLinux, GivenPreemptionDrmEnabledMidThreadOnWhenCon int ret = mockProductHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); EXPECT_EQ(0, ret); - EXPECT_EQ(PreemptionMode::MidThread, outHwInfo.capabilityTable.defaultPreemptionMode); + if (getRootDeviceEnvironment().compilerProductHelper->isMidThreadPreemptionSupported(outHwInfo)) { + EXPECT_EQ(PreemptionMode::MidThread, outHwInfo.capabilityTable.defaultPreemptionMode); + } EXPECT_TRUE(drm->isPreemptionSupported()); } diff --git a/shared/test/unit_test/xe2_hpg_core/bmg/linux/product_helper_tests_bmg_linux.cpp b/shared/test/unit_test/xe2_hpg_core/bmg/linux/product_helper_tests_bmg_linux.cpp index 5df279135c..8046567eb1 100644 --- a/shared/test/unit_test/xe2_hpg_core/bmg/linux/product_helper_tests_bmg_linux.cpp +++ b/shared/test/unit_test/xe2_hpg_core/bmg/linux/product_helper_tests_bmg_linux.cpp @@ -14,7 +14,6 @@ #include "shared/test/unit_test/os_interface/linux/product_helper_linux_tests.h" #include "per_product_test_definitions.h" -#include "wmtp_setup_bmg.inl" using namespace NEO; @@ -33,20 +32,6 @@ BMGTEST_F(BmgProductHelperLinux, WhenConfiguringHwInfoThenZeroIsReturned) { EXPECT_EQ(0, ret); } -BMGTEST_F(BmgProductHelperLinux, whenConfiguringHwInfoThenWmtpFlagIsAdjusted) { - - outHwInfo.featureTable.flags.ftrWalkerMTP = false; - int ret = productHelper->configureHardwareCustom(&outHwInfo, osInterface); - EXPECT_EQ(0, ret); - - EXPECT_FALSE(outHwInfo.featureTable.flags.ftrWalkerMTP); - - outHwInfo.featureTable.flags.ftrWalkerMTP = true; - ret = productHelper->configureHardwareCustom(&outHwInfo, osInterface); - EXPECT_EQ(0, ret); - EXPECT_EQ(wmtpSupported, outHwInfo.featureTable.flags.ftrWalkerMTP); -} - BMGTEST_F(BmgProductHelperLinux, given57bAddressSpaceWhenConfiguringHwInfoThenSetFtrFlag) { outHwInfo.featureTable.flags.ftr57bGPUAddressing = false; diff --git a/shared/test/unit_test/xe2_hpg_core/bmg/product_helper_tests_bmg.cpp b/shared/test/unit_test/xe2_hpg_core/bmg/product_helper_tests_bmg.cpp index beb95f9905..daaa41c258 100644 --- a/shared/test/unit_test/xe2_hpg_core/bmg/product_helper_tests_bmg.cpp +++ b/shared/test/unit_test/xe2_hpg_core/bmg/product_helper_tests_bmg.cpp @@ -17,6 +17,7 @@ #include "aubstream/product_family.h" #include "platforms.h" +#include "wmtp_setup_bmg.inl" using namespace NEO; @@ -92,6 +93,14 @@ BMGTEST_F(BmgProductHelper, givenCompilerProductHelperWhenGetDefaultHwIpVersionT EXPECT_EQ(compilerProductHelper->getDefaultHwIpVersion(), AOT::BMG_G21_B0); } +BMGTEST_F(BmgProductHelper, givenCompilerProductHelperWhenGetMidThreadPreemptionSupportThenCorrectValueIsSet) { + auto hwInfo = *defaultHwInfo; + hwInfo.featureTable.flags.ftrWalkerMTP = false; + EXPECT_FALSE(compilerProductHelper->isMidThreadPreemptionSupported(hwInfo)); + hwInfo.featureTable.flags.ftrWalkerMTP = true; + EXPECT_EQ(wmtpSupported, compilerProductHelper->isMidThreadPreemptionSupported(hwInfo)); +} + BMGTEST_F(BmgProductHelper, givenProductHelperWhenCheckingIsBufferPoolAllocatorSupportedThenCorrectValueIsReturned) { EXPECT_TRUE(productHelper->isBufferPoolAllocatorSupported()); } diff --git a/shared/test/unit_test/xe2_hpg_core/excludes_xe2_hpg_core.cpp b/shared/test/unit_test/xe2_hpg_core/excludes_xe2_hpg_core.cpp index e127d525e6..81e8816e85 100644 --- a/shared/test/unit_test/xe2_hpg_core/excludes_xe2_hpg_core.cpp +++ b/shared/test/unit_test/xe2_hpg_core/excludes_xe2_hpg_core.cpp @@ -36,3 +36,4 @@ HWTEST_EXCLUDE_PRODUCT(CommandEncodeSemaphore, givenIndirectModeSetWhenProgrammi HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenBooleanUncachedWhenCallOverridePatIndexThenProperPatIndexIsReturned, IGFX_XE2_HPG_CORE); HWTEST_EXCLUDE_PRODUCT(GfxCoreHelperTest, whenEncodeAdditionalTimestampOffsetsThenNothingEncoded, IGFX_XE2_HPG_CORE); HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenGetThreadEuRatioForScratchThen8IsReturned, IGFX_XE2_HPG_CORE); +HWTEST_EXCLUDE_PRODUCT(CompilerProductHelperFixture, WhenIsMidThreadPreemptionIsSupportedIsCalledThenCorrectResultIsReturned, IGFX_XE2_HPG_CORE); diff --git a/shared/test/unit_test/xe2_hpg_core/lnl/linux/product_helper_tests_lnl_linux.cpp b/shared/test/unit_test/xe2_hpg_core/lnl/linux/product_helper_tests_lnl_linux.cpp index 5d9b30f72f..4e5276f21a 100644 --- a/shared/test/unit_test/xe2_hpg_core/lnl/linux/product_helper_tests_lnl_linux.cpp +++ b/shared/test/unit_test/xe2_hpg_core/lnl/linux/product_helper_tests_lnl_linux.cpp @@ -14,7 +14,6 @@ #include "shared/test/unit_test/os_interface/linux/product_helper_linux_tests.h" #include "per_product_test_definitions.h" -#include "wmtp_setup_lnl.inl" using namespace NEO; @@ -33,20 +32,6 @@ LNLTEST_F(LnlProductHelperLinux, WhenConfiguringHwInfoThenZeroIsReturned) { EXPECT_EQ(0, ret); } -LNLTEST_F(LnlProductHelperLinux, whenConfiguringHwInfoThenWmtpFlagIsAdjusted) { - - outHwInfo.featureTable.flags.ftrWalkerMTP = false; - int ret = productHelper->configureHardwareCustom(&outHwInfo, osInterface); - EXPECT_EQ(0, ret); - - EXPECT_FALSE(outHwInfo.featureTable.flags.ftrWalkerMTP); - - outHwInfo.featureTable.flags.ftrWalkerMTP = true; - ret = productHelper->configureHardwareCustom(&outHwInfo, osInterface); - EXPECT_EQ(0, ret); - EXPECT_EQ(wmtpSupported, outHwInfo.featureTable.flags.ftrWalkerMTP); -} - LNLTEST_F(LnlProductHelperLinux, given57bAddressSpaceWhenConfiguringHwInfoThenSetFtrFlag) { outHwInfo.featureTable.flags.ftr57bGPUAddressing = false; diff --git a/shared/test/unit_test/xe2_hpg_core/lnl/product_helper_tests_lnl.cpp b/shared/test/unit_test/xe2_hpg_core/lnl/product_helper_tests_lnl.cpp index 719c4cd22b..2447c2196d 100644 --- a/shared/test/unit_test/xe2_hpg_core/lnl/product_helper_tests_lnl.cpp +++ b/shared/test/unit_test/xe2_hpg_core/lnl/product_helper_tests_lnl.cpp @@ -20,6 +20,7 @@ #include "aubstream/product_family.h" #include "platforms.h" +#include "wmtp_setup_lnl.inl" using namespace NEO; @@ -87,6 +88,14 @@ LNLTEST_F(LnlProductHelper, givenCompilerProductHelperWhenGetDefaultHwIpVersionT EXPECT_EQ(compilerProductHelper->getDefaultHwIpVersion(), AOT::LNL_B0); } +LNLTEST_F(LnlProductHelper, givenCompilerProductHelperWhenGetMidThreadPreemptionSupportThenCorrectValueIsSet) { + auto hwInfo = *defaultHwInfo; + hwInfo.featureTable.flags.ftrWalkerMTP = false; + EXPECT_FALSE(compilerProductHelper->isMidThreadPreemptionSupported(hwInfo)); + hwInfo.featureTable.flags.ftrWalkerMTP = true; + EXPECT_EQ(wmtpSupported, compilerProductHelper->isMidThreadPreemptionSupported(hwInfo)); +} + LNLTEST_F(LnlProductHelper, whenCheckPreferredAllocationMethodThenAllocateByKmdIsReturnedExceptTagBufferAndTimestampPacketTagBuffer) { DebugManagerStateRestore restorer; debugManager.flags.AllowDcFlush.set(1);