Skip to content

Commit 0643a89

Browse files
pwilmaCompute-Runtime-Automation
authored andcommitted
Move TGLLP specific workarounds to HwInfo
Related-To: NEO-3914 Change-Id: I115b28ea6e796dcc69b32105e39a68da0e5af7df Signed-off-by: Pawel Wilma <[email protected]>
1 parent 37a690a commit 0643a89

16 files changed

+122
-80
lines changed

core/helpers/hw_helper.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,10 @@ class HwHelperHw : public HwHelper {
182182

183183
static bool isBlitAuxTranslationRequired(const HardwareInfo &hwInfo, const MultiDispatchInfo &multiDispatchInfo);
184184

185+
static bool isOffsetToSkipSetFFIDGPWARequired(const HardwareInfo &hwInfo);
186+
187+
static bool isForceDefaultRCSEngineWARequired(const HardwareInfo &hwInfo);
188+
185189
protected:
186190
static const AuxTranslationMode defaultAuxTranslationMode;
187191
HwHelperHw() = default;

core/helpers/hw_helper_base.inl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,4 +262,14 @@ uint32_t HwHelperHw<GfxFamily>::getBarriersCountFromHasBarriers(uint32_t hasBarr
262262
return hasBarriers;
263263
}
264264

265+
template <typename GfxFamily>
266+
bool HwHelperHw<GfxFamily>::isOffsetToSkipSetFFIDGPWARequired(const HardwareInfo &hwInfo) {
267+
return false;
268+
}
269+
270+
template <typename GfxFamily>
271+
bool HwHelperHw<GfxFamily>::isForceDefaultRCSEngineWARequired(const HardwareInfo &hwInfo) {
272+
return false;
273+
}
274+
265275
} // namespace NEO

core/sku_info/sku_info_base.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,5 @@ struct WorkaroundTableBase {
118118
bool waUntypedBufferCompression = false;
119119
bool waAuxTable16KGranular = false;
120120
bool waDisableFusedThreadScheduling = false;
121-
bool waUseOffsetToSkipSetFFIDGP = false;
122-
bool waForceDefaultRCSEngine = false;
123121
};
124122
} // namespace NEO

