From aafebb2e8512a9d3412eb428bcb4ef75746009f2 Mon Sep 17 00:00:00 2001 From: "Dunajski, Bartosz" Date: Mon, 25 Nov 2019 18:37:19 +0100 Subject: [PATCH] Skip dumping aub allocations on BCS engine Change-Id: I7d1cf3b0a0d6e16fd2df2fad1ba5e71dfe04ae23 Signed-off-by: Dunajski, Bartosz --- .../aub_command_stream_receiver_hw_base.inl | 5 ++++ runtime/helpers/engine_node_helper.cpp | 4 ++++ runtime/helpers/engine_node_helper.h | 1 + .../aub_command_stream_receiver_2_tests.cpp | 23 +++++++++++++++++++ 4 files changed, 33 insertions(+) diff --git a/runtime/command_stream/aub_command_stream_receiver_hw_base.inl b/runtime/command_stream/aub_command_stream_receiver_hw_base.inl index 00fd3b3ff0..ac2ef12ef9 100644 --- a/runtime/command_stream/aub_command_stream_receiver_hw_base.inl +++ b/runtime/command_stream/aub_command_stream_receiver_hw_base.inl @@ -22,6 +22,7 @@ #include "runtime/command_stream/aub_subcapture.h" #include "runtime/command_stream/command_stream_receiver.h" #include "runtime/execution_environment/execution_environment.h" +#include "runtime/helpers/engine_node_helper.h" #include "runtime/helpers/hardware_context_controller.h" #include "runtime/helpers/neo_driver_version.h" #include "runtime/memory_manager/memory_banks.h" @@ -728,6 +729,10 @@ void AUBCommandStreamReceiverHw::processResidency(const ResidencyCont template void AUBCommandStreamReceiverHw::dumpAllocation(GraphicsAllocation &gfxAllocation) { + if (isBcs(this->osContext->getEngineType())) { + return; + } + if (DebugManager.flags.AUBDumpAllocsOnEnqueueReadOnly.get()) { if (!gfxAllocation.isAllocDumpable()) { return; diff --git a/runtime/helpers/engine_node_helper.cpp b/runtime/helpers/engine_node_helper.cpp index b20db38b9a..bdefc901da 100644 --- a/runtime/helpers/engine_node_helper.cpp +++ b/runtime/helpers/engine_node_helper.cpp @@ -13,4 +13,8 @@ bool isCcs(aub_stream::EngineType engineType) { return engineType == aub_stream::ENGINE_CCS; } +bool isBcs(aub_stream::EngineType engineType) { + return engineType == aub_stream::ENGINE_BCS; +} + } // namespace NEO diff --git a/runtime/helpers/engine_node_helper.h b/runtime/helpers/engine_node_helper.h index a5e113b489..6c379e79e3 100644 --- a/runtime/helpers/engine_node_helper.h +++ b/runtime/helpers/engine_node_helper.h @@ -12,5 +12,6 @@ namespace NEO { bool isCcs(aub_stream::EngineType engineType); +bool isBcs(aub_stream::EngineType engineType); } // namespace NEO diff --git a/unit_tests/command_stream/aub_command_stream_receiver_2_tests.cpp b/unit_tests/command_stream/aub_command_stream_receiver_2_tests.cpp index 4ad4a78f69..73b7de3251 100644 --- a/unit_tests/command_stream/aub_command_stream_receiver_2_tests.cpp +++ b/unit_tests/command_stream/aub_command_stream_receiver_2_tests.cpp @@ -889,6 +889,29 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationWritableWhenDumpA memoryManager->freeGraphicsMemory(gfxAllocation); } +HWTEST_F(AubCommandStreamReceiverTests, givenBcsEngineWhenDumpAllocationCalledThenIgnore) { + DebugManagerStateRestore dbgRestore; + DebugManager.flags.AUBDumpBufferFormat.set("BIN"); + + MockAubCsr aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex()); + MockOsContext osContext(0, 1, aub_stream::ENGINE_BCS, PreemptionMode::Disabled, false); + aubCsr.setupContext(osContext); + + auto mockHardwareContext = static_cast(aubCsr.hardwareContextController->hardwareContexts[0].get()); + + auto memoryManager = pDevice->getMemoryManager(); + auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER}); + gfxAllocation->setMemObjectsAllocationWithWritableFlags(true); + EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation)); + + aubCsr.dumpAllocation(*gfxAllocation); + + EXPECT_FALSE(mockHardwareContext->dumpSurfaceCalled); + EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation)); + + memoryManager->freeGraphicsMemory(gfxAllocation); +} + HWTEST_F(AubCommandStreamReceiverTests, givenCompressedGraphicsAllocationWritableWhenDumpAllocationIsCalledAndDumpFormatIsSpecifiedThenGraphicsAllocationShouldBeDumped) { DebugManagerStateRestore dbgRestore; DebugManager.flags.AUBDumpBufferFormat.set("TRE");