Skip to content

Commit eec01e5

Browse files
fix: non-coherency issue on arl
Resolves: HSD-15015200338 Signed-off-by: Katarzyna Cencelewska <[email protected]>
1 parent f3bbd70 commit eec01e5

26 files changed

+92
-139
lines changed

shared/source/gmm_helper/cache_settings_helper.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2022-2023 Intel Corporation
2+
* Copyright (C) 2022-2024 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -39,8 +39,8 @@ bool CacheSettingsHelper::preferNoCpuAccess(GMM_RESOURCE_USAGE_TYPE_ENUM gmmReso
3939
if (rootDeviceEnvironment.isWddmOnLinux()) {
4040
return false;
4141
}
42-
auto releaseHelper = rootDeviceEnvironment.getReleaseHelper();
43-
if (!releaseHelper || releaseHelper->isCachingOnCpuAvailable()) {
42+
auto &productHelper = rootDeviceEnvironment.getProductHelper();
43+
if (productHelper.isCachingOnCpuAvailable()) {
4444
return false;
4545
}
4646
return (gmmResourceUsageType != GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER);

shared/source/os_interface/product_helper.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ class OSInterface;
4343
class DriverModel;
4444
enum class DriverModelType;
4545
enum class EngineGroupType : uint32_t;
46+
enum class GfxMemoryAllocationMethod : uint32_t;
47+
enum class AllocationType;
4648

4749
using ProductHelperCreateFunctionType = std::unique_ptr<ProductHelper> (*)();
4850
extern ProductHelperCreateFunctionType productHelperFactory[IGFX_MAX_PRODUCT];
@@ -215,6 +217,8 @@ class ProductHelper {
215217
virtual std::vector<uint32_t> getSupportedNumGrfs(const ReleaseHelper *releaseHelper) const = 0;
216218
virtual aub_stream::EngineType getDefaultCopyEngine() const = 0;
217219
virtual void adjustEngineGroupType(EngineGroupType &engineGroupType) const = 0;
220+
virtual std::optional<GfxMemoryAllocationMethod> getPreferredAllocationMethod(AllocationType allocationType) const = 0;
221+
virtual bool isCachingOnCpuAvailable() const = 0;
218222

219223
virtual ~ProductHelper() = default;
220224

shared/source/os_interface/product_helper.inl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,4 +839,14 @@ aub_stream::EngineType ProductHelperHw<gfxProduct>::getDefaultCopyEngine() const
839839
template <PRODUCT_FAMILY gfxProduct>
840840
void ProductHelperHw<gfxProduct>::adjustEngineGroupType(EngineGroupType &engineGroupType) const {}
841841

842+
template <PRODUCT_FAMILY gfxProduct>
843+
std::optional<GfxMemoryAllocationMethod> ProductHelperHw<gfxProduct>::getPreferredAllocationMethod(AllocationType allocationType) const {
844+
return {};
845+
}
846+
847+
template <PRODUCT_FAMILY gfxProduct>
848+
bool ProductHelperHw<gfxProduct>::isCachingOnCpuAvailable() const {
849+
return true;
850+
}
851+
842852
} // namespace NEO

shared/source/os_interface/product_helper_hw.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ class ProductHelperHw : public ProductHelper {
164164
std::vector<uint32_t> getSupportedNumGrfs(const ReleaseHelper *releaseHelper) const override;
165165
aub_stream::EngineType getDefaultCopyEngine() const override;
166166
void adjustEngineGroupType(EngineGroupType &engineGroupType) const override;
167+
std::optional<GfxMemoryAllocationMethod> getPreferredAllocationMethod(AllocationType allocationType) const override;
168+
bool isCachingOnCpuAvailable() const override;
167169

168170
~ProductHelperHw() override = default;
169171

shared/source/os_interface/windows/wddm_memory_manager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ GfxMemoryAllocationMethod WddmMemoryManager::getPreferredAllocationMethod(const
7979
}
8080
auto rootDeviceEnvironment = executionEnvironment.rootDeviceEnvironments[allocationProperties.rootDeviceIndex].get();
8181
UNRECOVERABLE_IF(!rootDeviceEnvironment);
82-
auto releaseHelper = rootDeviceEnvironment->releaseHelper.get();
83-
auto preference = releaseHelper ? releaseHelper->getPreferredAllocationMethod(allocationProperties.allocationType) : std::nullopt;
82+
auto &productHelper = rootDeviceEnvironment->getHelper<ProductHelper>();
83+
auto preference = productHelper.getPreferredAllocationMethod(allocationProperties.allocationType);
8484
if (preference) {
8585
return *preference;
8686
}

shared/source/release_helper/release_helper.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2023 Intel Corporation
2+
* Copyright (C) 2023-2024 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -18,8 +18,6 @@ namespace NEO {
1818

1919
class ReleaseHelper;
2020
enum class ReleaseType;
21-
enum class GfxMemoryAllocationMethod : uint32_t;
22-
enum class AllocationType;
2321

2422
inline constexpr uint32_t maxArchitecture = 64;
2523
using createReleaseHelperFunctionType = std::unique_ptr<ReleaseHelper> (*)(HardwareIpVersion hardwareIpVersion);
@@ -45,11 +43,9 @@ class ReleaseHelper {
4543
virtual int getProductMaxPreferredSlmSize(int preferredEnumValue) const = 0;
4644
virtual bool getMediaFrequencyTileIndex(uint32_t &tileIndex) const = 0;
4745
virtual bool isResolvingSubDeviceIDNeeded() const = 0;
48-
virtual bool isCachingOnCpuAvailable() const = 0;
4946
virtual bool shouldAdjustDepth() const = 0;
5047
virtual bool isDirectSubmissionSupported() const = 0;
5148
virtual bool isRcsExposureDisabled() const = 0;
52-
virtual std::optional<GfxMemoryAllocationMethod> getPreferredAllocationMethod(AllocationType allocationType) const = 0;
5349
virtual std::vector<uint32_t> getSupportedNumGrfs() const = 0;
5450
virtual bool isBindlessAddressingDisabled() const = 0;
5551
virtual uint32_t getNumThreadsPerEu() const = 0;
@@ -80,11 +76,9 @@ class ReleaseHelperHw : public ReleaseHelper {
8076
int getProductMaxPreferredSlmSize(int preferredEnumValue) const override;
8177
bool getMediaFrequencyTileIndex(uint32_t &tileIndex) const override;
8278
bool isResolvingSubDeviceIDNeeded() const override;
83-
bool isCachingOnCpuAvailable() const override;
8479
bool shouldAdjustDepth() const override;
8580
bool isDirectSubmissionSupported() const override;
8681
bool isRcsExposureDisabled() const override;
87-
std::optional<GfxMemoryAllocationMethod> getPreferredAllocationMethod(AllocationType allocationType) const override;
8882
std::vector<uint32_t> getSupportedNumGrfs() const override;
8983
bool isBindlessAddressingDisabled() const override;
9084
uint32_t getNumThreadsPerEu() const override;

shared/source/release_helper/release_helper_base.inl

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2023 Intel Corporation
2+
* Copyright (C) 2023-2024 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -72,16 +72,6 @@ bool ReleaseHelperHw<releaseType>::isResolvingSubDeviceIDNeeded() const {
7272
return true;
7373
}
7474

75-
template <ReleaseType releaseType>
76-
bool ReleaseHelperHw<releaseType>::isCachingOnCpuAvailable() const {
77-
return true;
78-
}
79-
80-
template <ReleaseType releaseType>
81-
std::optional<GfxMemoryAllocationMethod> ReleaseHelperHw<releaseType>::getPreferredAllocationMethod(AllocationType allocationType) const {
82-
return {};
83-
}
84-
8575
template <ReleaseType releaseType>
8676
bool ReleaseHelperHw<releaseType>::shouldAdjustDepth() const {
8777
return false;

shared/source/release_helper/release_helper_common_xe_lpg.inl

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2023 Intel Corporation
2+
* Copyright (C) 2023-2024 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -15,22 +15,6 @@ bool ReleaseHelperHw<release>::isMatrixMultiplyAccumulateSupported() const {
1515
return false;
1616
}
1717

18-
template <>
19-
std::optional<GfxMemoryAllocationMethod> ReleaseHelperHw<release>::getPreferredAllocationMethod(AllocationType allocationType) const {
20-
switch (allocationType) {
21-
case AllocationType::tagBuffer:
22-
case AllocationType::timestampPacketTagBuffer:
23-
return {};
24-
default:
25-
return GfxMemoryAllocationMethod::allocateByKmd;
26-
}
27-
}
28-
29-
template <>
30-
bool ReleaseHelperHw<release>::isCachingOnCpuAvailable() const {
31-
return false;
32-
}
33-
3418
template <>
3519
bool ReleaseHelperHw<release>::isDirectSubmissionSupported() const {
3620
return true;

shared/source/xe_hpg_core/xe_lpg/os_agnostic_product_helper_xe_lpg.inl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,20 @@ uint32_t ProductHelperHw<gfxProduct>::getInternalHeapsPreallocated() const {
105105
return 1u;
106106
}
107107

108+
template <>
109+
std::optional<GfxMemoryAllocationMethod> ProductHelperHw<gfxProduct>::getPreferredAllocationMethod(AllocationType allocationType) const {
110+
switch (allocationType) {
111+
case AllocationType::tagBuffer:
112+
case AllocationType::timestampPacketTagBuffer:
113+
return {};
114+
default:
115+
return GfxMemoryAllocationMethod::allocateByKmd;
116+
}
117+
}
118+
119+
template <>
120+
bool ProductHelperHw<gfxProduct>::isCachingOnCpuAvailable() const {
121+
return false;
122+
}
123+
108124
} // namespace NEO

shared/test/common/mocks/mock_release_helper.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2023 Intel Corporation
2+
* Copyright (C) 2023-2024 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -26,11 +26,9 @@ class MockReleaseHelper : public ReleaseHelper {
2626
ADDMETHOD_CONST_NOBASE(getProductMaxPreferredSlmSize, int, 0, (int preferredEnumValue));
2727
ADDMETHOD_CONST_NOBASE(getMediaFrequencyTileIndex, bool, false, (uint32_t & tileIndex));
2828
ADDMETHOD_CONST_NOBASE(isResolvingSubDeviceIDNeeded, bool, false, ());
29-
ADDMETHOD_CONST_NOBASE(isCachingOnCpuAvailable, bool, false, ());
3029
ADDMETHOD_CONST_NOBASE(shouldAdjustDepth, bool, false, ());
3130
ADDMETHOD_CONST_NOBASE(isDirectSubmissionSupported, bool, false, ());
3231
ADDMETHOD_CONST_NOBASE(isRcsExposureDisabled, bool, false, ());
33-
ADDMETHOD_CONST_NOBASE(getPreferredAllocationMethod, std::optional<GfxMemoryAllocationMethod>, std::nullopt, (AllocationType allocationType));
3432
ADDMETHOD_CONST_NOBASE(getSupportedNumGrfs, std::vector<uint32_t>, {128}, ());
3533
ADDMETHOD_CONST_NOBASE(isBindlessAddressingDisabled, bool, true, ());
3634
ADDMETHOD_CONST_NOBASE(getNumThreadsPerEu, uint32_t, 8u, ());

0 commit comments

Comments
 (0)