Skip to content

Commit f5575a1

Browse files
Revert "Remove fallback path for PAT index programming"
This reverts commit faf8d51. Signed-off-by: Compute-Runtime-Validation <[email protected]>
1 parent fbc9188 commit f5575a1

File tree

11 files changed

+109
-9
lines changed

11 files changed

+109
-9
lines changed

opencl/test/unit_test/helpers/hw_helper_tests.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,6 +1456,12 @@ HWTEST_F(HwHelperTest, GivenHwInfoWhenGetBatchBufferEndReferenceCalledThenCorrec
14561456
EXPECT_EQ(hwHelper.getBatchBufferEndReference(), reinterpret_cast<const void *>(&FamilyType::cmdInitBatchBufferEnd));
14571457
}
14581458

1459+
HWTEST_F(HwHelperTest, givenHwHelperWhenAskingForPatIndexWaThenReturnFalse) {
1460+
const auto &hwHelper = HwHelper::get(renderCoreFamily);
1461+
1462+
EXPECT_FALSE(hwHelper.isPatIndexFallbackWaRequired());
1463+
}
1464+
14591465
HWTEST_F(HwHelperTest, givenHwHelperWhenPassingCopyEngineTypeThenItsCopyOnly) {
14601466
EXPECT_TRUE(EngineHelper::isCopyOnlyEngineType(EngineGroupType::Copy));
14611467
}

opencl/test/unit_test/xe_hpc_core/excludes_ocl_xe_hpc_core.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,4 @@ HWTEST_EXCLUDE_PRODUCT(CommandStreamReceiverFlushTaskTests, givenOverrideThreadA
5252
HWTEST_EXCLUDE_PRODUCT(XeHPAndLaterAubCommandStreamReceiverWithoutFixtureTests, GivenCopyHostPtrAndHostNoAccessAndReadOnlyFlagsWhenAllocatingBufferThenAllocationIsCopiedToEveryTile, IGFX_XE_HPC_CORE);
5353
HWTEST_EXCLUDE_PRODUCT(GetAllocationDataTestHw, givenRingBufferAllocationWhenGetAllocationDataIsCalledThenItHasProperFieldsSet, IGFX_XE_HPC_CORE);
5454
HWTEST_EXCLUDE_PRODUCT(GetAllocationDataTestHw, givenSemaphoreBufferAllocationWhenGetAllocationDataIsCalledThenItHasProperFieldsSet, IGFX_XE_HPC_CORE);
55+
HWTEST_EXCLUDE_PRODUCT(HwHelperTest, givenHwHelperWhenAskingForPatIndexWaThenReturnFalse, IGFX_XE_HPC_CORE);

opencl/test/unit_test/xe_hpc_core/hw_helper_tests_xe_hpc_core.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,3 +826,9 @@ XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenCommandBufferAllocationWhenSetExt
826826
XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, WhenGettingDeviceIpVersionThenMakeCorrectDeviceIpVersion) {
827827
EXPECT_EQ(ClHwHelperMock::makeDeviceIpVersion(12, 8, 1), ClHwHelper::get(renderCoreFamily).getDeviceIpVersion(*defaultHwInfo));
828828
}
829+
830+
XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenHwHelperWhenAskingForPatIndexWaThenReturnTrue) {
831+
const auto &hwHelper = HwHelper::get(renderCoreFamily);
832+
833+
EXPECT_TRUE(hwHelper.isPatIndexFallbackWaRequired());
834+
}

shared/source/gmm_helper/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
set(NEO_CORE_GMM_HELPER
88
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
99
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}resource_info_${DRIVER_MODEL}.cpp
10+
${CMAKE_CURRENT_SOURCE_DIR}/client_context${BRANCH_DIR_SUFFIX}/gmm_client_context_extra.cpp
1011
${CMAKE_CURRENT_SOURCE_DIR}/client_context/gmm_client_context.cpp
1112
${CMAKE_CURRENT_SOURCE_DIR}/client_context/gmm_client_context.h
1213
${CMAKE_CURRENT_SOURCE_DIR}/cache_settings_helper.cpp

