From e0e19c24324afeebaa94ddcdc20da8839771e6c8 Mon Sep 17 00:00:00 2001 From: Maciej Dziuban Date: Mon, 29 Apr 2019 11:42:47 +0200 Subject: [PATCH] Change TBX 'coherence' terminology to 'download' Related-To: NEO-3054 Change-Id: Ic2d7fe76dc85b007acfe19ee2c29f8dd8539ccbc Signed-off-by: Maciej Dziuban --- runtime/command_stream/tbx_command_stream_receiver_hw.h | 2 +- runtime/command_stream/tbx_command_stream_receiver_hw.inl | 6 +++--- unit_tests/command_stream/tbx_command_stream_tests.cpp | 8 ++++---- unit_tests/mocks/mock_tbx_csr.h | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/runtime/command_stream/tbx_command_stream_receiver_hw.h b/runtime/command_stream/tbx_command_stream_receiver_hw.h index 002f2255f8..8018f0fe89 100644 --- a/runtime/command_stream/tbx_command_stream_receiver_hw.h +++ b/runtime/command_stream/tbx_command_stream_receiver_hw.h @@ -39,7 +39,7 @@ class TbxCommandStreamReceiverHw : public CommandStreamReceiverSimulatedHw::initAdditionalMMIO; diff --git a/runtime/command_stream/tbx_command_stream_receiver_hw.inl b/runtime/command_stream/tbx_command_stream_receiver_hw.inl index 74f0ce784c..d9af8c5acc 100644 --- a/runtime/command_stream/tbx_command_stream_receiver_hw.inl +++ b/runtime/command_stream/tbx_command_stream_receiver_hw.inl @@ -390,11 +390,11 @@ void TbxCommandStreamReceiverHw::waitForTaskCountWithKmdNotifyFallbac this->flushBatchedSubmissions(); while (*this->getTagAddress() < this->latestFlushedTaskCount) { - makeCoherent(*this->getTagAllocation()); + downloadAllocation(*this->getTagAllocation()); } for (GraphicsAllocation *graphicsAllocation : this->allocationsForDownload) { - makeCoherent(*graphicsAllocation); + downloadAllocation(*graphicsAllocation); } this->allocationsForDownload.clear(); @@ -418,7 +418,7 @@ void TbxCommandStreamReceiverHw::processResidency(ResidencyContainer } template -void TbxCommandStreamReceiverHw::makeCoherent(GraphicsAllocation &gfxAllocation) { +void TbxCommandStreamReceiverHw::downloadAllocation(GraphicsAllocation &gfxAllocation) { if (hardwareContextController) { hardwareContextController->readMemory(gfxAllocation.getGpuAddress(), gfxAllocation.getUnderlyingBuffer(), gfxAllocation.getUnderlyingBufferSize(), this->getMemoryBank(&gfxAllocation), MemoryConstants::pageSize64k); diff --git a/unit_tests/command_stream/tbx_command_stream_tests.cpp b/unit_tests/command_stream/tbx_command_stream_tests.cpp index 2328545d8b..f940e73a8f 100644 --- a/unit_tests/command_stream/tbx_command_stream_tests.cpp +++ b/unit_tests/command_stream/tbx_command_stream_tests.cpp @@ -318,7 +318,7 @@ HWTEST_F(TbxCommandStreamTests, givenDbgDeviceIdFlagIsSetWhenTbxCsrIsCreatedThen EXPECT_EQ(9u, tbxCsr->aubDeviceId); } -HWTEST_F(TbxCommandSteamSimpleTest, givenTbxCsrWhenCallingMakeSurfacePackNonResidentThenOnlyResidentAllocationsAreScheduledForCoherence) { +HWTEST_F(TbxCommandSteamSimpleTest, givenTbxCsrWhenCallingMakeSurfacePackNonResidentThenOnlyResidentAllocationsAddedAllocationsForDownload) { MockTbxCsr tbxCsr{*pDevice->executionEnvironment}; MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false); tbxCsr.setupContext(osContext); @@ -343,7 +343,7 @@ HWTEST_F(TbxCommandSteamSimpleTest, givenTbxCsrWhenCallingWaitForTaskCountWithKm struct MockTbxCsr : TbxCommandStreamReceiverHw { using CommandStreamReceiver::latestFlushedTaskCount; using TbxCommandStreamReceiverHw::TbxCommandStreamReceiverHw; - void makeCoherent(GraphicsAllocation &gfxAllocation) override { + void downloadAllocation(GraphicsAllocation &gfxAllocation) override { *reinterpret_cast(CommandStreamReceiver::getTagAllocation()->getUnderlyingBuffer()) = this->latestFlushedTaskCount; downloadedAllocations.insert(&gfxAllocation); } @@ -479,14 +479,14 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenMakeResidentIsC EXPECT_TRUE(tbxCsr.writeMemoryWithAubManagerCalled); } -HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenMakeCoherentIsCalledThenItShouldCallTheExpectedHwContextFunctions) { +HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenDownloadAllocationIsCalledThenItShouldCallTheExpectedHwContextFunctions) { MockTbxCsr tbxCsr(*pDevice->executionEnvironment); MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false); tbxCsr.setupContext(osContext); auto mockHardwareContext = static_cast(tbxCsr.hardwareContextController->hardwareContexts[0].get()); MockGraphicsAllocation allocation(reinterpret_cast(0x1000), 0x1000); - tbxCsr.makeCoherent(allocation); + tbxCsr.downloadAllocation(allocation); EXPECT_TRUE(mockHardwareContext->readMemoryCalled); } diff --git a/unit_tests/mocks/mock_tbx_csr.h b/unit_tests/mocks/mock_tbx_csr.h index 25c23c2ae9..22b1c3f0a4 100644 --- a/unit_tests/mocks/mock_tbx_csr.h +++ b/unit_tests/mocks/mock_tbx_csr.h @@ -49,8 +49,8 @@ class MockTbxCsr : public TbxCommandStreamReceiverHw { TbxCommandStreamReceiverHw::pollForCompletion(); pollForCompletionCalled = true; } - void makeCoherent(GraphicsAllocation &gfxAllocation) override { - TbxCommandStreamReceiverHw::makeCoherent(gfxAllocation); + void downloadAllocation(GraphicsAllocation &gfxAllocation) override { + TbxCommandStreamReceiverHw::downloadAllocation(gfxAllocation); makeCoherentCalled = true; } bool initializeEngineCalled = false;