Skip to content

Commit 168ed4a

Browse files
fix: improve reducing wmtp support on Xe2 platforms
don't disable wmtp based on ftr flag, instead use compiler product helper Related-To: NEO-12648 Signed-off-by: Mateusz Jablonski <[email protected]>
1 parent 661de15 commit 168ed4a

10 files changed

+35
-37
lines changed

shared/source/xe2_hpg_core/enable_compiler_product_helper_bmg.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,19 @@
1515
#include "shared/source/helpers/compiler_product_helper_xe_hpc_and_later.inl"
1616

1717
#include "platforms.h"
18+
#include "wmtp_setup_bmg.inl"
1819

1920
namespace NEO {
2021
template <>
2122
uint32_t CompilerProductHelperHw<IGFX_BMG>::getDefaultHwIpVersion() const {
2223
return AOT::BMG_G21_B0;
2324
}
2425

26+
template <>
27+
bool CompilerProductHelperHw<IGFX_BMG>::isMidThreadPreemptionSupported(const HardwareInfo &hwInfo) const {
28+
return hwInfo.featureTable.flags.ftrWalkerMTP && wmtpSupported;
29+
}
30+
2531
static EnableCompilerProductHelper<IGFX_BMG> enableCompilerProductHelperBMG;
2632

2733
} // namespace NEO

shared/source/xe2_hpg_core/enable_compiler_product_helper_lnl.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,19 @@
1515
#include "shared/source/helpers/compiler_product_helper_xe_hpc_and_later.inl"
1616

1717
#include "platforms.h"
18+
#include "wmtp_setup_lnl.inl"
1819

1920
namespace NEO {
2021
template <>
2122
uint32_t CompilerProductHelperHw<IGFX_LUNARLAKE>::getDefaultHwIpVersion() const {
2223
return AOT::LNL_B0;
2324
}
2425

26+
template <>
27+
bool CompilerProductHelperHw<IGFX_LUNARLAKE>::isMidThreadPreemptionSupported(const HardwareInfo &hwInfo) const {
28+
return hwInfo.featureTable.flags.ftrWalkerMTP && wmtpSupported;
29+
}
30+
2531
static EnableCompilerProductHelper<IGFX_LUNARLAKE> enableCompilerProductHelperLNL;
2632

2733
} // namespace NEO

shared/source/xe2_hpg_core/linux/product_helper_bmg.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ constexpr static auto gfxProduct = IGFX_BMG;
1919
#include "shared/source/xe2_hpg_core/bmg/os_agnostic_product_helper_bmg.inl"
2020
#include "shared/source/xe2_hpg_core/os_agnostic_product_helper_xe2_hpg_core.inl"
2121

