Do not program SBA for copy engine

Doing so causes hangs when reusing a copy command list

Change-Id: I1bd069942e9caee01636497f992dd35cbedcde1b
Signed-off-by: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@intel.com>
This commit is contained in:
Aravind Gopalakrishnan
2020-09-22 15:54:01 -07:00
parent 7c0af5da55
commit 72c91c2f13
3 changed files with 27 additions and 1 deletions

View File

@@ -1592,7 +1592,9 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::reset() {
removeHostPtrAllocations();
commandContainer.reset();
programStateBaseAddress(commandContainer);
if (!isCopyOnly()) {
programStateBaseAddress(commandContainer);
}
return ZE_RESULT_SUCCESS;
}

View File

@@ -363,6 +363,22 @@ HWTEST_F(CommandListCreate, givenCommandListWithCopyOnlyWhenSetBarrierThenMiFlus
EXPECT_NE(cmdList.end(), itor);
}
HWTEST_F(CommandListCreate, givenCommandListWithCopyOnlyWhenResetThenStateBaseAddressNotProgrammed) {
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
ze_result_t returnValue;
std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::Copy, returnValue));
auto &commandContainer = commandList->commandContainer;
commandList->reset();
GenCmdList cmdList;
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
cmdList, ptrOffset(commandContainer.getCommandStream()->getCpuBase(), 0), commandContainer.getCommandStream()->getUsed()));
auto itor = find<STATE_BASE_ADDRESS *>(cmdList.begin(), cmdList.end());
EXPECT_EQ(cmdList.end(), itor);
}
HWTEST_F(CommandListCreate, givenCommandListWhenSetBarrierThenPipeControlIsProgrammed) {
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
ze_result_t returnValue;

View File

@@ -463,6 +463,7 @@ HWTEST_F(CommandListAppendLaunchKernel, givenIndirectDispatchWhenAppendingThenWo
}
HWTEST_F(CommandListAppendLaunchKernel, givenCommandListWhenResetCalledThenStateIsCleaned) {
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
createKernel();
ze_result_t returnValue;
@@ -512,6 +513,13 @@ HWTEST_F(CommandListAppendLaunchKernel, givenCommandListWhenResetCalledThenState
ASSERT_EQ(commandListControl->commandContainer.isHeapDirty(heapType), commandList->commandContainer.isHeapDirty(heapType));
}
GenCmdList cmdList;
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
cmdList, ptrOffset(commandList->commandContainer.getCommandStream()->getCpuBase(), 0), commandList->commandContainer.getCommandStream()->getUsed()));
auto itor = find<STATE_BASE_ADDRESS *>(cmdList.begin(), cmdList.end());
EXPECT_NE(cmdList.end(), itor);
}
HWTEST_F(CommandListAppendLaunchKernel, WhenAddingKernelsThenResidencyContainerDoesNotContainDuplicatesAfterClosingCommandList) {