shared/source/gmm_helper/client_context/gmm_client_context.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,4 @@ void GmmClientContext::setGmmDeviceInfo(GMM_DEVICE_INFO *deviceInfo) {
7979
clientContext->GmmSetDeviceInfo(deviceInfo);
8080
}
8181

82-
uint32_t GmmClientContext::cachePolicyGetPATIndex(GMM_RESOURCE_INFO *gmmResourceInfo, GMM_RESOURCE_USAGE_TYPE usage) {
83-
return clientContext->CachePolicyGetPATIndex(gmmResourceInfo, usage, nullptr, false);
84-
}
85-
8682
} // namespace NEO
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Copyright (C) 2022 Intel Corporation
3+
*
4+
* SPDX-License-Identifier: MIT
5+
*
6+
*/
7+
8+
#include "shared/source/gmm_helper/client_context/gmm_client_context.h"
9+
10+
namespace NEO {
11+
12+
uint32_t GmmClientContext::cachePolicyGetPATIndex(GMM_RESOURCE_INFO *gmmResourceInfo, GMM_RESOURCE_USAGE_TYPE usage) {
13+
return 0;
14+
}
15+
16+
} // namespace NEO

shared/source/helpers/hw_helper.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ class HwHelper {
156156
virtual size_t getBatchBufferEndSize() const = 0;
157157
virtual const void *getBatchBufferEndReference() const = 0;
158158
virtual bool isPlatformFlushTaskEnabled(const NEO::HardwareInfo &hwInfo) const = 0;
159+
virtual bool isPatIndexFallbackWaRequired() const = 0;
159160
virtual uint32_t getMinimalScratchSpaceSize() const = 0;
160161

161162
protected:
@@ -396,6 +397,7 @@ class HwHelperHw : public HwHelper {
396397
size_t getBatchBufferEndSize() const override;
397398
const void *getBatchBufferEndReference() const override;
398399
bool isPlatformFlushTaskEnabled(const NEO::HardwareInfo &hwInfo) const override;
400+
bool isPatIndexFallbackWaRequired() const override;
399401
uint32_t getMinimalScratchSpaceSize() const override;
400402

401403
protected:

shared/source/helpers/hw_helper_base.inl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,4 +712,10 @@ uint64_t HwHelperHw<GfxFamily>::getPatIndex(CacheRegion cacheRegion, CachePolicy
712712

713713
return -1;
714714
}
715+
716+
template <typename GfxFamily>
717+
bool HwHelperHw<GfxFamily>::isPatIndexFallbackWaRequired() const {
718+
return false;
719+
}
720+
715721
} // namespace NEO

shared/source/os_interface/linux/drm_neo.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,13 +1304,11 @@ uint64_t Drm::getPatIndex(Gmm *gmm, AllocationType allocationType, CacheRegion c
13041304

13051305
uint64_t patIndex = rootDeviceEnvironment.getGmmClientContext()->cachePolicyGetPATIndex(resourceInfo, usageType);
13061306

1307-
UNRECOVERABLE_IF(patIndex == static_cast<uint64_t>(GMM_PAT_ERROR));
1308-
13091307
if (DebugManager.flags.ClosEnabled.get() != -1) {
13101308
closEnabled = !!DebugManager.flags.ClosEnabled.get();
13111309
}
13121310

1313-
if (closEnabled) {
1311+
if (patIndex == static_cast<uint64_t>(GMM_PAT_ERROR) || closEnabled || hwHelper.isPatIndexFallbackWaRequired()) {
13141312
patIndex = hwHelper.getPatIndex(cacheRegion, cachePolicy);
13151313
}
13161314

shared/source/xe_hpc_core/hw_helper_xe_hpc_core.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,11 @@ uint64_t HwHelperHw<Family>::getPatIndex(CacheRegion cacheRegion, CachePolicy ca
437437
return (static_cast<uint32_t>(cachePolicy) + (static_cast<uint16_t>(cacheRegion) * 2));
438438
}
439439

440+
template <>
441+
bool HwHelperHw<Family>::isPatIndexFallbackWaRequired() const {
442+
return true;
443+
}
444+
440445
} // namespace NEO
441446

442447
#include "shared/source/helpers/hw_helper_pvc_and_later.inl"

0 commit comments

Comments
 (0)