Skip to content

Commit 491be40

Browse files
fix: disable deferring MOCS on WSL for LNL
Related-To: NEO-14643 Source: e376e73 Signed-off-by: Tomasz Biernacik <[email protected]>
1 parent eecf0b8 commit 491be40

17 files changed

+47
-13
lines changed

opencl/test/unit_test/xe2_hpg_core/copy_engine_tests_xe2_hpg_core.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ XE2_HPG_CORETEST_F(BlitXe2HpgCoreTests, givenBufferWhenProgrammingBltCommandThen
7272
ASSERT_NE(hwParser.cmdList.end(), itorBltCmd);
7373
MEM_COPY *bltCmd = (MEM_COPY *)*itorBltCmd;
7474

75-
if (clDevice->getProductHelper().deferMOCSToPatIndex()) {
75+
if (clDevice->getProductHelper().deferMOCSToPatIndex(clDevice->getRootDeviceEnvironment().isWddmOnLinux())) {
7676
EXPECT_EQ(0u, bltCmd->getDestinationMOCS());
7777
EXPECT_EQ(0u, bltCmd->getSourceMOCS());
7878
} else {

opencl/test/unit_test/xe3_core/copy_engine_tests_xe3_core.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ XE3_CORETEST_F(BlitXe3CoreTests, givenBufferWhenProgrammingBltCommandThenSetMocs
7373
ASSERT_NE(hwParser.cmdList.end(), itorBltCmd);
7474
MEM_COPY *bltCmd = (MEM_COPY *)*itorBltCmd;
7575

76-
if (clDevice->getProductHelper().deferMOCSToPatIndex()) {
76+
if (clDevice->getProductHelper().deferMOCSToPatIndex(clDevice->getRootDeviceEnvironment().isWddmOnLinux())) {
7777
EXPECT_EQ(0u, bltCmd->getDestinationMOCS());
7878
EXPECT_EQ(0u, bltCmd->getSourceMOCS());
7979
} else {

shared/source/gmm_helper/gmm_helper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ uint32_t GmmHelper::getMOCS(uint32_t type) const {
4444
type = GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED;
4545
}
4646

47-
if (this->rootDeviceEnvironment.getProductHelper().deferMOCSToPatIndex()) {
47+
if (this->rootDeviceEnvironment.getProductHelper().deferMOCSToPatIndex(this->rootDeviceEnvironment.isWddmOnLinux())) {
4848
return 0u;
4949
}
5050

shared/source/os_interface/product_helper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ class ProductHelper {
245245
virtual std::optional<GfxMemoryAllocationMethod> getPreferredAllocationMethod(AllocationType allocationType) const = 0;
246246
virtual bool isCachingOnCpuAvailable() const = 0;
247247
virtual bool isNewCoherencyModelSupported() const = 0;
248-
virtual bool deferMOCSToPatIndex() const = 0;
248+
virtual bool deferMOCSToPatIndex(bool isWddmOnLinux) const = 0;
249249
virtual const std::vector<uint32_t> getSupportedLocalDispatchSizes(const HardwareInfo &hwInfo) const = 0;
250250
virtual uint32_t getMaxLocalRegionSize(const HardwareInfo &hwInfo) const = 0;
251251
virtual uint32_t getMaxLocalSubRegionSize(const HardwareInfo &hwInfo) const = 0;

shared/source/os_interface/product_helper_before_xe2.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ bool ProductHelperHw<gfxProduct>::useGemCreateExtInAllocateMemoryByKMD() const {
1515
}
1616

1717
template <PRODUCT_FAMILY gfxProduct>
18-
bool ProductHelperHw<gfxProduct>::deferMOCSToPatIndex() const {
18+
bool ProductHelperHw<gfxProduct>::deferMOCSToPatIndex(bool isWddmOnLinux) const {
1919
return false;
2020
}
2121

shared/source/os_interface/product_helper_hw.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ class ProductHelperHw : public ProductHelper {
183183
std::optional<GfxMemoryAllocationMethod> getPreferredAllocationMethod(AllocationType allocationType) const override;
184184
bool isCachingOnCpuAvailable() const override;
185185
bool isNewCoherencyModelSupported() const override;
186-
bool deferMOCSToPatIndex() const override;
186+
bool deferMOCSToPatIndex(bool isWddmOnLinux) const override;
187187
bool supportReadOnlyAllocations() const override;
188188
const std::vector<uint32_t> getSupportedLocalDispatchSizes(const HardwareInfo &hwInfo) const override;
189189
uint32_t getMaxLocalRegionSize(const HardwareInfo &hwInfo) const override;

shared/source/os_interface/product_helper_xe2_and_later.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ bool ProductHelperHw<gfxProduct>::useGemCreateExtInAllocateMemoryByKMD() const {
1515
}
1616

1717
template <PRODUCT_FAMILY gfxProduct>
18-
bool ProductHelperHw<gfxProduct>::deferMOCSToPatIndex() const {
18+
bool ProductHelperHw<gfxProduct>::deferMOCSToPatIndex(bool isWddmOnLinux) const {
1919
return true;
2020
}
2121

shared/source/xe2_hpg_core/linux/product_helper_lnl.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,10 @@ bool ProductHelperHw<gfxProduct>::isDisableScratchPagesSupported() const {
3434
return true;
3535
}
3636

37+
template <>
38+
bool ProductHelperHw<gfxProduct>::deferMOCSToPatIndex(bool isWddmOnLinux) const {
39+
return !isWddmOnLinux;
40+
}
41+
3742
template class ProductHelperHw<gfxProduct>;
3843
} // namespace NEO

shared/test/common/mocks/mock_product_helper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ bool ProductHelperHw<IGFX_UNKNOWN>::isNewResidencyModelSupported() const {
184184
}
185185

186186
template <>
187-
bool ProductHelperHw<IGFX_UNKNOWN>::deferMOCSToPatIndex() const {
187+
bool ProductHelperHw<IGFX_UNKNOWN>::deferMOCSToPatIndex(bool isWddmOnLinux) const {
188188
return false;
189189
}
190190

shared/test/unit_test/gmm_helper/gmm_helper_tests.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,8 +1226,9 @@ TEST(GmmHelperTest, givenNewCoherencyModelWhenGetMocsThenDeferToPat) {
12261226
GmmHelper::createGmmContextWrapperFunc = GmmClientContext::create<MockGmmClientContext>;
12271227

12281228
MockExecutionEnvironment executionEnvironment{};
1229-
auto gmmHelper = executionEnvironment.rootDeviceEnvironments[0]->getGmmHelper();
1230-
if (!executionEnvironment.rootDeviceEnvironments[0]->getProductHelper().deferMOCSToPatIndex()) {
1229+
auto &rootDeviceEnvironment = executionEnvironment.rootDeviceEnvironments[0];
1230+
auto gmmHelper = rootDeviceEnvironment->getGmmHelper();
1231+
if (!rootDeviceEnvironment->getProductHelper().deferMOCSToPatIndex(rootDeviceEnvironment->isWddmOnLinux())) {
12311232
GTEST_SKIP();
12321233
}
12331234

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,8 @@ BMGTEST_F(BmgProductHelperLinux, WhenGtIsSetupThenGtSystemInfoIsCorrect) {
8686
EXPECT_GT(gtSystemInfo.DualSubSliceCount, 0u);
8787
EXPECT_GT(gtSystemInfo.MaxDualSubSlicesSupported, 0u);
8888
}
89+
90+
BMGTEST_F(BmgProductHelperLinux, givenProductHelperWhenCallDeferMOCSToPatOnWSLThenTrueIsReturned) {
91+
const auto &productHelper = getHelper<ProductHelper>();
92+
EXPECT_TRUE(productHelper.deferMOCSToPatIndex(true));
93+
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,7 @@ BMGTEST_F(BmgProductHelper, whenAdjustScratchSizeThenSizeIsDoubled) {
128128
productHelper->adjustScratchSize(scratchSize);
129129
EXPECT_EQ(initialScratchSize * 2, scratchSize);
130130
}
131+
132+
BMGTEST_F(BmgProductHelper, givenProductHelperWhenCallDeferMOCSToPatOnWSLThenTrueIsReturned) {
133+
EXPECT_TRUE(productHelper->deferMOCSToPatIndex(true));
134+
}

shared/test/unit_test/xe2_hpg_core/gfx_core_helper_tests_xe2_hpg_core.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ XE2_HPG_CORETEST_F(ProductHelperTestXe2HpgCore, givenProductHelperWhenCallIsNewC
702702

703703
XE2_HPG_CORETEST_F(ProductHelperTestXe2HpgCore, givenProductHelperWhenCallDeferMOCSToPatThenTrueIsReturned) {
704704
const auto &productHelper = getHelper<ProductHelper>();
705-
EXPECT_TRUE(productHelper.deferMOCSToPatIndex());
705+
EXPECT_TRUE(productHelper.deferMOCSToPatIndex(false));
706706
}
707707

708708
XE2_HPG_CORETEST_F(ProductHelperTestXe2HpgCore, givenPatIndexWhenCheckIsCoherentAllocationThenReturnProperValue) {

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ LNLTEST_F(LnlProductHelperLinux, givenProductHelperWhenCheckIsCopyBufferRectSpli
6464
EXPECT_TRUE(productHelper->isCopyBufferRectSplitSupported());
6565
}
6666

67+
LNLTEST_F(LnlProductHelperLinux, givenProductHelperWhenCallDeferMOCSToPatOnWSLThenFalseIsReturned) {
68+
const auto &productHelper = getHelper<ProductHelper>();
69+
EXPECT_FALSE(productHelper.deferMOCSToPatIndex(true));
70+
}
71+
6772
using LnlHwInfoLinux = ::testing::Test;
6873

6974
LNLTEST_F(LnlHwInfoLinux, WhenGtIsSetupThenGtSystemInfoIsCorrect) {

shared/test/unit_test/xe2_hpg_core/lnl/windows/product_helper_tests_lnl_windows.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,7 @@ LNLTEST_F(LnlProductHelperWindows, givenOverrideDirectSubmissionTimeoutsCalledTh
8989
EXPECT_EQ(timeout.count(), 2'000);
9090
EXPECT_EQ(maxTimeout.count(), 3'000);
9191
}
92+
93+
LNLTEST_F(LnlProductHelperWindows, givenProductHelperWhenCallDeferMOCSToPatOnWSLThenTrueIsReturned) {
94+
EXPECT_TRUE(productHelper->deferMOCSToPatIndex(true));
95+
}

shared/test/unit_test/xe3_core/gfx_core_helper_xe3_core_tests.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,12 @@ XE3_CORETEST_F(ProductHelperTestXe3Core, givenProductHelperWhenAskingForGlobalFe
702702

703703
XE3_CORETEST_F(ProductHelperTestXe3Core, givenProductHelperWhenCallDeferMOCSToPatThenTrueIsReturned) {
704704
const auto &productHelper = getHelper<ProductHelper>();
705-
EXPECT_TRUE(productHelper.deferMOCSToPatIndex());
705+
EXPECT_TRUE(productHelper.deferMOCSToPatIndex(false));
706+
}
707+
708+
XE3_CORETEST_F(ProductHelperTestXe3Core, givenProductHelperWhenCallDeferMOCSToPatOnWSLThenTrueIsReturned) {
709+
const auto &productHelper = getHelper<ProductHelper>();
710+
EXPECT_TRUE(productHelper.deferMOCSToPatIndex(true));
706711
}
707712

708713
XE3_CORETEST_F(ProductHelperTestXe3Core, givenProductHelperWhenAskingForCooperativeEngineSupportThenReturnFalse) {

shared/test/unit_test/xe_hpg_core/os_agnostic_product_helper_xe_lpg_tests.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,12 @@ HWTEST2_F(XeLpgProductHelperTests, givenProductHelperWhenCallIsNewCoherencyModel
360360

361361
HWTEST2_F(XeLpgProductHelperTests, givenProductHelperWhenCallDeferMOCSToPatThenFalseIsReturned, IsXeLpg) {
362362
const auto &productHelper = getHelper<ProductHelper>();
363-
EXPECT_FALSE(productHelper.deferMOCSToPatIndex());
363+
EXPECT_FALSE(productHelper.deferMOCSToPatIndex(false));
364+
}
365+
366+
HWTEST2_F(XeLpgProductHelperTests, givenProductHelperWhenCallDeferMOCSToPatOnWSLThenFalseIsReturned, IsXeLpg) {
367+
const auto &productHelper = getHelper<ProductHelper>();
368+
EXPECT_FALSE(productHelper.deferMOCSToPatIndex(true));
364369
}
365370

366371
HWTEST2_F(XeLpgProductHelperTests, givenPatIndexWhenCheckIsCoherentAllocationThenReturnProperValue, IsXeLpg) {

0 commit comments

Comments
 (0)