Do not split copies when using copy engine.

- no need to do so, BCS handles misaligned offsets and sizes.
Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:
Michal Mrozek
2021-12-09 14:42:20 +00:00
committed by Compute-Runtime-Automation
parent f7b735e12b
commit 1c018bf57e
2 changed files with 5 additions and 11 deletions

View File

@ -1010,15 +1010,9 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendPageFaultCopy(NEO::Graph
uintptr_t srcAddress = static_cast<uintptr_t>(srcAllocation->getGpuAddress());
ze_result_t ret = ZE_RESULT_ERROR_UNKNOWN;
if (isCopyOnly()) {
ret = appendMemoryCopyBlit(dstAddress, dstAllocation, 0u,
srcAddress, srcAllocation, 0u,
size - rightSize);
if (ret == ZE_RESULT_SUCCESS && rightSize) {
ret = appendMemoryCopyBlit(dstAddress, dstAllocation, size - rightSize,
srcAddress, srcAllocation, size - rightSize,
rightSize);
}
return appendMemoryCopyBlit(dstAddress, dstAllocation, 0u,
srcAddress, srcAllocation, 0u,
size);
} else {
ret = appendMemoryCopyKernelWithGA(reinterpret_cast<void *>(&dstAddress),
dstAllocation, 0,

View File

@ -232,7 +232,7 @@ HWTEST2_F(CommandListCreate, givenCommandListWhenPageFaultCopyCalledAndErrorOnMi
EXPECT_EQ(cmdList.appendMemoryCopyKernelWithGAStatelessCalledTimes, 0u);
}
HWTEST2_F(CommandListCreate, givenCommandListWhenPageFaultCopyCalledWithCopyEngineThenappendPageFaultCopyWithappendMemoryCopyKernelWithGACalledForMiddleAndRightSizesAreCalled, Platforms) {
HWTEST2_F(CommandListCreate, givenCommandListWhenPageFaultCopyCalledWithCopyEngineThenappendPageFaultCopyWithappendMemoryCopyCalledOnlyOnce, Platforms) {
MockCommandListHw<gfxCoreFamily> cmdList;
size_t size = ((sizeof(uint32_t) * 4) + 1);
cmdList.initialize(device, NEO::EngineGroupType::Copy, 0u);
@ -243,7 +243,7 @@ HWTEST2_F(CommandListCreate, givenCommandListWhenPageFaultCopyCalledWithCopyEngi
reinterpret_cast<void *>(0x2345), size, 0, sizeof(uint32_t),
MemoryPool::System4KBPages);
cmdList.appendPageFaultCopy(&mockAllocationDst, &mockAllocationSrc, size, false);
EXPECT_EQ(cmdList.appendMemoryCopyBlitCalledTimes, 2u);
EXPECT_EQ(cmdList.appendMemoryCopyBlitCalledTimes, 1u);
}
HWTEST2_F(CommandListCreate, givenCommandListWhenPageFaultCopyCalledWithCopyEngineAndErrorOnMidOperationThenappendPageFaultCopyWithappendMemoryCopyKernelWithGACalledForMiddleIsCalled, Platforms) {