fix: correct batch buffer level for debugger address tracking commands

Related-To: NEO-7807

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2023-05-18 15:34:42 +00:00
committed by Compute-Runtime-Automation
parent 50931b132b
commit 10bccdb32a
2 changed files with 27 additions and 1 deletions

View File

@@ -2800,7 +2800,7 @@ void CommandListCoreFamily<gfxCoreFamily>::programStateBaseAddress(NEO::CommandC
NEO::EncodeStateBaseAddress<GfxFamily>::setSbaTrackingForL0DebuggerIfEnabled(sbaTrackingEnabled,
*this->device->getNEODevice(),
*container.getCommandStream(),
sba, this->isFlushTaskSubmissionEnabled);
sba, (this->isFlushTaskSubmissionEnabled || this->dispatchCmdListBatchBufferAsPrimary));
}
template <GFXCORE_FAMILY gfxCoreFamily>

View File

@@ -279,9 +279,11 @@ HWTEST2_F(L0DebuggerTest, givenL0DebuggerAndDebuggerLogsDisabledWhenCommandQueue
HWTEST2_F(L0DebuggerTest, givenDebuggingEnabledWhenNonCopyCommandListIsInititalizedOrResetThenSSHAddressIsTracked, Gen12Plus) {
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
using MI_BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START;
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.EnableStateBaseAddressTracking.set(0);
DebugManager.flags.DispatchCmdlistCmdBufferPrimary.set(0);
size_t usedSpaceBefore = 0;
ze_result_t returnValue;
@@ -304,10 +306,34 @@ HWTEST2_F(L0DebuggerTest, givenDebuggingEnabledWhenNonCopyCommandListIsInititali
EXPECT_EQ(expectedGpuVa, sshGpuVa);
EXPECT_EQ(1u, getMockDebuggerL0Hw<FamilyType>()->captureStateBaseAddressCount);
auto bbStartList = findAll<MI_BATCH_BUFFER_START *>(cmdList.begin(), cmdList.end());
for (const auto &bbStartIt : bbStartList) {
auto bbStartCmd = reinterpret_cast<MI_BATCH_BUFFER_START *>(*bbStartIt);
EXPECT_EQ(MI_BATCH_BUFFER_START::SECOND_LEVEL_BATCH_BUFFER_SECOND_LEVEL_BATCH, bbStartCmd->getSecondLevelBatchBuffer());
}
commandList->reset();
EXPECT_EQ(2u, getMockDebuggerL0Hw<FamilyType>()->captureStateBaseAddressCount);
commandList->destroy();
DebugManager.flags.DispatchCmdlistCmdBufferPrimary.set(1);
commandListHandle = CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle();
commandList = CommandList::fromHandle(commandListHandle);
cmdList.clear();
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
cmdList,
commandList->getCmdContainer().getCommandStream()->getCpuBase(),
commandList->getCmdContainer().getCommandStream()->getUsed()));
bbStartList = findAll<MI_BATCH_BUFFER_START *>(cmdList.begin(), cmdList.end());
for (const auto &bbStartIt : bbStartList) {
auto bbStartCmd = reinterpret_cast<MI_BATCH_BUFFER_START *>(*bbStartIt);
EXPECT_EQ(MI_BATCH_BUFFER_START::SECOND_LEVEL_BATCH_BUFFER_FIRST_LEVEL_BATCH, bbStartCmd->getSecondLevelBatchBuffer());
}
commandList->destroy();
}
HWTEST2_F(L0DebuggerTest, givenDebuggingEnabledWhenCommandListIsExecutedThenSbaBufferIsPushedToResidencyContainer, Gen12Plus) {