Fill leftover cmdbuffer space with MI_NOOPs in debugger and sw tag paths

Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
Related-To: NEO-7156
This commit is contained in:
Kamil Kopryk
2022-09-08 15:43:26 +00:00
committed by Compute-Runtime-Automation
parent c2cd1a2698
commit fad4bee432
5 changed files with 74 additions and 2 deletions

View File

@@ -156,7 +156,7 @@ struct CommandQueueHw : public CommandQueueImp {
inline void assignCsrTaskCountToFenceIfAvailable(ze_fence_handle_t hFence);
inline void dispatchTaskCountPostSyncRegular(bool isDispatchTaskCountPostSyncRequired, NEO::LinearStream &commandStream);
inline void dispatchTaskCountPostSyncByMiFlushDw(bool isDispatchTaskCountPostSyncRequired, NEO::LinearStream &commandStream);
inline NEO::SubmissionStatus prepareAndSubmitBatchBuffer(CommandListExecutionContext &ctx, NEO::LinearStream &innerCommandStream);
NEO::SubmissionStatus prepareAndSubmitBatchBuffer(CommandListExecutionContext &ctx, NEO::LinearStream &innerCommandStream);
inline void updateTaskCountAndPostSync(bool isDispatchTaskCountPostSyncRequired);
inline ze_result_t waitForCommandQueueCompletionAndCleanHeapContainer();
inline ze_result_t handleSubmissionAndCompletionResults(NEO::SubmissionStatus submitRet, ze_result_t completionRet);

View File

@@ -1017,7 +1017,15 @@ NEO::SubmissionStatus CommandQueueHw<gfxCoreFamily>::prepareAndSubmitBatchBuffer
*(MI_BATCH_BUFFER_END *)buffer = GfxFamily::cmdInitBatchBufferEnd;
}
if (this->alignedChildStreamPadding) {
if (ctx.isNEODebuggerActive(this->device) || NEO::DebugManager.flags.EnableSWTags.get()) {
auto leftoverSpace = outerCommandStream.getUsed() - innerCommandStream.getUsed();
leftoverSpace -= ptrDiff(innerCommandStream.getCpuBase(), outerCommandStream.getCpuBase());
if (leftoverSpace > 0) {
auto memory = innerCommandStream.getSpace(leftoverSpace);
memset(memory, 0, leftoverSpace);
}
} else if (this->alignedChildStreamPadding) {
void *paddingPtr = innerCommandStream.getSpace(this->alignedChildStreamPadding);
memset(paddingPtr, 0, this->alignedChildStreamPadding);
}