Change CommandStreamReceiver::flush() argument to a reference

Change-Id: Ic933a297d4c4e243138d0d62323ba82a8b91240f
Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
This commit is contained in:
Maciej Dziuban
2018-09-25 12:38:00 +02:00
committed by sys_ocldev
parent cd252b84a0
commit f48b90ffee
25 changed files with 106 additions and 119 deletions

View File

@@ -55,7 +55,7 @@ struct AUBFixture : public AUBCommandStreamFixture,
CommandStreamReceiverHw<FamilyType>::alignToCacheLine(*pCS);
BatchBuffer batchBuffer{pCS->getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, pCS->getUsed(), pCS};
ResidencyContainer allocationsForResidency;
pCommandStreamReceiver->flush(batchBuffer, engineType, &allocationsForResidency, *pDevice->getOsContext());
pCommandStreamReceiver->flush(batchBuffer, engineType, allocationsForResidency, *pDevice->getOsContext());
auto mmioBase = AUBCommandStreamReceiverHw<FamilyType>::getCsTraits(engineType).mmioBase;
AUBCommandStreamFixture::expectMMIO<FamilyType>(mmioBase + 0x2094, noopId);
@@ -69,10 +69,10 @@ HWTEST_F(AUBcommandstreamTests, testFlushTwice) {
CommandStreamReceiverHw<FamilyType>::alignToCacheLine(*pCS);
BatchBuffer batchBuffer{pCS->getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, pCS->getUsed(), pCS};
ResidencyContainer allocationsForResidency;
pCommandStreamReceiver->flush(batchBuffer, EngineType::ENGINE_RCS, &allocationsForResidency, *pDevice->getOsContext());
pCommandStreamReceiver->flush(batchBuffer, EngineType::ENGINE_RCS, allocationsForResidency, *pDevice->getOsContext());
BatchBuffer batchBuffer2{pCS->getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, pCS->getUsed(), pCS};
ResidencyContainer allocationsForResidency2;
pCommandStreamReceiver->flush(batchBuffer2, EngineType::ENGINE_RCS, &allocationsForResidency, *pDevice->getOsContext());
pCommandStreamReceiver->flush(batchBuffer2, EngineType::ENGINE_RCS, allocationsForResidency, *pDevice->getOsContext());
}
HWTEST_F(AUBcommandstreamTests, testNoopIdRcs) {

View File

@@ -25,7 +25,7 @@ class CommandStreamReceiverDrmMock : public UltCommandStreamReceiver<FamilyType>
std::vector<GraphicsAllocation *> toFree; // pointers to be freed on destruction
public:
FlushStamp flush(BatchBuffer &batchBuffer, EngineType engineType, ResidencyContainer *allocationsForResidency, OsContext &osContext) override {
FlushStamp flush(BatchBuffer &batchBuffer, EngineType engineType, ResidencyContainer &allocationsForResidency, OsContext &osContext) override {
EXPECT_NE(nullptr, batchBuffer.commandBufferAllocation->getUnderlyingBuffer());
toFree.push_back(batchBuffer.commandBufferAllocation);

View File

@@ -33,7 +33,7 @@ class CommandStreamReceiverMock : public UltCommandStreamReceiver<FamilyType> {
this->pDevice = pDevice;
}
FlushStamp flush(BatchBuffer &batchBuffer, EngineType engineType, ResidencyContainer *allocationsForResidency, OsContext &osContext) override {
FlushStamp flush(BatchBuffer &batchBuffer, EngineType engineType, ResidencyContainer &allocationsForResidency, OsContext &osContext) override {
EXPECT_NE(nullptr, batchBuffer.commandBufferAllocation->getUnderlyingBuffer());
toFree.push_back(batchBuffer.commandBufferAllocation);

View File

@@ -341,7 +341,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenFlushIs
auto engineType = OCLRT::ENGINE_RCS;
ResidencyContainer allocationsForResidency = {};
aubCsr->flush(batchBuffer, engineType, &allocationsForResidency, *pDevice->getOsContext());
aubCsr->flush(batchBuffer, engineType, allocationsForResidency, *pDevice->getOsContext());
EXPECT_TRUE(mockAubFileStreamPtr->lockStreamCalled);
}
@@ -387,7 +387,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenFlushIs
auto engineType = OCLRT::ENGINE_RCS;
ResidencyContainer allocationsForResidency = {};
aubCsr->flush(batchBuffer, engineType, &allocationsForResidency, *pDevice->getOsContext());
aubCsr->flush(batchBuffer, engineType, allocationsForResidency, *pDevice->getOsContext());
EXPECT_NE(nullptr, aubCsr->engineInfoTable[engineType].pLRCA);
EXPECT_NE(nullptr, aubCsr->engineInfoTable[engineType].pGlobalHWStatusPage);
EXPECT_NE(nullptr, aubCsr->engineInfoTable[engineType].pRingBuffer);
@@ -408,7 +408,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptur
auto engineType = OCLRT::ENGINE_RCS;
ResidencyContainer allocationsForResidency = {};
aubCsr->flush(batchBuffer, engineType, &allocationsForResidency, *pDevice->getOsContext());
aubCsr->flush(batchBuffer, engineType, allocationsForResidency, *pDevice->getOsContext());
EXPECT_EQ(nullptr, aubCsr->engineInfoTable[engineType].pLRCA);
EXPECT_EQ(nullptr, aubCsr->engineInfoTable[engineType].pGlobalHWStatusPage);
EXPECT_EQ(nullptr, aubCsr->engineInfoTable[engineType].pRingBuffer);
@@ -427,12 +427,12 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenFlushIs
// First flush typically includes a preamble and chain to command buffer
aubCsr->overrideDispatchPolicy(DispatchMode::ImmediateDispatch);
aubCsr->flush(batchBuffer, engineType, &allocationsForResidency, *pDevice->getOsContext());
aubCsr->flush(batchBuffer, engineType, allocationsForResidency, *pDevice->getOsContext());
EXPECT_EQ(0ull, aubCsr->engineInfoTable[engineType].tailRingBuffer % ringTailAlignment);
// Second flush should just submit command buffer
cs.getSpace(sizeof(uint64_t));
aubCsr->flush(batchBuffer, engineType, &allocationsForResidency, *pDevice->getOsContext());
aubCsr->flush(batchBuffer, engineType, allocationsForResidency, *pDevice->getOsContext());
EXPECT_EQ(0ull, aubCsr->engineInfoTable[engineType].tailRingBuffer % ringTailAlignment);
}
@@ -451,7 +451,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInNonStanda
EXPECT_NE(aubCsr->peekLatestSentTaskCount(), *aubCsr->getTagAddress());
aubCsr->flush(batchBuffer, engineType, &allocationsForResidency, *pDevice->getOsContext());
aubCsr->flush(batchBuffer, engineType, allocationsForResidency, *pDevice->getOsContext());
EXPECT_NE(aubCsr->peekLatestSentTaskCount(), *aubCsr->getTagAddress());
EXPECT_EQ(initialHardwareTag, *aubCsr->getTagAddress());
@@ -472,7 +472,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInStandalon
EXPECT_NE(aubCsr->peekLatestSentTaskCount(), *aubCsr->getTagAddress());
aubCsr->flush(batchBuffer, engineType, &allocationsForResidency, *pDevice->getOsContext());
aubCsr->flush(batchBuffer, engineType, allocationsForResidency, *pDevice->getOsContext());
EXPECT_EQ(aubCsr->peekLatestSentTaskCount(), *aubCsr->getTagAddress());
}
@@ -497,7 +497,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInStandalon
EXPECT_NE(aubCsr->peekLatestSentTaskCount(), *aubCsr->getTagAddress());
aubCsr->flush(batchBuffer, engineType, &allocationsForResidency, *pDevice->getOsContext());
aubCsr->flush(batchBuffer, engineType, allocationsForResidency, *pDevice->getOsContext());
EXPECT_EQ(aubCsr->peekLatestSentTaskCount(), *aubCsr->getTagAddress());
}
@@ -522,7 +522,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInNonStanda
EXPECT_NE(aubCsr->peekLatestSentTaskCount(), *aubCsr->getTagAddress());
aubCsr->flush(batchBuffer, engineType, &allocationsForResidency, *pDevice->getOsContext());
aubCsr->flush(batchBuffer, engineType, allocationsForResidency, *pDevice->getOsContext());
EXPECT_NE(aubCsr->peekLatestSentTaskCount(), *aubCsr->getTagAddress());
EXPECT_EQ(initialHardwareTag, *aubCsr->getTagAddress());
@@ -549,7 +549,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptur
auto engineType = OCLRT::ENGINE_RCS;
ResidencyContainer allocationsForResidency = {};
aubCsr->flush(batchBuffer, engineType, &allocationsForResidency, *pDevice->getOsContext());
aubCsr->flush(batchBuffer, engineType, allocationsForResidency, *pDevice->getOsContext());
EXPECT_FALSE(aubCsr->subCaptureManager->isSubCaptureEnabled());
}
@@ -567,7 +567,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInStandalon
EXPECT_EQ(ObjectNotResident, commandBuffer->residencyTaskCount[0u]);
aubCsr->overrideDispatchPolicy(DispatchMode::ImmediateDispatch);
aubCsr->flush(batchBuffer, engineType, &allocationsForResidency, *pDevice->getOsContext());
aubCsr->flush(batchBuffer, engineType, allocationsForResidency, *pDevice->getOsContext());
EXPECT_NE(ObjectNotResident, commandBuffer->residencyTaskCount[0u]);
EXPECT_EQ((int)aubCsr->peekTaskCount() + 1, commandBuffer->residencyTaskCount[0u]);
@@ -588,7 +588,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInNoneStand
EXPECT_EQ(ObjectNotResident, aubExecutionEnvironment->commandBuffer->residencyTaskCount[0u]);
aubCsr->flush(batchBuffer, engineType, &allocationsForResidency, *pDevice->getOsContext());
aubCsr->flush(batchBuffer, engineType, allocationsForResidency, *pDevice->getOsContext());
EXPECT_EQ(ObjectNotResident, aubExecutionEnvironment->commandBuffer->residencyTaskCount[0u]);
}
@@ -611,7 +611,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInStandalon
EXPECT_EQ(ObjectNotResident, commandBuffer->residencyTaskCount[0u]);
aubCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch);
aubCsr->flush(batchBuffer, engineType, &allocationsForResidency, *pDevice->getOsContext());
aubCsr->flush(batchBuffer, engineType, allocationsForResidency, *pDevice->getOsContext());
EXPECT_NE(ObjectNotResident, gfxAllocation->residencyTaskCount[0u]);
EXPECT_EQ((int)aubCsr->peekTaskCount() + 1, gfxAllocation->residencyTaskCount[0u]);
@@ -643,7 +643,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInNoneStand
EXPECT_EQ(ObjectNotResident, gfxAllocation->residencyTaskCount[0u]);
EXPECT_EQ(ObjectNotResident, commandBuffer->residencyTaskCount[0u]);
aubCsr->flush(batchBuffer, engineType, &allocationsForResidency, *pDevice->getOsContext());
aubCsr->flush(batchBuffer, engineType, allocationsForResidency, *pDevice->getOsContext());
EXPECT_EQ(ObjectNotResident, gfxAllocation->residencyTaskCount[0u]);
EXPECT_EQ(ObjectNotResident, commandBuffer->residencyTaskCount[0u]);
@@ -680,7 +680,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInStandalon
EXPECT_EQ(ObjectNotResident, commandBuffer->residencyTaskCount[0u]);
aubCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch);
aubCsr->flush(batchBuffer, engineType, &allocationsForResidency, *pDevice->getOsContext());
aubCsr->flush(batchBuffer, engineType, allocationsForResidency, *pDevice->getOsContext());
EXPECT_NE(ObjectNotResident, gfxAllocation->residencyTaskCount[0u]);
EXPECT_EQ((int)aubCsr->peekTaskCount() + 1, gfxAllocation->residencyTaskCount[0u]);
@@ -1354,7 +1354,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenDefault
ResidencyContainer allocationsForResidency = {};
EXPECT_CALL(*mockHelper, flattenBatchBuffer(::testing::_, ::testing::_, ::testing::_)).Times(0);
aubCsr->flush(batchBuffer, engineType, &allocationsForResidency, *pDevice->getOsContext());
aubCsr->flush(batchBuffer, engineType, allocationsForResidency, *pDevice->getOsContext());
}
HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenForcedFlattenBatchBufferAndImmediateDispatchModeThenExpectFlattenBatchBufferIsCalled) {
@@ -1383,7 +1383,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenForcedF
[&](GraphicsAllocation *ptr) { aubExecutionEnvironment->executionEnvironment->memoryManager->freeGraphicsMemory(ptr); });
EXPECT_CALL(*mockHelper, flattenBatchBuffer(::testing::_, ::testing::_, ::testing::_)).WillOnce(::testing::Return(ptr.release()));
aubCsr->flush(batchBuffer, engineType, &allocationsForResidency, *pDevice->getOsContext());
aubCsr->flush(batchBuffer, engineType, allocationsForResidency, *pDevice->getOsContext());
aubExecutionEnvironment->executionEnvironment->memoryManager->freeGraphicsMemory(chainedBatchBuffer);
}
@@ -1405,7 +1405,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenForcedF
auto engineType = OCLRT::ENGINE_RCS;
EXPECT_CALL(*mockHelper, flattenBatchBuffer(::testing::_, ::testing::_, ::testing::_)).Times(1);
aubCsr->flush(batchBuffer, engineType, &allocationsForResidency, *pDevice->getOsContext());
aubCsr->flush(batchBuffer, engineType, allocationsForResidency, *pDevice->getOsContext());
}
HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenForcedFlattenBatchBufferAndBatchedDispatchModeThenExpectFlattenBatchBufferIsCalledAnyway) {
@@ -1425,7 +1425,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenForcedF
auto engineType = OCLRT::ENGINE_RCS;
EXPECT_CALL(*mockHelper, flattenBatchBuffer(::testing::_, ::testing::_, ::testing::_)).Times(1);
aubCsr->flush(batchBuffer, engineType, &allocationsForResidency, *pDevice->getOsContext());
aubCsr->flush(batchBuffer, engineType, allocationsForResidency, *pDevice->getOsContext());
}
HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenAddPatchInfoCommentsForAUBDumpIsSetThenAddPatchInfoCommentsIsCalled) {
@@ -1441,7 +1441,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenAddPatc
ResidencyContainer allocationsForResidency;
EXPECT_CALL(*aubCsr, addPatchInfoComments()).Times(1);
aubCsr->flush(batchBuffer, engineType, &allocationsForResidency, *pDevice->getOsContext());
aubCsr->flush(batchBuffer, engineType, allocationsForResidency, *pDevice->getOsContext());
}
HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenAddPatchInfoCommentsForAUBDumpIsNotSetThenAddPatchInfoCommentsIsNotCalled) {
@@ -1454,7 +1454,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenAddPatc
ResidencyContainer allocationsForResidency;
EXPECT_CALL(*aubCsr, addPatchInfoComments()).Times(0);
aubCsr->flush(batchBuffer, engineType, &allocationsForResidency, *pDevice->getOsContext());
aubCsr->flush(batchBuffer, engineType, allocationsForResidency, *pDevice->getOsContext());
}
HWTEST_F(AubCommandStreamReceiverTests, givenAddPatchInfoCommentsCalledWhenNoPatchInfoDataObjectsThenCommentsAreEmpty) {
@@ -1498,7 +1498,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenFlushIs
auto engineType = OCLRT::ENGINE_RCS;
ResidencyContainer allocationsForResidency = {};
aubCsr->flush(batchBuffer, engineType, &allocationsForResidency, *pDevice->getOsContext());
aubCsr->flush(batchBuffer, engineType, allocationsForResidency, *pDevice->getOsContext());
EXPECT_TRUE(mockAubFileStreamPtr->flushCalled);
}

