mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Making DSH and IOH always resident
Change-Id: Ib114b92cb5ee153f213c15c935f8f1d1cfeb46eb
This commit is contained in:

committed by
sys_ocldev

parent
d516cd6edc
commit
b0a6d9131a
@ -315,6 +315,29 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenTaskIsSu
|
||||
EXPECT_EQ(expectedUsedSize, commandStream.getUsed());
|
||||
}
|
||||
|
||||
HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrWhenflushTaskThenDshAndIohNotEvictable) {
|
||||
auto mockCsr = new MockCsrHw2<FamilyType>(*platformDevices[0]);
|
||||
pDevice->resetCommandStreamReceiver(mockCsr);
|
||||
DispatchFlags dispatchFlags;
|
||||
|
||||
mockCsr->flushTask(commandStream,
|
||||
0,
|
||||
dsh,
|
||||
ioh,
|
||||
ssh,
|
||||
taskLevel,
|
||||
dispatchFlags);
|
||||
|
||||
EXPECT_EQ(dsh.getGraphicsAllocation()->peekEvictable(), true);
|
||||
EXPECT_EQ(ssh.getGraphicsAllocation()->peekEvictable(), true);
|
||||
EXPECT_EQ(ioh.getGraphicsAllocation()->peekEvictable(), true);
|
||||
|
||||
dsh.getGraphicsAllocation()->setEvictable(false);
|
||||
EXPECT_EQ(dsh.getGraphicsAllocation()->peekEvictable(), false);
|
||||
dsh.getGraphicsAllocation()->setEvictable(true);
|
||||
EXPECT_EQ(dsh.getGraphicsAllocation()->peekEvictable(), true);
|
||||
}
|
||||
|
||||
HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeAndMidThreadPreemptionWhenFlushTaskIsCalledThenSipKernelIsMadeResident) {
|
||||
auto mockCsr = new MockCsrHw2<FamilyType>(*platformDevices[0]);
|
||||
pDevice->resetCommandStreamReceiver(mockCsr);
|
||||
|
@ -668,15 +668,21 @@ HWTEST_F(WddmCommandStreamMockGdiTest, givenRecordedCommandBufferWhenItIsSubmitt
|
||||
mockCsr->overrideSubmissionAggregator(mockedSubmissionsAggregator);
|
||||
|
||||
auto commandBuffer = memManager->allocateGraphicsMemory(1024, 4096);
|
||||
auto dshAlloc = memManager->allocateGraphicsMemory(1024, 4096);
|
||||
auto iohAlloc = memManager->allocateGraphicsMemory(1024, 4096);
|
||||
auto sshAlloc = memManager->allocateGraphicsMemory(1024, 4096);
|
||||
|
||||
mockCsr->setTagAllocation(tagAllocation);
|
||||
|
||||
LinearStream cs(commandBuffer);
|
||||
LinearStream dsh(dshAlloc);
|
||||
LinearStream ioh(iohAlloc);
|
||||
LinearStream ssh(sshAlloc);
|
||||
|
||||
DispatchFlags dispatchFlags;
|
||||
dispatchFlags.guardCommandBufferWithPipeControl = true;
|
||||
dispatchFlags.requiresCoherency = true;
|
||||
mockCsr->flushTask(cs, 0u, cs, cs, cs, 0u, dispatchFlags);
|
||||
mockCsr->flushTask(cs, 0u, dsh, ioh, ssh, 0u, dispatchFlags);
|
||||
|
||||
auto &cmdBuffers = mockedSubmissionsAggregator->peekCommandBuffers();
|
||||
auto storedCommandBuffer = cmdBuffers.peekHead();
|
||||
@ -692,11 +698,14 @@ HWTEST_F(WddmCommandStreamMockGdiTest, givenRecordedCommandBufferWhenItIsSubmitt
|
||||
auto csrCommandStream = mockCsr->commandStream.getGraphicsAllocation();
|
||||
EXPECT_EQ(reinterpret_cast<uint64_t>(csrCommandStream->getUnderlyingBuffer()), mockWddm->submitResult.commandBufferSubmitted);
|
||||
EXPECT_TRUE(((COMMAND_BUFFER_HEADER *)mockWddm->submitResult.commandHeaderSubmitted)->RequiresCoherency);
|
||||
EXPECT_EQ(3u, mockWddm->makeResidentResult.handleCount);
|
||||
EXPECT_EQ(6u, mockWddm->makeResidentResult.handleCount);
|
||||
|
||||
std::vector<D3DKMT_HANDLE> expectedHandles;
|
||||
expectedHandles.push_back(((WddmAllocation *)tagAllocation)->handle);
|
||||
expectedHandles.push_back(((WddmAllocation *)commandBuffer)->handle);
|
||||
expectedHandles.push_back(((WddmAllocation *)dshAlloc)->handle);
|
||||
expectedHandles.push_back(((WddmAllocation *)iohAlloc)->handle);
|
||||
expectedHandles.push_back(((WddmAllocation *)sshAlloc)->handle);
|
||||
expectedHandles.push_back(((WddmAllocation *)csrCommandStream)->handle);
|
||||
|
||||
for (auto i = 0u; i < mockWddm->makeResidentResult.handleCount; i++) {
|
||||
@ -712,8 +721,14 @@ HWTEST_F(WddmCommandStreamMockGdiTest, givenRecordedCommandBufferWhenItIsSubmitt
|
||||
|
||||
EXPECT_NE(trimListUnusedPosition, ((WddmAllocation *)tagAllocation)->getTrimCandidateListPosition());
|
||||
EXPECT_NE(trimListUnusedPosition, ((WddmAllocation *)commandBuffer)->getTrimCandidateListPosition());
|
||||
EXPECT_EQ(trimListUnusedPosition, ((WddmAllocation *)dshAlloc)->getTrimCandidateListPosition());
|
||||
EXPECT_EQ(trimListUnusedPosition, ((WddmAllocation *)iohAlloc)->getTrimCandidateListPosition());
|
||||
EXPECT_NE(trimListUnusedPosition, ((WddmAllocation *)sshAlloc)->getTrimCandidateListPosition());
|
||||
EXPECT_NE(trimListUnusedPosition, ((WddmAllocation *)csrCommandStream)->getTrimCandidateListPosition());
|
||||
|
||||
memManager->freeGraphicsMemory(dshAlloc);
|
||||
memManager->freeGraphicsMemory(iohAlloc);
|
||||
memManager->freeGraphicsMemory(sshAlloc);
|
||||
memManager->freeGraphicsMemory(commandBuffer);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user