[fix] reset base address properties when command list is reset

Related-To: NEO-5055

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz 2023-03-13 11:13:31 +00:00 committed by Compute-Runtime-Automation
parent 8be1a3edb6
commit 7e8794717a
3 changed files with 47 additions and 0 deletions

View File

@ -89,6 +89,11 @@ void CommandListCoreFamily<gfxCoreFamily>::postInitComputeSetup() {
setStreamPropertiesDefaultSettings(requiredStreamState);
setStreamPropertiesDefaultSettings(finalStreamState);
currentSurfaceStateBaseAddress = NEO::StreamProperty64::initValue;
currentDynamicStateBaseAddress = NEO::StreamProperty64::initValue;
currentIndirectObjectBaseAddress = NEO::StreamProperty64::initValue;
currentBindingTablePoolBaseAddress = NEO::StreamProperty64::initValue;
}
template <GFXCORE_FAMILY gfxCoreFamily>

View File

@ -54,6 +54,10 @@ struct WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>
using BaseClass::containsAnyKernel;
using BaseClass::containsCooperativeKernelsFlag;
using BaseClass::csr;
using BaseClass::currentBindingTablePoolBaseAddress;
using BaseClass::currentDynamicStateBaseAddress;
using BaseClass::currentIndirectObjectBaseAddress;
using BaseClass::currentSurfaceStateBaseAddress;
using BaseClass::device;
using BaseClass::doubleSbaWa;
using BaseClass::engineGroupType;
@ -199,6 +203,10 @@ struct WhiteBox<::L0::CommandList> : public ::L0::CommandListImp {
using BaseClass::commandContainer;
using BaseClass::commandListPreemptionMode;
using BaseClass::csr;
using BaseClass::currentBindingTablePoolBaseAddress;
using BaseClass::currentDynamicStateBaseAddress;
using BaseClass::currentIndirectObjectBaseAddress;
using BaseClass::currentSurfaceStateBaseAddress;
using BaseClass::device;
using BaseClass::doubleSbaWa;
using BaseClass::finalStreamState;

View File

@ -2341,5 +2341,39 @@ HWTEST2_F(CommandListStateBaseAddressPrivateHeapTest,
cmdQueueHw->destroy();
}
HWTEST2_F(CommandListStateBaseAddressPrivateHeapTest,
givenCommandListAppendsKernelWhenCommandListIsResetThenBaseAddressPropertiesAreResetToo,
IsAtLeastSkl) {
ze_group_count_t groupCount{1, 1, 1};
CmdListKernelLaunchParams launchParams = {};
auto result = commandList->appendLaunchKernel(kernel->toHandle(), &groupCount, nullptr, 0, nullptr, launchParams, false);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
result = commandList->close();
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
auto &container = commandList->getCmdContainer();
auto indirectBaseAddress = container.getIndirectHeap(NEO::HeapType::INDIRECT_OBJECT)->getHeapGpuBase();
auto surfaceBaseAddress = container.getIndirectHeap(NEO::HeapType::SURFACE_STATE)->getHeapGpuBase();
auto dynamicBaseAddress = static_cast<uint64_t>(NEO::StreamProperty64::initValue);
if (dshRequired) {
dynamicBaseAddress = container.getIndirectHeap(NEO::HeapType::DYNAMIC_STATE)->getHeapGpuBase();
}
EXPECT_EQ(static_cast<int64_t>(indirectBaseAddress), commandList->currentIndirectObjectBaseAddress);
EXPECT_EQ(static_cast<int64_t>(surfaceBaseAddress), commandList->currentSurfaceStateBaseAddress);
EXPECT_EQ(static_cast<int64_t>(surfaceBaseAddress), commandList->currentBindingTablePoolBaseAddress);
EXPECT_EQ(static_cast<int64_t>(dynamicBaseAddress), commandList->currentDynamicStateBaseAddress);
result = commandList->reset();
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_EQ(NEO::StreamProperty64::initValue, commandList->currentIndirectObjectBaseAddress);
EXPECT_EQ(NEO::StreamProperty64::initValue, commandList->currentSurfaceStateBaseAddress);
EXPECT_EQ(NEO::StreamProperty64::initValue, commandList->currentBindingTablePoolBaseAddress);
EXPECT_EQ(NEO::StreamProperty64::initValue, commandList->currentDynamicStateBaseAddress);
}
} // namespace ult
} // namespace L0