Dont call virtual method in CSR destructor

Change-Id: Idccea2ad8f5bc6ff9933e4f9f1f0549db5ce6a99
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2019-12-17 10:35:25 +01:00
committed by sys_ocldev
parent 3ff5deaae9
commit 211ba8adcb
5 changed files with 9 additions and 10 deletions

View File

@@ -148,10 +148,10 @@ void CommandQueue::waitUntilComplete(uint32_t taskCountToWait, FlushStamp flushS
if (auto bcsCsr = getBcsCommandStreamReceiver()) {
bcsCsr->waitForTaskCountWithKmdNotifyFallback(bcsTaskCount, 0, false, false);
bcsCsr->waitForTaskCountAndCleanAllocationList(bcsTaskCount, TEMPORARY_ALLOCATION);
bcsCsr->waitForTaskCountAndCleanTemporaryAllocationList(bcsTaskCount);
}
getGpgpuCommandStreamReceiver().waitForTaskCountAndCleanAllocationList(taskCountToWait, TEMPORARY_ALLOCATION);
getGpgpuCommandStreamReceiver().waitForTaskCountAndCleanTemporaryAllocationList(taskCountToWait);
WAIT_LEAVE()
}

View File

@@ -116,6 +116,10 @@ void CommandStreamReceiver::waitForTaskCountAndCleanAllocationList(uint32_t requ
internalAllocationStorage->cleanAllocationList(requiredTaskCount, allocationUsage);
}
void CommandStreamReceiver::waitForTaskCountAndCleanTemporaryAllocationList(uint32_t requiredTaskCount) {
waitForTaskCountAndCleanAllocationList(requiredTaskCount, TEMPORARY_ALLOCATION);
};
void CommandStreamReceiver::ensureCommandBufferAllocation(LinearStream &commandStream, size_t minimumRequiredSize, size_t additionalAllocationSize) {
if (commandStream.getAvailableSpace() >= minimumRequiredSize) {
return;

View File

@@ -88,7 +88,8 @@ class CommandStreamReceiver {
virtual GmmPageTableMngr *createPageTableManager() { return nullptr; }
MOCKABLE_VIRTUAL void waitForTaskCountAndCleanAllocationList(uint32_t requiredTaskCount, uint32_t allocationUsage);
void waitForTaskCountAndCleanAllocationList(uint32_t requiredTaskCount, uint32_t allocationUsage);
MOCKABLE_VIRTUAL void waitForTaskCountAndCleanTemporaryAllocationList(uint32_t requiredTaskCount);
LinearStream &getCS(size_t minRequiredSize = 1024u);
OSInterface *getOSInterface() const { return osInterface; };

View File

@@ -687,7 +687,7 @@ struct BcsBufferTests : public ::testing::Test {
waitForTaskCountWithKmdNotifyFallbackCalled++;
}
void waitForTaskCountAndCleanAllocationList(uint32_t requiredTaskCount, uint32_t allocationUsage) override {
void waitForTaskCountAndCleanTemporaryAllocationList(uint32_t requiredTaskCount) override {
EXPECT_EQ(1u, waitForTaskCountWithKmdNotifyFallbackCalled);
EXPECT_EQ(this->latestFlushedTaskCount, requiredTaskCount);
waitForTaskCountAndCleanAllocationListCalled++;

View File

@@ -78,17 +78,11 @@ class MockCsrBase : public UltCommandStreamReceiver<GfxFamily> {
processEvictionCalled = true;
}
void waitForTaskCountAndCleanAllocationList(uint32_t requiredTaskCount, uint32_t allocationUsage) override {
waitForTaskCountRequiredTaskCount = requiredTaskCount;
BaseUltCsrClass::waitForTaskCountAndCleanAllocationList(requiredTaskCount, allocationUsage);
}
ResidencyContainer madeResidentGfxAllocations;
ResidencyContainer madeNonResidentGfxAllocations;
int32_t *executionStamp;
int32_t flushTaskStamp;
bool processEvictionCalled = false;
uint32_t waitForTaskCountRequiredTaskCount = 0;
};
template <typename GfxFamily>