View File

@@ -758,7 +758,7 @@ struct CommandStreamReceiverHwLog : public UltCommandStreamReceiver<FamilyType>
flushCount(0) {
}
FlushStamp flush(BatchBuffer &batchBuffer, EngineType engineType, ResidencyContainer *allocationsForResidency, OsContext &osContext) override {
FlushStamp flush(BatchBuffer &batchBuffer, EngineType engineType, ResidencyContainer &allocationsForResidency, OsContext &osContext) override {
++flushCount;
return 0;
}

View File

@@ -21,11 +21,11 @@ struct MyMockCsr : UltCommandStreamReceiver<DEFAULT_TEST_FAMILY_NAME> {
: UltCommandStreamReceiver(hwInfoIn, executionEnvironment) {
}
FlushStamp flush(BatchBuffer &batchBuffer, EngineType engineOrdinal, ResidencyContainer *allocationsForResidency, OsContext &osContext) override {
FlushStamp flush(BatchBuffer &batchBuffer, EngineType engineOrdinal, ResidencyContainer &allocationsForResidency, OsContext &osContext) override {
flushParametrization.wasCalled = true;
flushParametrization.receivedBatchBuffer = &batchBuffer;
flushParametrization.receivedEngine = engineOrdinal;
flushParametrization.receivedAllocationsForResidency = allocationsForResidency;
flushParametrization.receivedAllocationsForResidency = &allocationsForResidency;
return flushParametrization.flushStampToReturn;
}
@@ -135,7 +135,7 @@ HWTEST_P(CommandStreamReceiverWithAubDumpTest, givenCommandStreamReceiverWithAub
OsContext osContext(nullptr, 0u);
ResidencyContainer allocationsForResidency;
FlushStamp flushStamp = csrWithAubDump->flush(batchBuffer, engineType, &allocationsForResidency, osContext);
FlushStamp flushStamp = csrWithAubDump->flush(batchBuffer, engineType, allocationsForResidency, osContext);
EXPECT_EQ(flushStamp, csrWithAubDump->flushParametrization.flushStampToReturn);
EXPECT_TRUE(csrWithAubDump->flushParametrization.wasCalled);

View File

@@ -91,7 +91,7 @@ TEST_F(TbxCommandStreamTests, DISABLED_flush) {
LinearStream cs(buffer, 4096);
size_t startOffset = 0;
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), startOffset, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
pCommandStreamReceiver->flush(batchBuffer, EngineType::ENGINE_RCS, nullptr, *pDevice->getOsContext());
pCommandStreamReceiver->flush(batchBuffer, EngineType::ENGINE_RCS, pCommandStreamReceiver->getResidencyAllocations(), *pDevice->getOsContext());
}
HWTEST_F(TbxCommandStreamTests, DISABLED_flushUntilTailRCSLargerThanSizeRCS) {
@@ -103,12 +103,12 @@ HWTEST_F(TbxCommandStreamTests, DISABLED_flushUntilTailRCSLargerThanSizeRCS) {
auto &engineInfo = tbxCsr->engineInfoTable[EngineType::ENGINE_RCS];
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), startOffset, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
pCommandStreamReceiver->flush(batchBuffer, EngineType::ENGINE_RCS, nullptr, *pDevice->getOsContext());
pCommandStreamReceiver->flush(batchBuffer, EngineType::ENGINE_RCS, pCommandStreamReceiver->getResidencyAllocations(), *pDevice->getOsContext());
auto size = engineInfo.sizeRCS;
engineInfo.sizeRCS = 64;
pCommandStreamReceiver->flush(batchBuffer, EngineType::ENGINE_RCS, nullptr, *pDevice->getOsContext());
pCommandStreamReceiver->flush(batchBuffer, EngineType::ENGINE_RCS, nullptr, *pDevice->getOsContext());
pCommandStreamReceiver->flush(batchBuffer, EngineType::ENGINE_RCS, nullptr, *pDevice->getOsContext());
pCommandStreamReceiver->flush(batchBuffer, EngineType::ENGINE_RCS, pCommandStreamReceiver->getResidencyAllocations(), *pDevice->getOsContext());
pCommandStreamReceiver->flush(batchBuffer, EngineType::ENGINE_RCS, pCommandStreamReceiver->getResidencyAllocations(), *pDevice->getOsContext());
pCommandStreamReceiver->flush(batchBuffer, EngineType::ENGINE_RCS, pCommandStreamReceiver->getResidencyAllocations(), *pDevice->getOsContext());
engineInfo.sizeRCS = size;
}
@@ -274,7 +274,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenFlushIsCalledTh
EXPECT_EQ(ObjectNotResident, graphicsAllocation->residencyTaskCount[0u]);
tbxCsr->flush(batchBuffer, engineType, &allocationsForResidency, *pDevice->getOsContext());
tbxCsr->flush(batchBuffer, engineType, allocationsForResidency, *pDevice->getOsContext());
EXPECT_NE(ObjectNotResident, graphicsAllocation->residencyTaskCount[0u]);
EXPECT_EQ((int)tbxCsr->peekTaskCount() + 1, graphicsAllocation->residencyTaskCount[0u]);

View File

@@ -421,7 +421,7 @@ class CommandStreamReceiverMock : public CommandStreamReceiver {
CommandStreamReceiver::makeNonResident(graphicsAllocation);
}
FlushStamp flush(BatchBuffer &batchBuffer, EngineType engineType, ResidencyContainer *allocationsForResidency, OsContext &osContext) override {
FlushStamp flush(BatchBuffer &batchBuffer, EngineType engineType, ResidencyContainer &allocationsForResidency, OsContext &osContext) override {
return flushStamp->peekStamp();
}

View File

@@ -8,7 +8,7 @@
#include "unit_tests/mocks/mock_csr.h"
#include "runtime/os_interface/os_interface.h"
FlushStamp MockCommandStreamReceiver::flush(BatchBuffer &batchBuffer, EngineType engineType, ResidencyContainer *allocationsForResidency, OsContext &osContext) {
FlushStamp MockCommandStreamReceiver::flush(BatchBuffer &batchBuffer, EngineType engineType, ResidencyContainer &allocationsForResidency, OsContext &osContext) {
FlushStamp stamp = 0;
return stamp;
}

View File

@@ -97,7 +97,7 @@ class MockCsr : public MockCsrBase<GfxFamily> {
MockCsr(int32_t &execStamp, ExecutionEnvironment &executionEnvironment) : BaseClass(execStamp, executionEnvironment) {
}
FlushStamp flush(BatchBuffer &batchBuffer, EngineType engineType, ResidencyContainer *allocationsForResidency, OsContext &osContext) override {
FlushStamp flush(BatchBuffer &batchBuffer, EngineType engineType, ResidencyContainer &allocationsForResidency, OsContext &osContext) override {
return 0;
}
@@ -165,16 +165,10 @@ class MockCsrHw2 : public CommandStreamReceiverHw<GfxFamily> {
bool peekMediaVfeStateDirty() const { return mediaVfeStateDirty; }
FlushStamp flush(BatchBuffer &batchBuffer, EngineType engineType,
ResidencyContainer *allocationsForResidency, OsContext &osContext) override {
ResidencyContainer &allocationsForResidency, OsContext &osContext) override {
flushCalledCount++;
recordedCommandBuffer->batchBuffer = batchBuffer;
copyOfAllocations.clear();
if (allocationsForResidency) {
copyOfAllocations = *allocationsForResidency;
} else {
copyOfAllocations = this->getResidencyAllocations();
}
copyOfAllocations = allocationsForResidency;
flushStamp->setStamp(flushStamp->peekStamp() + 1);
return flushStamp->peekStamp();
}
@@ -224,7 +218,7 @@ class MockCommandStreamReceiver : public CommandStreamReceiver {
~MockCommandStreamReceiver() {
}
FlushStamp flush(BatchBuffer &batchBuffer, EngineType engineType, ResidencyContainer *allocationsForResidency, OsContext &osContext) override;
FlushStamp flush(BatchBuffer &batchBuffer, EngineType engineType, ResidencyContainer &allocationsForResidency, OsContext &osContext) override;
CompletionStamp flushTask(
LinearStream &commandStream,

View File

@@ -209,7 +209,7 @@ TEST_F(DrmCommandStreamTest, Flush) {
csr->alignToCacheLine(cs);
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
auto availableSpacePriorToFlush = cs.getAvailableSpace();
auto flushStamp = csr->flush(batchBuffer, EngineType::ENGINE_RCS, &csr->getResidencyAllocations(), *osContext);
auto flushStamp = csr->flush(batchBuffer, EngineType::ENGINE_RCS, csr->getResidencyAllocations(), *osContext);
EXPECT_EQ(static_cast<uint64_t>(boHandle), flushStamp);
EXPECT_NE(cs.getCpuBase(), nullptr);
EXPECT_EQ(availableSpacePriorToFlush, cs.getAvailableSpace());
@@ -244,7 +244,7 @@ TEST_F(DrmCommandStreamTest, FlushWithLowPriorityContext) {
csr->addBatchBufferEnd(cs, nullptr);
csr->alignToCacheLine(cs);
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, true, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
csr->flush(batchBuffer, EngineType::ENGINE_RCS, &csr->getResidencyAllocations(), *osContext);
csr->flush(batchBuffer, EngineType::ENGINE_RCS, csr->getResidencyAllocations(), *osContext);
EXPECT_NE(cs.getCpuBase(), nullptr);
}
@@ -273,7 +273,7 @@ TEST_F(DrmCommandStreamTest, FlushInvalidAddress) {
csr->addBatchBufferEnd(cs, nullptr);
csr->alignToCacheLine(cs);
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
csr->flush(batchBuffer, EngineType::ENGINE_RCS, &csr->getResidencyAllocations(), *osContext);
csr->flush(batchBuffer, EngineType::ENGINE_RCS, csr->getResidencyAllocations(), *osContext);
delete[] commandBuffer;
}
@@ -304,7 +304,7 @@ TEST_F(DrmCommandStreamTest, FlushNotEmptyBB) {
csr->addBatchBufferEnd(cs, nullptr);
csr->alignToCacheLine(cs);
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
csr->flush(batchBuffer, EngineType::ENGINE_RCS, &csr->getResidencyAllocations(), *osContext);
csr->flush(batchBuffer, EngineType::ENGINE_RCS, csr->getResidencyAllocations(), *osContext);
}
TEST_F(DrmCommandStreamTest, FlushNotEmptyNotPaddedBB) {
@@ -333,7 +333,7 @@ TEST_F(DrmCommandStreamTest, FlushNotEmptyNotPaddedBB) {
csr->addBatchBufferEnd(cs, nullptr);
csr->alignToCacheLine(cs);
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
csr->flush(batchBuffer, EngineType::ENGINE_RCS, &csr->getResidencyAllocations(), *osContext);
csr->flush(batchBuffer, EngineType::ENGINE_RCS, csr->getResidencyAllocations(), *osContext);
}
TEST_F(DrmCommandStreamTest, FlushNotAligned) {
@@ -364,7 +364,7 @@ TEST_F(DrmCommandStreamTest, FlushNotAligned) {
csr->alignToCacheLine(cs);
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 4, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
csr->flush(batchBuffer, EngineType::ENGINE_RCS, &csr->getResidencyAllocations(), *osContext);
csr->flush(batchBuffer, EngineType::ENGINE_RCS, csr->getResidencyAllocations(), *osContext);
}
ACTION_P(UserptrSetHandle, _set_handle) {
@@ -416,7 +416,7 @@ TEST_F(DrmCommandStreamTest, FlushCheckFlags) {
csr->addBatchBufferEnd(cs, nullptr);
csr->alignToCacheLine(cs);
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
csr->flush(batchBuffer, EngineType::ENGINE_RCS, &csr->getResidencyAllocations(), *osContext);
csr->flush(batchBuffer, EngineType::ENGINE_RCS, csr->getResidencyAllocations(), *osContext);
}
TEST_F(DrmCommandStreamTest, CheckDrmFree) {
@@ -449,7 +449,7 @@ TEST_F(DrmCommandStreamTest, CheckDrmFree) {
csr->addBatchBufferEnd(cs, nullptr);
csr->alignToCacheLine(cs);
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 4, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
csr->flush(batchBuffer, EngineType::ENGINE_RCS, &csr->getResidencyAllocations(), *osContext);
csr->flush(batchBuffer, EngineType::ENGINE_RCS, csr->getResidencyAllocations(), *osContext);
}
TEST_F(DrmCommandStreamTest, GIVENCSRWHENgetDMTHENNotNull) {
@@ -490,7 +490,7 @@ TEST_F(DrmCommandStreamTest, CheckDrmFreeCloseFailed) {
csr->addBatchBufferEnd(cs, nullptr);
csr->alignToCacheLine(cs);
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 4, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
csr->flush(batchBuffer, EngineType::ENGINE_RCS, &csr->getResidencyAllocations(), *osContext);
csr->flush(batchBuffer, EngineType::ENGINE_RCS, csr->getResidencyAllocations(), *osContext);
}
struct DrmCsrVfeTests : ::testing::Test {
@@ -503,7 +503,7 @@ struct DrmCsrVfeTests : ::testing::Test {
MyCsr(ExecutionEnvironment &executionEnvironment)
: DrmCommandStreamReceiver<FamilyType>(*platformDevices[0], executionEnvironment,
gemCloseWorkerMode::gemCloseWorkerInactive) {}
FlushStamp flush(BatchBuffer &batchBuffer, EngineType engineType, ResidencyContainer *allocationsForResidency, OsContext &osContext) override {
FlushStamp flush(BatchBuffer &batchBuffer, EngineType engineType, ResidencyContainer &allocationsForResidency, OsContext &osContext) override {
return (FlushStamp)0;
}
bool peekDefaultMediaVfeStateDirty() {
@@ -808,7 +808,7 @@ TEST_F(DrmCommandStreamGemWorkerTests, givenCommandStreamWhenItIsFlushedWithGemC
auto storedBase = cs.getCpuBase();
auto storedGraphicsAllocation = cs.getGraphicsAllocation();
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
csr->flush(batchBuffer, EngineType::ENGINE_RCS, &csr->getResidencyAllocations(), *osContext);
csr->flush(batchBuffer, EngineType::ENGINE_RCS, csr->getResidencyAllocations(), *osContext);
EXPECT_EQ(cs.getCpuBase(), storedBase);
EXPECT_EQ(cs.getGraphicsAllocation(), storedGraphicsAllocation);
@@ -843,7 +843,7 @@ TEST_F(DrmCommandStreamGemWorkerTests, givenTaskThatRequiresLargeResourceCountWh
csr->addBatchBufferEnd(cs, nullptr);
csr->alignToCacheLine(cs);
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
csr->flush(batchBuffer, EngineType::ENGINE_RCS, &csr->getResidencyAllocations(), *osContext);
csr->flush(batchBuffer, EngineType::ENGINE_RCS, csr->getResidencyAllocations(), *osContext);
EXPECT_EQ(11u, this->mock->execBuffer.buffer_count);
mm->freeGraphicsMemory(commandBuffer);
@@ -915,7 +915,7 @@ TEST_F(DrmCommandStreamGemWorkerTests, givenCommandStreamWithDuplicatesWhenItIsF
auto storedBase = cs.getCpuBase();
auto storedGraphicsAllocation = cs.getGraphicsAllocation();
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
csr->flush(batchBuffer, EngineType::ENGINE_RCS, &csr->getResidencyAllocations(), *osContext);
csr->flush(batchBuffer, EngineType::ENGINE_RCS, csr->getResidencyAllocations(), *osContext);
EXPECT_EQ(cs.getCpuBase(), storedBase);
EXPECT_EQ(cs.getGraphicsAllocation(), storedGraphicsAllocation);
@@ -972,7 +972,7 @@ TEST_F(DrmCommandStreamBatchingTests, givenCSRWhenFlushIsCalledThenProperFlagsAr
csr->alignToCacheLine(cs);
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
csr->flush(batchBuffer, EngineType::ENGINE_RCS, &csr->getResidencyAllocations(), *osContext);
csr->flush(batchBuffer, EngineType::ENGINE_RCS, csr->getResidencyAllocations(), *osContext);
//preemption allocation + Sip Kernel
int ioctlExtraCnt = (PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]) == PreemptionMode::MidThread) ? 2 : 0;
@@ -1471,7 +1471,7 @@ TEST_F(DrmCommandStreamLeaksTest, Flush) {
csr->addBatchBufferEnd(cs, nullptr);
csr->alignToCacheLine(cs);
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
csr->flush(batchBuffer, EngineType::ENGINE_RCS, &csr->getResidencyAllocations(), *osContext);
csr->flush(batchBuffer, EngineType::ENGINE_RCS, csr->getResidencyAllocations(), *osContext);
EXPECT_NE(cs.getCpuBase(), nullptr);
EXPECT_NE(cs.getGraphicsAllocation(), nullptr);
}
@@ -1515,14 +1515,14 @@ TEST_F(DrmCommandStreamLeaksTest, FlushMultipleTimes) {
csr->addBatchBufferEnd(cs, nullptr);
csr->alignToCacheLine(cs);
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
csr->flush(batchBuffer, EngineType::ENGINE_RCS, &csr->getResidencyAllocations(), *osContext);
csr->flush(batchBuffer, EngineType::ENGINE_RCS, csr->getResidencyAllocations(), *osContext);
cs.replaceBuffer(commandBuffer->getUnderlyingBuffer(), commandBuffer->getUnderlyingBufferSize());
cs.replaceGraphicsAllocation(commandBuffer);
csr->addBatchBufferEnd(cs, nullptr);
csr->alignToCacheLine(cs);
BatchBuffer batchBuffer2{cs.getGraphicsAllocation(), 8, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
csr->flush(batchBuffer2, EngineType::ENGINE_RCS, &csr->getResidencyAllocations(), *osContext);
csr->flush(batchBuffer2, EngineType::ENGINE_RCS, csr->getResidencyAllocations(), *osContext);
auto allocation = mm->allocateGraphicsMemory(1024);
ASSERT_NE(nullptr, allocation);
@@ -1541,7 +1541,7 @@ TEST_F(DrmCommandStreamLeaksTest, FlushMultipleTimes) {
csr->addBatchBufferEnd(cs, nullptr);
csr->alignToCacheLine(cs);
BatchBuffer batchBuffer3{cs.getGraphicsAllocation(), 16, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
csr->flush(batchBuffer3, EngineType::ENGINE_RCS, &csr->getResidencyAllocations(), *osContext);
csr->flush(batchBuffer3, EngineType::ENGINE_RCS, csr->getResidencyAllocations(), *osContext);
csr->makeSurfacePackNonResident(nullptr);
mm->freeGraphicsMemory(allocation);
mm->freeGraphicsMemory(allocation2);
@@ -1554,7 +1554,7 @@ TEST_F(DrmCommandStreamLeaksTest, FlushMultipleTimes) {
csr->addBatchBufferEnd(cs, nullptr);
csr->alignToCacheLine(cs);
BatchBuffer batchBuffer4{cs.getGraphicsAllocation(), 24, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
csr->flush(batchBuffer4, EngineType::ENGINE_RCS, &csr->getResidencyAllocations(), *osContext);
csr->flush(batchBuffer4, EngineType::ENGINE_RCS, csr->getResidencyAllocations(), *osContext);
}
TEST_F(DrmCommandStreamLeaksTest, FlushNotEmptyBB) {
@@ -1567,7 +1567,7 @@ TEST_F(DrmCommandStreamLeaksTest, FlushNotEmptyBB) {
csr->addBatchBufferEnd(cs, nullptr);
csr->alignToCacheLine(cs);
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
csr->flush(batchBuffer, EngineType::ENGINE_RCS, &csr->getResidencyAllocations(), *osContext);
csr->flush(batchBuffer, EngineType::ENGINE_RCS, csr->getResidencyAllocations(), *osContext);
}
TEST_F(DrmCommandStreamLeaksTest, FlushNotEmptyNotPaddedBB) {
@@ -1580,7 +1580,7 @@ TEST_F(DrmCommandStreamLeaksTest, FlushNotEmptyNotPaddedBB) {
csr->addBatchBufferEnd(cs, nullptr);
csr->alignToCacheLine(cs);
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
csr->flush(batchBuffer, EngineType::ENGINE_RCS, &csr->getResidencyAllocations(), *osContext);
csr->flush(batchBuffer, EngineType::ENGINE_RCS, csr->getResidencyAllocations(), *osContext);
}
TEST_F(DrmCommandStreamLeaksTest, FlushNotAligned) {
@@ -1594,7 +1594,7 @@ TEST_F(DrmCommandStreamLeaksTest, FlushNotAligned) {
csr->addBatchBufferEnd(cs, nullptr);
csr->alignToCacheLine(cs);
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 4, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
csr->flush(batchBuffer, EngineType::ENGINE_RCS, &csr->getResidencyAllocations(), *osContext);
csr->flush(batchBuffer, EngineType::ENGINE_RCS, csr->getResidencyAllocations(), *osContext);
}
TEST_F(DrmCommandStreamLeaksTest, CheckDrmFree) {
@@ -1611,7 +1611,7 @@ TEST_F(DrmCommandStreamLeaksTest, CheckDrmFree) {
csr->addBatchBufferEnd(cs, nullptr);
csr->alignToCacheLine(cs);
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 4, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
csr->flush(batchBuffer, EngineType::ENGINE_RCS, &csr->getResidencyAllocations(), *osContext);
csr->flush(batchBuffer, EngineType::ENGINE_RCS, csr->getResidencyAllocations(), *osContext);
csr->makeNonResident(*allocation);
mm->freeGraphicsMemory(allocation);
}

View File

@@ -194,7 +194,7 @@ TEST_F(WddmCommandStreamTest, Flush) {
ASSERT_NE(nullptr, commandBuffer);
LinearStream cs(commandBuffer);
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
auto flushStamp = csr->flush(batchBuffer, EngineType::ENGINE_RCS, &csr->getResidencyAllocations(), *device->getOsContext());
auto flushStamp = csr->flush(batchBuffer, EngineType::ENGINE_RCS, csr->getResidencyAllocations(), *device->getOsContext());
EXPECT_EQ(1u, wddm->submitResult.called);
EXPECT_TRUE(wddm->submitResult.success);
@@ -212,7 +212,7 @@ TEST_F(WddmCommandStreamTest, givenGraphicsAllocationWithDifferentGpuAddressThen
LinearStream cs(commandBuffer);
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
auto flushStamp = csr->flush(batchBuffer, EngineType::ENGINE_RCS, &csr->getResidencyAllocations(), *device->getOsContext());
auto flushStamp = csr->flush(batchBuffer, EngineType::ENGINE_RCS, csr->getResidencyAllocations(), *device->getOsContext());
EXPECT_EQ(mockGpuAddres, wddm->submitResult.commandBufferSubmitted);
memManager->freeGraphicsMemory(commandBuffer);
}
@@ -223,7 +223,7 @@ TEST_F(WddmCommandStreamTest, FlushWithOffset) {
LinearStream cs(commandBuffer);
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), offset, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
csr->flush(batchBuffer, EngineType::ENGINE_RCS, &csr->getResidencyAllocations(), *device->getOsContext());
csr->flush(batchBuffer, EngineType::ENGINE_RCS, csr->getResidencyAllocations(), *device->getOsContext());
EXPECT_EQ(1u, wddm->submitResult.called);
EXPECT_TRUE(wddm->submitResult.success);
EXPECT_EQ(wddm->submitResult.commandBufferSubmitted, commandBuffer->getGpuAddress() + offset);
@@ -237,7 +237,7 @@ TEST_F(WddmCommandStreamTest, givenWdmmWhenSubmitIsCalledThenCoherencyRequiredFl
LinearStream cs(commandBuffer);
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
csr->flush(batchBuffer, EngineType::ENGINE_RCS, &csr->getResidencyAllocations(), *device->getOsContext());
csr->flush(batchBuffer, EngineType::ENGINE_RCS, csr->getResidencyAllocations(), *device->getOsContext());
auto commandHeader = wddm->submitResult.commandHeaderSubmitted;
COMMAND_BUFFER_HEADER *pHeader = reinterpret_cast<COMMAND_BUFFER_HEADER *>(commandHeader);
@@ -266,7 +266,7 @@ TEST(WddmPreemptionHeaderTests, givenWddmCommandStreamReceiverWhenPreemptionIsOf
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
OsContext *osContext = new OsContext(executionEnvironment.osInterface.get(), 0u);
osContext->incRefInternal();
executionEnvironment.commandStreamReceivers[0u]->flush(batchBuffer, EngineType::ENGINE_RCS, &executionEnvironment.commandStreamReceivers[0u]->getResidencyAllocations(), *osContext);
executionEnvironment.commandStreamReceivers[0u]->flush(batchBuffer, EngineType::ENGINE_RCS, executionEnvironment.commandStreamReceivers[0u]->getResidencyAllocations(), *osContext);
auto commandHeader = wddm->submitResult.commandHeaderSubmitted;
COMMAND_BUFFER_HEADER *pHeader = reinterpret_cast<COMMAND_BUFFER_HEADER *>(commandHeader);
@@ -293,7 +293,7 @@ TEST(WddmPreemptionHeaderTests, givenWddmCommandStreamReceiverWhenPreemptionIsOn
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
OsContext *osContext = new OsContext(executionEnvironment.osInterface.get(), 0u);
osContext->incRefInternal();
executionEnvironment.commandStreamReceivers[0u]->flush(batchBuffer, EngineType::ENGINE_RCS, &executionEnvironment.commandStreamReceivers[0u]->getResidencyAllocations(), *osContext);
executionEnvironment.commandStreamReceivers[0u]->flush(batchBuffer, EngineType::ENGINE_RCS, executionEnvironment.commandStreamReceivers[0u]->getResidencyAllocations(), *osContext);
auto commandHeader = wddm->submitResult.commandHeaderSubmitted;
COMMAND_BUFFER_HEADER *pHeader = reinterpret_cast<COMMAND_BUFFER_HEADER *>(commandHeader);
@@ -334,7 +334,7 @@ TEST_F(WddmCommandStreamTest, givenWdmmWhenSubmitIsCalledAndThrottleIsToLowThenS
LinearStream cs(commandBuffer);
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::LOW, cs.getUsed(), &cs};
csr->flush(batchBuffer, EngineType::ENGINE_RCS, &csr->getResidencyAllocations(), *device->getOsContext());
csr->flush(batchBuffer, EngineType::ENGINE_RCS, csr->getResidencyAllocations(), *device->getOsContext());
auto commandHeader = wddm->submitResult.commandHeaderSubmitted;
COMMAND_BUFFER_HEADER *pHeader = reinterpret_cast<COMMAND_BUFFER_HEADER *>(commandHeader);
@@ -352,7 +352,7 @@ TEST_F(WddmCommandStreamTest, givenWdmmWhenSubmitIsCalledAndThrottleIsToMediumTh
LinearStream cs(commandBuffer);
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
csr->flush(batchBuffer, EngineType::ENGINE_RCS, &csr->getResidencyAllocations(), *device->getOsContext());
csr->flush(batchBuffer, EngineType::ENGINE_RCS, csr->getResidencyAllocations(), *device->getOsContext());
auto commandHeader = wddm->submitResult.commandHeaderSubmitted;
COMMAND_BUFFER_HEADER *pHeader = reinterpret_cast<COMMAND_BUFFER_HEADER *>(commandHeader);
@@ -370,7 +370,7 @@ TEST_F(WddmCommandStreamTest, givenWdmmWhenSubmitIsCalledAndThrottleIsToHighThen
LinearStream cs(commandBuffer);
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::HIGH, cs.getUsed(), &cs};
csr->flush(batchBuffer, EngineType::ENGINE_RCS, &csr->getResidencyAllocations(), *device->getOsContext());
csr->flush(batchBuffer, EngineType::ENGINE_RCS, csr->getResidencyAllocations(), *device->getOsContext());
auto commandHeader = wddm->submitResult.commandHeaderSubmitted;
COMMAND_BUFFER_HEADER *pHeader = reinterpret_cast<COMMAND_BUFFER_HEADER *>(commandHeader);
@@ -394,7 +394,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafDisabledWhenFlushIsCalledWithAll
ResidencyContainer allocationsForResidency = {linearStreamAllocation};
EXPECT_FALSE(wddm->isKmDafEnabled());
auto flushStamp = csr->flush(batchBuffer, EngineType::ENGINE_RCS, &allocationsForResidency, *device->getOsContext());
auto flushStamp = csr->flush(batchBuffer, EngineType::ENGINE_RCS, allocationsForResidency, *device->getOsContext());
EXPECT_EQ(0u, wddm->kmDafLockResult.called);
EXPECT_EQ(0u, wddm->kmDafLockResult.lockedAllocations.size());
@@ -410,7 +410,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafEnabledWhenFlushIsCalledWithoutA
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
wddm->setKmDafEnabled(true);
auto flushStamp = csr->flush(batchBuffer, EngineType::ENGINE_RCS, &csr->getResidencyAllocations(), *device->getOsContext());
auto flushStamp = csr->flush(batchBuffer, EngineType::ENGINE_RCS, csr->getResidencyAllocations(), *device->getOsContext());
EXPECT_EQ(0u, wddm->kmDafLockResult.called);
EXPECT_EQ(0u, wddm->kmDafLockResult.lockedAllocations.size());
@@ -433,7 +433,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafEnabledWhenFlushIsCalledWithResi
EXPECT_EQ(linearStreamAllocation, csr->getResidencyAllocations()[0]);
wddm->setKmDafEnabled(true);
auto flushStamp = csr->flush(batchBuffer, EngineType::ENGINE_RCS, &csr->getResidencyAllocations(), *device->getOsContext());
auto flushStamp = csr->flush(batchBuffer, EngineType::ENGINE_RCS, csr->getResidencyAllocations(), *device->getOsContext());
EXPECT_EQ(1u, wddm->kmDafLockResult.called);
EXPECT_EQ(1u, wddm->kmDafLockResult.lockedAllocations.size());
@@ -455,7 +455,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafEnabledWhenFlushIsCalledWithAllo
ResidencyContainer allocationsForResidency = {linearStreamAllocation};
wddm->setKmDafEnabled(true);
auto flushStamp = csr->flush(batchBuffer, EngineType::ENGINE_RCS, &allocationsForResidency, *device->getOsContext());
auto flushStamp = csr->flush(batchBuffer, EngineType::ENGINE_RCS, allocationsForResidency, *device->getOsContext());
EXPECT_EQ(1u, wddm->kmDafLockResult.called);
EXPECT_EQ(1u, wddm->kmDafLockResult.lockedAllocations.size());
@@ -477,7 +477,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafEnabledWhenFlushIsCalledWithAllo
ResidencyContainer allocationsForResidency = {fillPatternAllocation};
wddm->setKmDafEnabled(true);
auto flushStamp = csr->flush(batchBuffer, EngineType::ENGINE_RCS, &allocationsForResidency, *device->getOsContext());
auto flushStamp = csr->flush(batchBuffer, EngineType::ENGINE_RCS, allocationsForResidency, *device->getOsContext());
EXPECT_EQ(1u, wddm->kmDafLockResult.called);
EXPECT_EQ(1u, wddm->kmDafLockResult.lockedAllocations.size());
@@ -498,7 +498,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafEnabledWhenFlushIsCalledWithAllo
ResidencyContainer allocationsForResidency = {nonLinearStreamAllocation};
wddm->setKmDafEnabled(true);
auto flushStamp = csr->flush(batchBuffer, EngineType::ENGINE_RCS, &allocationsForResidency, *device->getOsContext());
auto flushStamp = csr->flush(batchBuffer, EngineType::ENGINE_RCS, allocationsForResidency, *device->getOsContext());
EXPECT_EQ(0u, wddm->kmDafLockResult.called);
EXPECT_EQ(0u, wddm->kmDafLockResult.lockedAllocations.size());
@@ -679,7 +679,7 @@ TEST_F(WddmCommandStreamMockGdiTest, FlushCallsWddmMakeResidentForResidencyAlloc
gdi->getMakeResidentArg().NumAllocations = 0;
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
csr->flush(batchBuffer, EngineType::ENGINE_RCS, &csr->getResidencyAllocations(), *device->getOsContext());
csr->flush(batchBuffer, EngineType::ENGINE_RCS, csr->getResidencyAllocations(), *device->getOsContext());
EXPECT_NE(0u, gdi->getMakeResidentArg().NumAllocations);