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

0 commit comments

Comments
 (0)