mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 00:58:39 +08:00
Reduce scope of State Base Address WA for DG2 platforms
Related-To: NEO-7607, HSD-16013000631, HSD-14013910100 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
9dd6c4013c
commit
7d70063186
@@ -18,7 +18,7 @@ namespace L0 {
|
||||
namespace ult {
|
||||
using CommandQueueTestDG2 = Test<DeviceFixture>;
|
||||
|
||||
HWTEST2_F(CommandQueueTestDG2, givenBindlessEnabledWhenEstimateStateBaseAddressCmdSizeCalledOnDG2ThenReturnedSizeOf2SBAAndPCAnd3DBindingTablePoolPool, IsDG2) {
|
||||
HWTEST2_F(CommandQueueTestDG2, givenBindlessEnabledWhenEstimateStateBaseAddressCmdSizeCalledOnDG2ThenReturnedSizeOfSBAAndPCAnd3DBindingTablePoolPool, IsDG2) {
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.UseBindlessMode.set(1);
|
||||
using GfxFamily = typename NEO::GfxFamilyMapper<gfxCoreFamily>::GfxFamily;
|
||||
@@ -29,7 +29,15 @@ HWTEST2_F(CommandQueueTestDG2, givenBindlessEnabledWhenEstimateStateBaseAddressC
|
||||
auto csr = std::unique_ptr<NEO::CommandStreamReceiver>(neoDevice->createCommandStreamReceiver());
|
||||
auto commandQueue = std::make_unique<MockCommandQueueHw<gfxCoreFamily>>(device, csr.get(), &desc);
|
||||
auto size = commandQueue->estimateStateBaseAddressCmdSize();
|
||||
auto expectedSize = 2 * sizeof(STATE_BASE_ADDRESS) + sizeof(PIPE_CONTROL) + sizeof(_3DSTATE_BINDING_TABLE_POOL_ALLOC);
|
||||
auto expectedSize = sizeof(STATE_BASE_ADDRESS) + sizeof(PIPE_CONTROL) + sizeof(_3DSTATE_BINDING_TABLE_POOL_ALLOC);
|
||||
|
||||
auto &productHelper = neoDevice->getProductHelper();
|
||||
auto &hwInfo = neoDevice->getHardwareInfo();
|
||||
|
||||
if (productHelper.isAdditionalStateBaseAddressWARequired(hwInfo)) {
|
||||
expectedSize += sizeof(STATE_BASE_ADDRESS);
|
||||
}
|
||||
|
||||
EXPECT_EQ(size, expectedSize);
|
||||
}
|
||||
|
||||
|
||||
@@ -72,12 +72,13 @@ bool ProductHelperHw<gfxProduct>::isDirectSubmissionSupported(const HardwareInfo
|
||||
|
||||
template <>
|
||||
bool ProductHelperHw<gfxProduct>::isAdditionalStateBaseAddressWARequired(const HardwareInfo &hwInfo) const {
|
||||
uint32_t stepping = getSteppingFromHwRevId(hwInfo);
|
||||
if (stepping <= REVISION_B) {
|
||||
if (DG2::isG10(hwInfo) && GfxCoreHelper::isWorkaroundRequired(REVISION_B, REVISION_C, hwInfo, *this)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
if (DG2::isG11(hwInfo)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
template <>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -31,15 +31,37 @@ HWTEST2_F(DG2CommandEncoderTest, givenDG2WhenGettingRequiredSizeForStateBaseAddr
|
||||
|
||||
auto container = MockCommandContainer();
|
||||
container.clearHeaps();
|
||||
size_t size = EncodeStateBaseAddress<FamilyType>::getRequiredSizeForStateBaseAddress(*pDevice, container, false);
|
||||
EXPECT_EQ(size, 176ul);
|
||||
|
||||
auto &hwInfo = *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->getMutableHardwareInfo();
|
||||
|
||||
auto &productHelper = pDevice->getProductHelper();
|
||||
for (uint8_t revision : {REVISION_A0, REVISION_A1, REVISION_B, REVISION_C}) {
|
||||
hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(revision, hwInfo);
|
||||
auto expectedSize = 88ull;
|
||||
if (productHelper.isAdditionalStateBaseAddressWARequired(hwInfo)) {
|
||||
expectedSize += sizeof(typename FamilyType::STATE_BASE_ADDRESS);
|
||||
}
|
||||
size_t size = EncodeStateBaseAddress<FamilyType>::getRequiredSizeForStateBaseAddress(*pDevice, container, false);
|
||||
EXPECT_EQ(size, expectedSize);
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST2_F(DG2CommandEncoderTest, givenDG2AndCommandContainerWithDirtyHeapWhenGettingRequiredSizeForStateBaseAddressCommandThenCorrectSizeIsReturned, IsDG2) {
|
||||
auto container = CommandContainer();
|
||||
container.setHeapDirty(HeapType::SURFACE_STATE);
|
||||
size_t size = EncodeStateBaseAddress<FamilyType>::getRequiredSizeForStateBaseAddress(*pDevice, container, false);
|
||||
EXPECT_EQ(size, 192ul);
|
||||
|
||||
auto &hwInfo = *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->getMutableHardwareInfo();
|
||||
|
||||
auto &productHelper = pDevice->getProductHelper();
|
||||
for (uint8_t revision : {REVISION_A0, REVISION_A1, REVISION_B, REVISION_C}) {
|
||||
hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(revision, hwInfo);
|
||||
auto expectedSize = 104ull;
|
||||
if (productHelper.isAdditionalStateBaseAddressWARequired(hwInfo)) {
|
||||
expectedSize += sizeof(typename FamilyType::STATE_BASE_ADDRESS);
|
||||
}
|
||||
size_t size = EncodeStateBaseAddress<FamilyType>::getRequiredSizeForStateBaseAddress(*pDevice, container, false);
|
||||
EXPECT_EQ(size, expectedSize);
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST2_F(DG2CommandEncoderTest, givenInterfaceDescriptorDataWhenForceThreadGroupDispatchSizeVariableIsDefaultThenThreadGroupDispatchSizeIsNotChanged, IsDG2) {
|
||||
|
||||
@@ -158,8 +158,6 @@ DG2TEST_F(ProductHelperTestDg2, givenDg2G10A0OrA1SteppingWhenAskingIfWAIsRequire
|
||||
hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(revision, hwInfo);
|
||||
hwInfo.platform.usDeviceID = deviceId;
|
||||
|
||||
productHelper.configureHardwareCustom(&hwInfo, nullptr);
|
||||
|
||||
auto expectedValue = DG2::isG10(hwInfo) && revision < REVISION_B;
|
||||
|
||||
EXPECT_EQ(expectedValue, productHelper.isDefaultEngineTypeAdjustmentRequired(hwInfo));
|
||||
@@ -169,6 +167,40 @@ DG2TEST_F(ProductHelperTestDg2, givenDg2G10A0OrA1SteppingWhenAskingIfWAIsRequire
|
||||
}
|
||||
}
|
||||
|
||||
DG2TEST_F(ProductHelperTestDg2, givenDg2G10WhenAskingForSBAWaThenReturnSuccessOnlyForBStepping) {
|
||||
auto &productHelper = getHelper<ProductHelper>();
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
for (uint8_t revision : {REVISION_A0, REVISION_A1, REVISION_B, REVISION_C}) {
|
||||
hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(revision, hwInfo);
|
||||
hwInfo.platform.usDeviceID = dg2G10DeviceIds[0];
|
||||
|
||||
auto expectedValue = revision == REVISION_B;
|
||||
EXPECT_EQ(expectedValue, productHelper.isAdditionalStateBaseAddressWARequired(hwInfo));
|
||||
}
|
||||
}
|
||||
|
||||
DG2TEST_F(ProductHelperTestDg2, givenDg2G11WhenAskingForSBAWaThenReturnSuccess) {
|
||||
auto &productHelper = getHelper<ProductHelper>();
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
for (uint8_t revision : {REVISION_A0, REVISION_A1, REVISION_B, REVISION_C}) {
|
||||
hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(revision, hwInfo);
|
||||
hwInfo.platform.usDeviceID = dg2G11DeviceIds[0];
|
||||
|
||||
EXPECT_TRUE(productHelper.isAdditionalStateBaseAddressWARequired(hwInfo));
|
||||
}
|
||||
}
|
||||
|
||||
DG2TEST_F(ProductHelperTestDg2, givenDg2G12WhenAskingForSBAWaThenReturnSuccess) {
|
||||
auto &productHelper = getHelper<ProductHelper>();
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
for (uint8_t revision : {REVISION_A0, REVISION_A1, REVISION_B, REVISION_C}) {
|
||||
hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(revision, hwInfo);
|
||||
hwInfo.platform.usDeviceID = dg2G12DeviceIds[0];
|
||||
|
||||
EXPECT_FALSE(productHelper.isAdditionalStateBaseAddressWARequired(hwInfo));
|
||||
}
|
||||
}
|
||||
|
||||
DG2TEST_F(ProductHelperTestDg2, givenProgramExtendedPipeControlPriorToNonPipelinedStateCommandEnabledWhenIsPipeControlPriorToNonPipelinedStateCommandsWARequiredIsCalledOnCcsThenTrueIsReturned) {
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.ProgramExtendedPipeControlPriorToNonPipelinedStateCommand.set(true);
|
||||
|
||||
Reference in New Issue
Block a user