Change TBX 'coherence' terminology to 'download'

Related-To: NEO-3054
Change-Id: Ic2d7fe76dc85b007acfe19ee2c29f8dd8539ccbc
Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
This commit is contained in:
Maciej Dziuban
2019-04-29 11:42:47 +02:00
committed by sys_ocldev
parent d106980df6
commit e0e19c2432
4 changed files with 10 additions and 10 deletions

View File

@@ -39,7 +39,7 @@ class TbxCommandStreamReceiverHw : public CommandStreamReceiverSimulatedHw<GfxFa
uint32_t getMaskAndValueForPollForCompletion() const; uint32_t getMaskAndValueForPollForCompletion() const;
bool getpollNotEqualValueForPollForCompletion() const; bool getpollNotEqualValueForPollForCompletion() const;
MOCKABLE_VIRTUAL void makeCoherent(GraphicsAllocation &gfxAllocation); MOCKABLE_VIRTUAL void downloadAllocation(GraphicsAllocation &gfxAllocation);
public: public:
using CommandStreamReceiverSimulatedCommonHw<GfxFamily>::initAdditionalMMIO; using CommandStreamReceiverSimulatedCommonHw<GfxFamily>::initAdditionalMMIO;

View File

@@ -390,11 +390,11 @@ void TbxCommandStreamReceiverHw<GfxFamily>::waitForTaskCountWithKmdNotifyFallbac
this->flushBatchedSubmissions(); this->flushBatchedSubmissions();
while (*this->getTagAddress() < this->latestFlushedTaskCount) { while (*this->getTagAddress() < this->latestFlushedTaskCount) {
makeCoherent(*this->getTagAllocation()); downloadAllocation(*this->getTagAllocation());
} }
for (GraphicsAllocation *graphicsAllocation : this->allocationsForDownload) { for (GraphicsAllocation *graphicsAllocation : this->allocationsForDownload) {
makeCoherent(*graphicsAllocation); downloadAllocation(*graphicsAllocation);
} }
this->allocationsForDownload.clear(); this->allocationsForDownload.clear();
@@ -418,7 +418,7 @@ void TbxCommandStreamReceiverHw<GfxFamily>::processResidency(ResidencyContainer
} }
template <typename GfxFamily> template <typename GfxFamily>
void TbxCommandStreamReceiverHw<GfxFamily>::makeCoherent(GraphicsAllocation &gfxAllocation) { void TbxCommandStreamReceiverHw<GfxFamily>::downloadAllocation(GraphicsAllocation &gfxAllocation) {
if (hardwareContextController) { if (hardwareContextController) {
hardwareContextController->readMemory(gfxAllocation.getGpuAddress(), gfxAllocation.getUnderlyingBuffer(), gfxAllocation.getUnderlyingBufferSize(), hardwareContextController->readMemory(gfxAllocation.getGpuAddress(), gfxAllocation.getUnderlyingBuffer(), gfxAllocation.getUnderlyingBufferSize(),
this->getMemoryBank(&gfxAllocation), MemoryConstants::pageSize64k); this->getMemoryBank(&gfxAllocation), MemoryConstants::pageSize64k);

View File

@@ -318,7 +318,7 @@ HWTEST_F(TbxCommandStreamTests, givenDbgDeviceIdFlagIsSetWhenTbxCsrIsCreatedThen
EXPECT_EQ(9u, tbxCsr->aubDeviceId); EXPECT_EQ(9u, tbxCsr->aubDeviceId);
} }
HWTEST_F(TbxCommandSteamSimpleTest, givenTbxCsrWhenCallingMakeSurfacePackNonResidentThenOnlyResidentAllocationsAreScheduledForCoherence) { HWTEST_F(TbxCommandSteamSimpleTest, givenTbxCsrWhenCallingMakeSurfacePackNonResidentThenOnlyResidentAllocationsAddedAllocationsForDownload) {
MockTbxCsr<FamilyType> tbxCsr{*pDevice->executionEnvironment}; MockTbxCsr<FamilyType> tbxCsr{*pDevice->executionEnvironment};
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false); MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
tbxCsr.setupContext(osContext); tbxCsr.setupContext(osContext);
@@ -343,7 +343,7 @@ HWTEST_F(TbxCommandSteamSimpleTest, givenTbxCsrWhenCallingWaitForTaskCountWithKm
struct MockTbxCsr : TbxCommandStreamReceiverHw<FamilyType> { struct MockTbxCsr : TbxCommandStreamReceiverHw<FamilyType> {
using CommandStreamReceiver::latestFlushedTaskCount; using CommandStreamReceiver::latestFlushedTaskCount;
using TbxCommandStreamReceiverHw<FamilyType>::TbxCommandStreamReceiverHw; using TbxCommandStreamReceiverHw<FamilyType>::TbxCommandStreamReceiverHw;
void makeCoherent(GraphicsAllocation &gfxAllocation) override { void downloadAllocation(GraphicsAllocation &gfxAllocation) override {
*reinterpret_cast<uint32_t *>(CommandStreamReceiver::getTagAllocation()->getUnderlyingBuffer()) = this->latestFlushedTaskCount; *reinterpret_cast<uint32_t *>(CommandStreamReceiver::getTagAllocation()->getUnderlyingBuffer()) = this->latestFlushedTaskCount;
downloadedAllocations.insert(&gfxAllocation); downloadedAllocations.insert(&gfxAllocation);
} }
@@ -479,14 +479,14 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenMakeResidentIsC
EXPECT_TRUE(tbxCsr.writeMemoryWithAubManagerCalled); EXPECT_TRUE(tbxCsr.writeMemoryWithAubManagerCalled);
} }
HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenMakeCoherentIsCalledThenItShouldCallTheExpectedHwContextFunctions) { HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenDownloadAllocationIsCalledThenItShouldCallTheExpectedHwContextFunctions) {
MockTbxCsr<FamilyType> tbxCsr(*pDevice->executionEnvironment); MockTbxCsr<FamilyType> tbxCsr(*pDevice->executionEnvironment);
MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false); MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false);
tbxCsr.setupContext(osContext); tbxCsr.setupContext(osContext);
auto mockHardwareContext = static_cast<MockHardwareContext *>(tbxCsr.hardwareContextController->hardwareContexts[0].get()); auto mockHardwareContext = static_cast<MockHardwareContext *>(tbxCsr.hardwareContextController->hardwareContexts[0].get());
MockGraphicsAllocation allocation(reinterpret_cast<void *>(0x1000), 0x1000); MockGraphicsAllocation allocation(reinterpret_cast<void *>(0x1000), 0x1000);
tbxCsr.makeCoherent(allocation); tbxCsr.downloadAllocation(allocation);
EXPECT_TRUE(mockHardwareContext->readMemoryCalled); EXPECT_TRUE(mockHardwareContext->readMemoryCalled);
} }

View File

@@ -49,8 +49,8 @@ class MockTbxCsr : public TbxCommandStreamReceiverHw<GfxFamily> {
TbxCommandStreamReceiverHw<GfxFamily>::pollForCompletion(); TbxCommandStreamReceiverHw<GfxFamily>::pollForCompletion();
pollForCompletionCalled = true; pollForCompletionCalled = true;
} }
void makeCoherent(GraphicsAllocation &gfxAllocation) override { void downloadAllocation(GraphicsAllocation &gfxAllocation) override {
TbxCommandStreamReceiverHw<GfxFamily>::makeCoherent(gfxAllocation); TbxCommandStreamReceiverHw<GfxFamily>::downloadAllocation(gfxAllocation);
makeCoherentCalled = true; makeCoherentCalled = true;
} }
bool initializeEngineCalled = false; bool initializeEngineCalled = false;