Skip to content

Commit d9aae80

Browse files
Do not apply L0 debugger WA (Disable L3 cache) for highest DG2 steppings
Related-To: NEO-6320 Signed-off-by: Igor Venevtsev <[email protected]>
1 parent 03366f1 commit d9aae80

File tree

8 files changed

+41
-19
lines changed

8 files changed

+41
-19
lines changed

level_zero/core/source/debugger/debugger_l0.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2020-2021 Intel Corporation
2+
* Copyright (C) 2020-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -78,7 +78,7 @@ void DebuggerL0::initialize() {
7878
NEO::MemoryTransferHelper::transferMemoryToAllocation(hwHelper.isBlitCopyRequiredForLocalMemory(hwInfo, *moduleDebugArea),
7979
*device, moduleDebugArea, 0, &debugArea,
8080
sizeof(DebugAreaHeader));
81-
if (hwHelper.disableL3CacheForDebug()) {
81+
if (hwHelper.disableL3CacheForDebug(hwInfo)) {
8282
device->getGmmHelper()->disableL3CacheForDebug();
8383
}
8484
}

opencl/test/unit_test/helpers/hw_helper_tests.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018-2021 Intel Corporation
2+
* Copyright (C) 2018-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -1408,13 +1408,13 @@ TEST(HwHelperTests, whenBlitterSupportIsDisabledThenDontExposeAnyBcsEngine) {
14081408
using NotATSOrDG2 = AreNotGfxCores<IGFX_XE_HP_CORE, IGFX_XE_HPG_CORE>;
14091409
HWTEST2_F(HwHelperTest, givenNotAtsOrDg2WhenDisableL3ForDebugCalledThenFalseIsReturned, NotATSOrDG2) {
14101410
const auto &hwHelper = HwHelper::get(renderCoreFamily);
1411-
EXPECT_FALSE(hwHelper.disableL3CacheForDebug());
1411+
EXPECT_FALSE(hwHelper.disableL3CacheForDebug(*defaultHwInfo));
14121412
}
14131413

14141414
using ATSOrDG2 = IsWithinGfxCore<IGFX_XE_HP_CORE, IGFX_XE_HPG_CORE>;
14151415
HWTEST2_F(HwHelperTest, givenAtsOrDg2WhenDisableL3ForDebugCalledThenTrueIsReturned, ATSOrDG2) {
14161416
const auto &hwHelper = HwHelper::get(renderCoreFamily);
1417-
EXPECT_TRUE(hwHelper.disableL3CacheForDebug());
1417+
EXPECT_TRUE(hwHelper.disableL3CacheForDebug(*defaultHwInfo));
14181418
}
14191419

14201420
HWTEST_F(HwHelperTest, givenHwHelperWhenGettingIfRevisionSpecificBinaryBuiltinIsRequiredThenFalseIsReturned) {
@@ -1448,4 +1448,4 @@ HWTEST2_F(HwHelperTest, givenHwInfoConfigWhenCheckingForceNonGpuCoherencyWAThenF
14481448
const auto &hwHelper = HwHelper::get(renderCoreFamily);
14491449
EXPECT_FALSE(hwHelper.forceNonGpuCoherencyWA(true));
14501450
EXPECT_FALSE(hwHelper.forceNonGpuCoherencyWA(false));
1451-
}
1451+
}

opencl/test/unit_test/xe_hpg_core/dg2/hw_helper_tests_dg2.cpp

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2021 Intel Corporation
2+
* Copyright (C) 2021-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -74,6 +74,28 @@ DG2TEST_F(HwHelperTestsDg2, givenRevisionEnumAndPlatformFamilyTypeThenProperValu
7474
}
7575
}
7676

77+
DG2TEST_F(HwHelperTestsDg2, givenRevisionEnumAndDisableL3CacheForDebugCalledThenCorrectValueIsReturned) {
78+
uint32_t steppings[] = {
79+
REVISION_A0,
80+
REVISION_A1,
81+
REVISION_B,
82+
REVISION_C,
83+
CommonConstants::invalidStepping,
84+
};
85+
86+
const auto &hwHelper = HwHelper::get(hardwareInfo.platform.eRenderCoreFamily);
87+
const auto &hwInfoConfig = *HwInfoConfig::get(hardwareInfo.platform.eProductFamily);
88+
89+
for (auto stepping : steppings) {
90+
hardwareInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(stepping, hardwareInfo);
91+
if (stepping < REVISION_B) {
92+
EXPECT_TRUE(hwHelper.disableL3CacheForDebug(hardwareInfo));
93+
} else {
94+
EXPECT_FALSE(hwHelper.disableL3CacheForDebug(hardwareInfo));
95+
}
96+
}
97+
}
98+
7799
DG2TEST_F(HwHelperTestsDg2, givenDg2WhenSetForceNonCoherentThenProperFlagSet) {
78100
using FORCE_NON_COHERENT = typename FamilyType::STATE_COMPUTE_MODE::FORCE_NON_COHERENT;
79101

@@ -127,4 +149,4 @@ DG2TEST_F(HwHelperTestsDg2, givenNotEnabledSliceWhenComputeUnitsUsedForScratchTh
127149
auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
128150

129151
EXPECT_THROW(hwHelper.getComputeUnitsUsedForScratch(&hwInfo), std::exception);
130-
}
152+
}

shared/source/device/device.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ bool Device::createDeviceImpl() {
219219
}
220220

221221
auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
222-
if (getDebugger() && hwHelper.disableL3CacheForDebug()) {
222+
if (getDebugger() && hwHelper.disableL3CacheForDebug(hwInfo)) {
223223
getGmmHelper()->disableL3CacheForDebug();
224224
}
225225

shared/source/helpers/hw_helper.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018-2021 Intel Corporation
2+
* Copyright (C) 2018-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -151,7 +151,7 @@ class HwHelper {
151151
virtual uint64_t getMaxMemAllocSize() const = 0;
152152
virtual bool isStatelesToStatefullWithOffsetSupported() const = 0;
153153
virtual void encodeBufferSurfaceState(EncodeSurfaceStateArgs &args) = 0;
154-
virtual bool disableL3CacheForDebug() const = 0;
154+
virtual bool disableL3CacheForDebug(const HardwareInfo &hwInfo) const = 0;
155155
virtual bool isRevisionSpecificBinaryBuiltinRequired() const = 0;
156156
virtual bool forceNonGpuCoherencyWA(bool requiresCoherency) const = 0;
157157

@@ -387,7 +387,7 @@ class HwHelperHw : public HwHelper {
387387
uint64_t getMaxMemAllocSize() const override;
388388
bool isStatelesToStatefullWithOffsetSupported() const override;
389389
void encodeBufferSurfaceState(EncodeSurfaceStateArgs &args) override;
390-
bool disableL3CacheForDebug() const override;
390+
bool disableL3CacheForDebug(const HardwareInfo &hwInfo) const override;
391391
bool isRevisionSpecificBinaryBuiltinRequired() const override;
392392
bool forceNonGpuCoherencyWA(bool requiresCoherency) const override;
393393

shared/source/helpers/hw_helper_base.inl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2019-2021 Intel Corporation
2+
* Copyright (C) 2019-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -702,7 +702,7 @@ void HwHelperHw<GfxFamily>::encodeBufferSurfaceState(EncodeSurfaceStateArgs &arg
702702
}
703703

704704
template <typename GfxFamily>
705-
bool HwHelperHw<GfxFamily>::disableL3CacheForDebug() const {
705+
bool HwHelperHw<GfxFamily>::disableL3CacheForDebug(const HardwareInfo &) const {
706706
return false;
707707
}
708708
template <typename GfxFamily>

shared/source/xe_hp_core/hw_helper_xe_hp_core.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2021 Intel Corporation
2+
* Copyright (C) 2021-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -155,7 +155,7 @@ uint32_t HwHelperHw<Family>::getDefaultRevisionId(const HardwareInfo &hwInfo) co
155155
}
156156

157157
template <>
158-
bool HwHelperHw<Family>::disableL3CacheForDebug() const {
158+
bool HwHelperHw<Family>::disableL3CacheForDebug(const HardwareInfo &) const {
159159
return true;
160160
}
161161

shared/source/xe_hpg_core/hw_helper_xe_hpg_core.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2021 Intel Corporation
2+
* Copyright (C) 2021-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -114,8 +114,8 @@ uint32_t HwHelperHw<Family>::computeSlmValues(const HardwareInfo &hwInfo, uint32
114114
}
115115

116116
template <>
117-
bool HwHelperHw<Family>::disableL3CacheForDebug() const {
118-
return true;
117+
bool HwHelperHw<Family>::disableL3CacheForDebug(const HardwareInfo &hwInfo) const {
118+
return isWorkaroundRequired(REVISION_A0, REVISION_B, hwInfo);
119119
}
120120

121121
template class HwHelperHw<Family>;

0 commit comments

Comments
 (0)