From 7fc7fbfc47465f6c7963e32c78e8a95ed99059f4 Mon Sep 17 00:00:00 2001 From: Bartosz Dunajski Date: Wed, 7 Aug 2024 12:44:39 +0000 Subject: [PATCH] refactor: improve ulls prints Signed-off-by: Bartosz Dunajski --- .../direct_submission/direct_submission_hw.inl | 12 ++++++++++-- .../direct_submission/direct_submission_tests_2.cpp | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/shared/source/direct_submission/direct_submission_hw.inl b/shared/source/direct_submission/direct_submission_hw.inl index 92eda88518..3ee337d7f9 100644 --- a/shared/source/direct_submission/direct_submission_hw.inl +++ b/shared/source/direct_submission/direct_submission_hw.inl @@ -665,6 +665,7 @@ void DirectSubmissionHw::updateRelaxedOrderingQueueSize(u template void *DirectSubmissionHw::dispatchWorkloadSection(BatchBuffer &batchBuffer, bool dispatchMonitorFence) { void *currentPosition = ringCommandStream.getSpace(0); + auto copyCmdBuffer = this->copyCommandBufferIntoRing(batchBuffer); if (debugManager.flags.DirectSubmissionPrintBuffers.get()) { printf("Client buffer:\n"); @@ -681,6 +682,15 @@ void *DirectSubmissionHw::dispatchWorkloadSection(BatchBu ptrOffset(batchBuffer.commandBufferAllocation->getUnderlyingBuffer(), batchBuffer.usedSize), batchBuffer.startOffset, batchBuffer.usedSize); + printf("Ring buffer for submission - start gpu address: %" PRIx64 " - %" PRIx64 ", start cpu address: %p - %p, size: %zu, submission address: %" PRIx64 ", used size: %zu, copyCmdBuffer: %d \n", + ringCommandStream.getGraphicsAllocation()->getGpuAddress(), + ptrOffset(ringCommandStream.getGraphicsAllocation()->getGpuAddress(), ringCommandStream.getGraphicsAllocation()->getUnderlyingBufferSize()), + ringCommandStream.getGraphicsAllocation()->getUnderlyingBuffer(), + ptrOffset(ringCommandStream.getGraphicsAllocation()->getUnderlyingBuffer(), ringCommandStream.getGraphicsAllocation()->getUnderlyingBufferSize()), + ringCommandStream.getGraphicsAllocation()->getUnderlyingBufferSize(), + ptrOffset(ringCommandStream.getGraphicsAllocation()->getGpuAddress(), ringCommandStream.getUsed()), + ringCommandStream.getUsed(), + copyCmdBuffer); } if (!batchBuffer.pagingFenceSemInfo.requiresBlockingResidencyHandling) { @@ -698,8 +708,6 @@ void *DirectSubmissionHw::dispatchWorkloadSection(BatchBu relaxedOrderingReturnPtrCmdStream.replaceBuffer(relaxedOrderingReturnPtrCmds, RelaxedOrderingHelper::getSizeReturnPtrRegs()); } - auto copyCmdBuffer = this->copyCommandBufferIntoRing(batchBuffer); - if (copyCmdBuffer) { auto cmdStreamTaskPtr = ptrOffset(batchBuffer.stream->getCpuBase(), batchBuffer.startOffset); auto sizeToCopy = ptrDiff(returnCmd, cmdStreamTaskPtr); diff --git a/shared/test/unit_test/direct_submission/direct_submission_tests_2.cpp b/shared/test/unit_test/direct_submission/direct_submission_tests_2.cpp index ea1c1439a3..7377213739 100644 --- a/shared/test/unit_test/direct_submission/direct_submission_tests_2.cpp +++ b/shared/test/unit_test/direct_submission/direct_submission_tests_2.cpp @@ -783,6 +783,8 @@ HWTEST_F(DirectSubmissionDispatchBufferTest, givenDirectSubmissionPrintBuffersWh EXPECT_TRUE(pos != std::string::npos); pos = output.find("Client buffer"); EXPECT_TRUE(pos != std::string::npos); + pos = output.find("Ring buffer for submission"); + EXPECT_TRUE(pos != std::string::npos); } HWCMDTEST_F(IGFX_XE_HP_CORE, DirectSubmissionDispatchBufferTest,