Revert "Dont make Surfaces resident on GPGPU CSR for blit enqueue"

This reverts commit d74edb3d3f.

Change-Id: Idd4fb27afd0b8a30be1dba1630ecd81932963fae
This commit is contained in:
Dunajski, Bartosz
2019-12-04 02:13:42 -07:00
committed by sys_ocldev
parent 96cc1081c0
commit c8a34e65f0
2 changed files with 4 additions and 30 deletions

View File

@ -902,13 +902,13 @@ CompletionStamp CommandQueueHw<GfxFamily>::enqueueCommandWithoutKernel(
timestampPacketDependencies.previousEnqueueNodes.makeResident(getGpgpuCommandStreamReceiver());
}
for (auto surface : CreateRange(surfaces, surfaceCount)) {
surface->makeResident(getGpgpuCommandStreamReceiver());
}
if (enqueueProperties.operation == EnqueueProperties::Operation::Blit) {
UNRECOVERABLE_IF(!enqueueProperties.blitPropertiesContainer);
this->bcsTaskCount = getBcsCommandStreamReceiver()->blitBuffer(*enqueueProperties.blitPropertiesContainer, false);
} else {
for (auto surface : CreateRange(surfaces, surfaceCount)) {
surface->makeResident(getGpgpuCommandStreamReceiver());
}
}
DispatchFlags dispatchFlags(

View File

@ -874,32 +874,6 @@ HWTEST_TEMPLATED_F(BcsBufferTests, givenBlockedBlitEnqueueWhenUnblockingThenMake
EXPECT_TRUE(bcsCsr->isMadeResident(eventDependency->getBaseGraphicsAllocation(), bcsCsr->taskCount));
}
HWTEST_TEMPLATED_F(BcsBufferTests, givenBufferWhenBlitEnqueueCalledThenMakeItResidentOnlyOnBcsCsr) {
auto bcsCsr = static_cast<UltCommandStreamReceiver<FamilyType> *>(commandQueue->getBcsCommandStreamReceiver());
auto gpgpuCsr = static_cast<UltCommandStreamReceiver<FamilyType> *>(&commandQueue->getGpgpuCommandStreamReceiver());
bcsCsr->storeMakeResidentAllocations = true;
gpgpuCsr->storeMakeResidentAllocations = true;
auto bufferForBlt = clUniquePtr(Buffer::create(bcsMockContext.get(), CL_MEM_READ_WRITE, 1, nullptr, retVal));
bufferForBlt->forceDisallowCPUCopy = true;
uint32_t hostPtrForEnqueue = 0;
commandQueue->enqueueReadBuffer(bufferForBlt.get(), CL_FALSE, 0, 1, &hostPtrForEnqueue, nullptr, 0, nullptr, nullptr);
EXPECT_TRUE(bcsCsr->isMadeResident(bufferForBlt->getGraphicsAllocation()));
EXPECT_FALSE(gpgpuCsr->isMadeResident(bufferForBlt->getGraphicsAllocation()));
auto &gpgpuResidency = gpgpuCsr->makeResidentAllocations;
auto &bcsResidency = bcsCsr->makeResidentAllocations;
auto findHostPtr = [&hostPtrForEnqueue](const std::pair<GraphicsAllocation *, uint32_t> &residentAllocation) {
return residentAllocation.first->getUnderlyingBuffer() == &hostPtrForEnqueue;
};
EXPECT_EQ(gpgpuResidency.end(), std::find_if(gpgpuResidency.begin(), gpgpuResidency.end(), findHostPtr));
EXPECT_NE(bcsResidency.end(), std::find_if(bcsResidency.begin(), bcsResidency.end(), findHostPtr));
}
HWTEST_TEMPLATED_F(BcsBufferTests, givenMapAllocationWhenEnqueueingReadOrWriteBufferThenStoreMapAllocationInDispatchParameters) {
DebugManager.flags.DisableZeroCopyForBuffers.set(true);
auto mockCmdQ = static_cast<MockCommandQueueHw<FamilyType> *>(commandQueue.get());