runtime/device_queue/device_queue_hw_base.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ uint64_t DeviceQueueHw<GfxFamily>::getBlockKernelStartPointer(const Device &devi
243243

244244
auto blockKernelStartPointer = blockAllocation ? blockAllocation->getGpuAddressToPatch() : 0llu;
245245

246-
if (blockAllocation && isCcsUsed && device.getHardwareInfo().workaroundTable.waUseOffsetToSkipSetFFIDGP) {
246+
if (blockAllocation && isCcsUsed && HwHelperHw<GfxFamily>::isOffsetToSkipSetFFIDGPWARequired(device.getHardwareInfo())) {
247247
blockKernelStartPointer += blockInfo->patchInfo.threadPayload->OffsetToSkipSetFFIDGP;
248248
}
249249
return blockKernelStartPointer;

runtime/gen12lp/hw_helper_gen12lp.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,19 @@
1515
namespace NEO {
1616
typedef TGLLPFamily Family;
1717

18+
template <>
19+
bool HwHelperHw<Family>::isOffsetToSkipSetFFIDGPWARequired(const HardwareInfo &hwInfo) {
20+
return (hwInfo.platform.usRevId < REVISION_B);
21+
}
22+
23+
template <>
24+
bool HwHelperHw<Family>::isForceDefaultRCSEngineWARequired(const HardwareInfo &hwInfo) {
25+
return ((hwInfo.platform.eProductFamily == IGFX_TIGERLAKE_LP) & (hwInfo.platform.usRevId < REVISION_B));
26+
}
27+
1828
template <>
1929
void HwHelperHw<Family>::adjustDefaultEngineType(HardwareInfo *pHwInfo) {
20-
if (!pHwInfo->featureTable.ftrCCSNode || pHwInfo->workaroundTable.waForceDefaultRCSEngine) {
30+
if (!pHwInfo->featureTable.ftrCCSNode || isForceDefaultRCSEngineWARequired(*pHwInfo)) {
2131
pHwInfo->capabilityTable.defaultEngineType = aub_stream::ENGINE_RCS;
2232
}
2333
}

runtime/gen12lp/hw_info_tgllp.inl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,6 @@ void TGLLP::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) {
100100
workaroundTable->wa4kAlignUVOffsetNV12LinearSurface = true;
101101
workaroundTable->waEnablePreemptionGranularityControlByUMD = true;
102102
workaroundTable->waUntypedBufferCompression = true;
103-
if (hwInfo->platform.usRevId < REVISION_B) {
104-
workaroundTable->waUseOffsetToSkipSetFFIDGP = true;
105-
workaroundTable->waForceDefaultRCSEngine = true;
106-
}
107103
};
108104

109105
const HardwareInfo TGLLP_1x6x16::hwInfo = {

runtime/helpers/hardware_commands_helper_base.inl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
#pragma once
9+
#include "core/helpers/hw_helper.h"
910
#include "runtime/helpers/hardware_commands_helper.h"
1011
#include "runtime/kernel/kernel.h"
1112

@@ -103,7 +104,7 @@ void HardwareCommandsHelper<GfxFamily>::setKernelStartOffset(
103104
}
104105
kernelStartOffset += kernel.getStartOffset();
105106

106-
if (isCssUsed && kernel.getDevice().getHardwareInfo().workaroundTable.waUseOffsetToSkipSetFFIDGP) {
107+
if (isCssUsed && HwHelperHw<GfxFamily>::isOffsetToSkipSetFFIDGPWARequired(kernel.getDevice().getHardwareInfo())) {
107108
kernelStartOffset += kernelInfo.patchInfo.threadPayload->OffsetToSkipSetFFIDGP;
108109
}
109110
}

unit_tests/device_queue/device_queue_hw_tests.cpp

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -792,30 +792,3 @@ HWCMDTEST_F(IGFX_GEN8_CORE, TheSimplestDeviceQueueFixture, getProfilingEndCmdsSi
792792

793793
EXPECT_EQ(expectedSize, MockDeviceQueueHw<FamilyType>::getProfilingEndCmdsSize());
794794
}
795-
796-
HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueHwTest, givenDeviceQueueWhenRunningOnCCsThenFfidSkipOffsetIsAddedToBlockKernelStartPointer) {
797-
auto device = pContext->getDevice(0);
798-
std::unique_ptr<MockParentKernel> mockParentKernel(MockParentKernel::create(*pContext));
799-
KernelInfo *blockInfo = const_cast<KernelInfo *>(mockParentKernel->mockProgram->blockKernelManager->getBlockKernelInfo(0));
800-
blockInfo->createKernelAllocation(device->getRootDeviceIndex(), device->getMemoryManager());
801-
ASSERT_NE(nullptr, blockInfo->getGraphicsAllocation());
802-
const_cast<SPatchThreadPayload *>(blockInfo->patchInfo.threadPayload)->OffsetToSkipSetFFIDGP = 0x1234;
803-
const_cast<HardwareInfo &>(device->getHardwareInfo()).workaroundTable.waUseOffsetToSkipSetFFIDGP = true;
804-
805-
uint64_t expectedOffset = blockInfo->getGraphicsAllocation()->getGpuAddressToPatch() + blockInfo->patchInfo.threadPayload->OffsetToSkipSetFFIDGP;
806-
uint64_t offset = MockDeviceQueueHw<FamilyType>::getBlockKernelStartPointer(*device, blockInfo, true);
807-
EXPECT_EQ(expectedOffset, offset);
808-
809-
expectedOffset = blockInfo->getGraphicsAllocation()->getGpuAddressToPatch();
810-
offset = MockDeviceQueueHw<FamilyType>::getBlockKernelStartPointer(*device, blockInfo, false);
811-
EXPECT_EQ(expectedOffset, offset);
812-
813-
const_cast<HardwareInfo &>(device->getHardwareInfo()).workaroundTable.waUseOffsetToSkipSetFFIDGP = false;
814-
815-
expectedOffset = blockInfo->getGraphicsAllocation()->getGpuAddressToPatch();
816-
offset = MockDeviceQueueHw<FamilyType>::getBlockKernelStartPointer(*device, blockInfo, true);
817-
EXPECT_EQ(expectedOffset, offset);
818-
819-
offset = MockDeviceQueueHw<FamilyType>::getBlockKernelStartPointer(*device, blockInfo, false);
820-
EXPECT_EQ(expectedOffset, offset);
821-
}

unit_tests/gen12lp/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ if(TESTS_GEN12LP)
1212
${CMAKE_CURRENT_SOURCE_DIR}/command_stream_receiver_hw_tests_gen12lp.inl
1313
${CMAKE_CURRENT_SOURCE_DIR}/command_stream_receiver_simulated_common_hw_tests_gen12lp.inl
1414
${CMAKE_CURRENT_SOURCE_DIR}/compute_mode_tests_gen12lp.inl
15+
${CMAKE_CURRENT_SOURCE_DIR}/device_queue_tests_gen12lp.cpp
1516
${CMAKE_CURRENT_SOURCE_DIR}/enqueue_media_kernel_gen12lp.inl
1617
${CMAKE_CURRENT_SOURCE_DIR}/gen12lp_tests_wrapper.cpp
1718
${CMAKE_CURRENT_SOURCE_DIR}/hardware_commands_helper_tests_gen12lp.inl
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright (C) 2017-2019 Intel Corporation
3+
*
4+
* SPDX-License-Identifier: MIT
5+
*
6+
*/
7+
8+
#include "unit_tests/fixtures/device_host_queue_fixture.h"
9+
#include "unit_tests/mocks/mock_context.h"
10+
#include "unit_tests/mocks/mock_device.h"
11+
#include "unit_tests/mocks/mock_device_queue.h"
12+
#include "unit_tests/mocks/mock_kernel.h"
13+
14+
using namespace NEO;
15+
using namespace DeviceHostQueue;
16+
17+
GEN12LPTEST_F(DeviceQueueHwTest, givenDeviceQueueWhenRunningOnCCsThenFfidSkipOffsetIsAddedToBlockKernelStartPointer) {
18+
auto device = pContext->getDevice(0);
19+
std::unique_ptr<MockParentKernel> mockParentKernel(MockParentKernel::create(*pContext));
20+
KernelInfo *blockInfo = const_cast<KernelInfo *>(mockParentKernel->mockProgram->blockKernelManager->getBlockKernelInfo(0));
21+
blockInfo->createKernelAllocation(device->getRootDeviceIndex(), device->getMemoryManager());
22+
ASSERT_NE(nullptr, blockInfo->getGraphicsAllocation());
23+
const_cast<SPatchThreadPayload *>(blockInfo->patchInfo.threadPayload)->OffsetToSkipSetFFIDGP = 0x1234;
24+
25+
const_cast<HardwareInfo &>(device->getHardwareInfo()).platform.usRevId = REVISION_A0;
26+
27+
uint64_t expectedOffset = blockInfo->getGraphicsAllocation()->getGpuAddressToPatch() + blockInfo->patchInfo.threadPayload->OffsetToSkipSetFFIDGP;
28+
uint64_t offset = MockDeviceQueueHw<FamilyType>::getBlockKernelStartPointer(*device, blockInfo, true);
29+
EXPECT_EQ(expectedOffset, offset);
30+
31+
expectedOffset = blockInfo->getGraphicsAllocation()->getGpuAddressToPatch();
32+
offset = MockDeviceQueueHw<FamilyType>::getBlockKernelStartPointer(*device, blockInfo, false);
33+
EXPECT_EQ(expectedOffset, offset);
34+
35+
const_cast<HardwareInfo &>(device->getHardwareInfo()).platform.usRevId = REVISION_B;
36+
37+
expectedOffset = blockInfo->getGraphicsAllocation()->getGpuAddressToPatch();
38+
offset = MockDeviceQueueHw<FamilyType>::getBlockKernelStartPointer(*device, blockInfo, true);
39+
EXPECT_EQ(expectedOffset, offset);
40+
41+
offset = MockDeviceQueueHw<FamilyType>::getBlockKernelStartPointer(*device, blockInfo, false);
42+
EXPECT_EQ(expectedOffset, offset);
43+
}

0 commit comments

Comments
 (0)