22-
#include "wmtp_setup_bmg.inl"
23-
2422
namespace NEO {
2523
#include "shared/source/os_interface/linux/product_helper_xe_hpc_and_later.inl"
2624

@@ -29,7 +27,6 @@ int ProductHelperHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, O
2927
enableCompression(hwInfo);
3028

3129
hwInfo->featureTable.flags.ftr57bGPUAddressing = (hwInfo->capabilityTable.gpuAddressSpace == maxNBitValue(57));
32-
hwInfo->featureTable.flags.ftrWalkerMTP &= wmtpSupported;
3330

3431
enableBlitterOperationsSupport(hwInfo);
3532

shared/source/xe2_hpg_core/linux/product_helper_lnl.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ constexpr static auto gfxProduct = IGFX_LUNARLAKE;
2020
#include "shared/source/xe2_hpg_core/lnl/os_agnostic_product_helper_lnl.inl"
2121
#include "shared/source/xe2_hpg_core/os_agnostic_product_helper_xe2_hpg_core.inl"
2222

23-
#include "wmtp_setup_lnl.inl"
24-
2523
namespace NEO {
2624

2725
#include "shared/source/os_interface/linux/product_helper_xe_hpc_and_later.inl"
@@ -31,7 +29,6 @@ int ProductHelperHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, O
3129
enableCompression(hwInfo);
3230

3331
hwInfo->featureTable.flags.ftr57bGPUAddressing = (hwInfo->capabilityTable.gpuAddressSpace == maxNBitValue(57));
34-
hwInfo->featureTable.flags.ftrWalkerMTP &= wmtpSupported;
3532

3633
enableBlitterOperationsSupport(hwInfo);
3734

shared/test/unit_test/os_interface/linux/product_helper_linux_tests.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "shared/test/unit_test/os_interface/linux/product_helper_linux_tests.h"
99

1010
#include "shared/source/command_stream/preemption_mode.h"
11+
#include "shared/source/helpers/compiler_product_helper.h"
1112
#include "shared/source/helpers/gfx_core_helper.h"
1213
#include "shared/source/os_interface/linux/i915.h"
1314
#include "shared/source/os_interface/os_interface.h"
@@ -149,7 +150,9 @@ HWTEST_F(MockProductHelperTestLinux, GivenPreemptionDrmEnabledMidThreadOnWhenCon
149150

150151
int ret = mockProductHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get());
151152
EXPECT_EQ(0, ret);
152-
EXPECT_EQ(PreemptionMode::MidThread, outHwInfo.capabilityTable.defaultPreemptionMode);
153+
if (getRootDeviceEnvironment().compilerProductHelper->isMidThreadPreemptionSupported(outHwInfo)) {
154+
EXPECT_EQ(PreemptionMode::MidThread, outHwInfo.capabilityTable.defaultPreemptionMode);
155+
}
153156
EXPECT_TRUE(drm->isPreemptionSupported());
154157
}
155158

shared/test/unit_test/xe2_hpg_core/bmg/linux/product_helper_tests_bmg_linux.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include "shared/test/unit_test/os_interface/linux/product_helper_linux_tests.h"
1515

1616
#include "per_product_test_definitions.h"
17-
#include "wmtp_setup_bmg.inl"
1817

1918
using namespace NEO;
2019

@@ -33,20 +32,6 @@ BMGTEST_F(BmgProductHelperLinux, WhenConfiguringHwInfoThenZeroIsReturned) {
3332
EXPECT_EQ(0, ret);
3433
}
3534

36-
BMGTEST_F(BmgProductHelperLinux, whenConfiguringHwInfoThenWmtpFlagIsAdjusted) {
37-
38-
outHwInfo.featureTable.flags.ftrWalkerMTP = false;
39-
int ret = productHelper->configureHardwareCustom(&outHwInfo, osInterface);
40-
EXPECT_EQ(0, ret);
41-
42-
EXPECT_FALSE(outHwInfo.featureTable.flags.ftrWalkerMTP);
43-
44-
outHwInfo.featureTable.flags.ftrWalkerMTP = true;
45-
ret = productHelper->configureHardwareCustom(&outHwInfo, osInterface);
46-
EXPECT_EQ(0, ret);
47-
EXPECT_EQ(wmtpSupported, outHwInfo.featureTable.flags.ftrWalkerMTP);
48-
}
49-
5035
BMGTEST_F(BmgProductHelperLinux, given57bAddressSpaceWhenConfiguringHwInfoThenSetFtrFlag) {
5136

5237
outHwInfo.featureTable.flags.ftr57bGPUAddressing = false;

shared/test/unit_test/xe2_hpg_core/bmg/product_helper_tests_bmg.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#include "aubstream/product_family.h"
1919
#include "platforms.h"
20+
#include "wmtp_setup_bmg.inl"
2021

2122
using namespace NEO;
2223

@@ -92,6 +93,14 @@ BMGTEST_F(BmgProductHelper, givenCompilerProductHelperWhenGetDefaultHwIpVersionT
9293
EXPECT_EQ(compilerProductHelper->getDefaultHwIpVersion(), AOT::BMG_G21_B0);
9394
}
9495

96+
BMGTEST_F(BmgProductHelper, givenCompilerProductHelperWhenGetMidThreadPreemptionSupportThenCorrectValueIsSet) {
97+
auto hwInfo = *defaultHwInfo;
98+
hwInfo.featureTable.flags.ftrWalkerMTP = false;
99+
EXPECT_FALSE(compilerProductHelper->isMidThreadPreemptionSupported(hwInfo));
100+
hwInfo.featureTable.flags.ftrWalkerMTP = true;
101+
EXPECT_EQ(wmtpSupported, compilerProductHelper->isMidThreadPreemptionSupported(hwInfo));
102+
}
103+
95104
BMGTEST_F(BmgProductHelper, givenProductHelperWhenCheckingIsBufferPoolAllocatorSupportedThenCorrectValueIsReturned) {
96105
EXPECT_TRUE(productHelper->isBufferPoolAllocatorSupported());
97106
}

shared/test/unit_test/xe2_hpg_core/excludes_xe2_hpg_core.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@ HWTEST_EXCLUDE_PRODUCT(CommandEncodeSemaphore, givenIndirectModeSetWhenProgrammi
3636
HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenBooleanUncachedWhenCallOverridePatIndexThenProperPatIndexIsReturned, IGFX_XE2_HPG_CORE);
3737
HWTEST_EXCLUDE_PRODUCT(GfxCoreHelperTest, whenEncodeAdditionalTimestampOffsetsThenNothingEncoded, IGFX_XE2_HPG_CORE);
3838
HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenGetThreadEuRatioForScratchThen8IsReturned, IGFX_XE2_HPG_CORE);
39+
HWTEST_EXCLUDE_PRODUCT(CompilerProductHelperFixture, WhenIsMidThreadPreemptionIsSupportedIsCalledThenCorrectResultIsReturned, IGFX_XE2_HPG_CORE);

shared/test/unit_test/xe2_hpg_core/lnl/linux/product_helper_tests_lnl_linux.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include "shared/test/unit_test/os_interface/linux/product_helper_linux_tests.h"
1515

1616
#include "per_product_test_definitions.h"
17-
#include "wmtp_setup_lnl.inl"
1817

1918
using namespace NEO;
2019

@@ -33,20 +32,6 @@ LNLTEST_F(LnlProductHelperLinux, WhenConfiguringHwInfoThenZeroIsReturned) {
3332
EXPECT_EQ(0, ret);
3433
}
3534

36-
LNLTEST_F(LnlProductHelperLinux, whenConfiguringHwInfoThenWmtpFlagIsAdjusted) {
37-
38-
outHwInfo.featureTable.flags.ftrWalkerMTP = false;
39-
int ret = productHelper->configureHardwareCustom(&outHwInfo, osInterface);
40-
EXPECT_EQ(0, ret);
41-
42-
EXPECT_FALSE(outHwInfo.featureTable.flags.ftrWalkerMTP);
43-
44-
outHwInfo.featureTable.flags.ftrWalkerMTP = true;
45-
ret = productHelper->configureHardwareCustom(&outHwInfo, osInterface);
46-
EXPECT_EQ(0, ret);
47-
EXPECT_EQ(wmtpSupported, outHwInfo.featureTable.flags.ftrWalkerMTP);
48-
}
49-
5035
LNLTEST_F(LnlProductHelperLinux, given57bAddressSpaceWhenConfiguringHwInfoThenSetFtrFlag) {
5136

5237
outHwInfo.featureTable.flags.ftr57bGPUAddressing = false;

shared/test/unit_test/xe2_hpg_core/lnl/product_helper_tests_lnl.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#include "aubstream/product_family.h"
2222
#include "platforms.h"
23+
#include "wmtp_setup_lnl.inl"
2324

2425
using namespace NEO;
2526

@@ -87,6 +88,14 @@ LNLTEST_F(LnlProductHelper, givenCompilerProductHelperWhenGetDefaultHwIpVersionT
8788
EXPECT_EQ(compilerProductHelper->getDefaultHwIpVersion(), AOT::LNL_B0);
8889
}
8990

91+
LNLTEST_F(LnlProductHelper, givenCompilerProductHelperWhenGetMidThreadPreemptionSupportThenCorrectValueIsSet) {
92+
auto hwInfo = *defaultHwInfo;
93+
hwInfo.featureTable.flags.ftrWalkerMTP = false;
94+
EXPECT_FALSE(compilerProductHelper->isMidThreadPreemptionSupported(hwInfo));
95+
hwInfo.featureTable.flags.ftrWalkerMTP = true;
96+
EXPECT_EQ(wmtpSupported, compilerProductHelper->isMidThreadPreemptionSupported(hwInfo));
97+
}
98+
9099
LNLTEST_F(LnlProductHelper, whenCheckPreferredAllocationMethodThenAllocateByKmdIsReturnedExceptTagBufferAndTimestampPacketTagBuffer) {
91100
DebugManagerStateRestore restorer;
92101
debugManager.flags.AllowDcFlush.set(1);

0 commit comments

Comments
 (0)