diff --git a/opencl/source/helpers/cl_blit_properties.h b/opencl/source/helpers/cl_blit_properties.h index f3986c8872..efb2fa4beb 100644 --- a/opencl/source/helpers/cl_blit_properties.h +++ b/opencl/source/helpers/cl_blit_properties.h @@ -123,11 +123,11 @@ struct ClBlitProperties { BlitterConstants::BlitDirection::HostPtrToImage != blitDirection && BlitterConstants::BlitDirection::ImageToHostPtr != blitDirection); - blitProperties = BlitProperties::constructPropertiesForReadWriteBuffer(blitDirection, commandStreamReceiver, gpuAllocation, - hostAllocation, hostPtr, memObjGpuVa, hostAllocGpuVa, - hostPtrOffset, copyOffset, copySize, - hostRowPitch, hostSlicePitch, - gpuRowPitch, gpuSlicePitch); + blitProperties = BlitProperties::constructPropertiesForReadWrite(blitDirection, commandStreamReceiver, gpuAllocation, + hostAllocation, hostPtr, memObjGpuVa, hostAllocGpuVa, + hostPtrOffset, copyOffset, copySize, + hostRowPitch, hostSlicePitch, + gpuRowPitch, gpuSlicePitch); if (BlitterConstants::BlitDirection::HostPtrToImage == blitDirection || BlitterConstants::BlitDirection::ImageToHostPtr == blitDirection) { diff --git a/opencl/test/unit_test/command_queue/blit_enqueue_tests.cpp b/opencl/test/unit_test/command_queue/blit_enqueue_tests.cpp index fd7744b9a6..1b3b705cd0 100644 --- a/opencl/test/unit_test/command_queue/blit_enqueue_tests.cpp +++ b/opencl/test/unit_test/command_queue/blit_enqueue_tests.cpp @@ -47,11 +47,11 @@ struct BlitEnqueueTests : public ::testing::Test { return BlitOperationResult::Unsupported; } - auto blitProperties = BlitProperties::constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection::HostPtrToBuffer, - *bcsCsr, memory, nullptr, - hostPtr, - memory->getGpuAddress(), 0, - 0, 0, size, 0, 0, 0, 0); + auto blitProperties = BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection::HostPtrToBuffer, + *bcsCsr, memory, nullptr, + hostPtr, + memory->getGpuAddress(), 0, + 0, 0, size, 0, 0, 0, 0); BlitPropertiesContainer container; container.push_back(blitProperties); diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_1_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_1_tests.cpp index d20c6ffc36..7135736535 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_1_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_1_tests.cpp @@ -860,10 +860,10 @@ HWTEST_F(BcsTests, givenBltSizeWithLeftoverWhenDispatchedThenProgramAllRequiredC csr.taskCount = newTaskCount - 1; uint32_t expectedResursiveLockCount = 0u; EXPECT_EQ(expectedResursiveLockCount, csr.recursiveLockCounter.load()); - auto blitProperties = BlitProperties::constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection::HostPtrToBuffer, - csr, buffer->getGraphicsAllocation(pDevice->getRootDeviceIndex()), nullptr, hostPtr, - buffer->getGraphicsAllocation(pDevice->getRootDeviceIndex())->getGpuAddress(), 0, - 0, 0, {bltSize, 1, 1}, 0, 0, 0, 0); + auto blitProperties = BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection::HostPtrToBuffer, + csr, buffer->getGraphicsAllocation(pDevice->getRootDeviceIndex()), nullptr, hostPtr, + buffer->getGraphicsAllocation(pDevice->getRootDeviceIndex())->getGpuAddress(), 0, + 0, 0, {bltSize, 1, 1}, 0, 0, 0, 0); if (csr.getClearColorAllocation()) { expectedResursiveLockCount++; } @@ -1071,19 +1071,19 @@ HWTEST_P(BcsDetaliedTestsWithParams, givenBltSizeWithLeftoverWhenDispatchedThenP size_t srcSlicePitch = std::get<0>(GetParam()).srcSlicePitch; auto allocation = buffer->getGraphicsAllocation(pDevice->getRootDeviceIndex()); - auto blitProperties = BlitProperties::constructPropertiesForReadWriteBuffer(std::get<1>(GetParam()), //blitDirection - csr, allocation, //commandStreamReceiver - nullptr, //memObjAllocation - hostPtr, //preallocatedHostAllocation - allocation->getGpuAddress(), //memObjGpuVa - 0, //hostAllocGpuVa - hostPtrOffset, //hostPtrOffset - copyOffset, //copyOffset - bltSize, //copySize - dstRowPitch, //hostRowPitch - dstSlicePitch, //hostSlicePitch - srcRowPitch, //gpuRowPitch - srcSlicePitch //gpuSlicePitch + auto blitProperties = BlitProperties::constructPropertiesForReadWrite(std::get<1>(GetParam()), //blitDirection + csr, allocation, //commandStreamReceiver + nullptr, //memObjAllocation + hostPtr, //preallocatedHostAllocation + allocation->getGpuAddress(), //memObjGpuVa + 0, //hostAllocGpuVa + hostPtrOffset, //hostPtrOffset + copyOffset, //copyOffset + bltSize, //copySize + dstRowPitch, //hostRowPitch + dstSlicePitch, //hostSlicePitch + srcRowPitch, //gpuRowPitch + srcSlicePitch //gpuSlicePitch ); blitBuffer(&csr, blitProperties, true); @@ -1169,19 +1169,19 @@ HWTEST_P(BcsDetaliedTestsWithParams, givenBltSizeWithLeftoverWhenDispatchedThenP size_t srcSlicePitch = std::get<0>(GetParam()).srcSlicePitch; auto allocation = buffer->getGraphicsAllocation(pDevice->getRootDeviceIndex()); - auto blitProperties = BlitProperties::constructPropertiesForReadWriteBuffer(std::get<1>(GetParam()), //blitDirection - csr, allocation, //commandStreamReceiver - nullptr, //memObjAllocation - hostPtr, //preallocatedHostAllocation - allocation->getGpuAddress(), //memObjGpuVa - 0, //hostAllocGpuVa - hostPtrOffset, //hostPtrOffset - copyOffset, //copyOffset - bltSize, //copySize - dstRowPitch, //hostRowPitch - dstSlicePitch, //hostSlicePitch - srcRowPitch, //gpuRowPitch - srcSlicePitch //gpuSlicePitch + auto blitProperties = BlitProperties::constructPropertiesForReadWrite(std::get<1>(GetParam()), //blitDirection + csr, allocation, //commandStreamReceiver + nullptr, //memObjAllocation + hostPtr, //preallocatedHostAllocation + allocation->getGpuAddress(), //memObjGpuVa + 0, //hostAllocGpuVa + hostPtrOffset, //hostPtrOffset + copyOffset, //copyOffset + bltSize, //copySize + dstRowPitch, //hostRowPitch + dstSlicePitch, //hostSlicePitch + srcRowPitch, //gpuRowPitch + srcSlicePitch //gpuSlicePitch ); blitBuffer(&csr, blitProperties, true); diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_2_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_2_tests.cpp index 21307e00b0..b1e0699f84 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_2_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_2_tests.cpp @@ -213,10 +213,10 @@ HWTEST_F(BcsTests, givenCsrDependenciesWhenProgrammingCommandStreamThenAddSemaph size_t numberNodesPerContainer = 5; auto graphicsAllocation = buffer->getGraphicsAllocation(pDevice->getRootDeviceIndex()); - auto blitProperties = BlitProperties::constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection::HostPtrToBuffer, - csr, graphicsAllocation, nullptr, hostPtr, - graphicsAllocation->getGpuAddress(), 0, - 0, 0, {1, 1, 1}, 0, 0, 0, 0); + auto blitProperties = BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection::HostPtrToBuffer, + csr, graphicsAllocation, nullptr, hostPtr, + graphicsAllocation->getGpuAddress(), 0, + 0, 0, {1, 1, 1}, 0, 0, 0, 0); MockTimestampPacketContainer timestamp0(*csr.getTimestampPacketAllocator(), numberNodesPerContainer); MockTimestampPacketContainer timestamp1(*csr.getTimestampPacketAllocator(), numberNodesPerContainer); @@ -267,14 +267,14 @@ HWTEST_F(BcsTests, givenMultipleBlitPropertiesWhenDispatchingThenProgramCommands auto graphicsAllocation1 = buffer1->getGraphicsAllocation(pDevice->getRootDeviceIndex()); auto graphicsAllocation2 = buffer2->getGraphicsAllocation(pDevice->getRootDeviceIndex()); - auto blitProperties1 = BlitProperties::constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection::HostPtrToBuffer, - csr, graphicsAllocation1, nullptr, hostPtr1, - graphicsAllocation1->getGpuAddress(), 0, - 0, 0, {1, 1, 1}, 0, 0, 0, 0); - auto blitProperties2 = BlitProperties::constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection::HostPtrToBuffer, - csr, graphicsAllocation2, nullptr, hostPtr2, - graphicsAllocation2->getGpuAddress(), 0, - 0, 0, {1, 1, 1}, 0, 0, 0, 0); + auto blitProperties1 = BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection::HostPtrToBuffer, + csr, graphicsAllocation1, nullptr, hostPtr1, + graphicsAllocation1->getGpuAddress(), 0, + 0, 0, {1, 1, 1}, 0, 0, 0, 0); + auto blitProperties2 = BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection::HostPtrToBuffer, + csr, graphicsAllocation2, nullptr, hostPtr2, + graphicsAllocation2->getGpuAddress(), 0, + 0, 0, {1, 1, 1}, 0, 0, 0, 0); MockTimestampPacketContainer timestamp1(*csr.getTimestampPacketAllocator(), 1); MockTimestampPacketContainer timestamp2(*csr.getTimestampPacketAllocator(), 1); @@ -325,10 +325,10 @@ HWTEST_F(BcsTests, givenProfilingEnabledWhenBlitBufferThenCommandBufferIsConstru void *hostPtr = reinterpret_cast(0x12340000); auto graphicsAllocation = buffer->getGraphicsAllocation(pDevice->getRootDeviceIndex()); - auto blitProperties = BlitProperties::constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection::HostPtrToBuffer, - *bcsCsr, graphicsAllocation, nullptr, hostPtr, - graphicsAllocation->getGpuAddress(), 0, - 0, 0, {1, 1, 1}, 0, 0, 0, 0); + auto blitProperties = BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection::HostPtrToBuffer, + *bcsCsr, graphicsAllocation, nullptr, hostPtr, + graphicsAllocation->getGpuAddress(), 0, + 0, 0, {1, 1, 1}, 0, 0, 0, 0); MockTimestampPacketContainer timestamp(*bcsCsr->getTimestampPacketAllocator(), 1u); blitProperties.outputTimestampPacket = timestamp.getNode(0); @@ -368,10 +368,10 @@ HWTEST_F(BcsTests, givenNotInitializedOsContextWhenBlitBufferIsCalledThenInitial auto buffer = clUniquePtr(Buffer::create(context.get(), CL_MEM_READ_WRITE, 1, nullptr, retVal)); void *hostPtr = reinterpret_cast(0x12340000); auto graphicsAllocation = buffer->getGraphicsAllocation(pDevice->getRootDeviceIndex()); - auto blitProperties = BlitProperties::constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection::HostPtrToBuffer, - *bcsCsr, graphicsAllocation, nullptr, hostPtr, - graphicsAllocation->getGpuAddress(), 0, - 0, 0, {1, 1, 1}, 0, 0, 0, 0); + auto blitProperties = BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection::HostPtrToBuffer, + *bcsCsr, graphicsAllocation, nullptr, hostPtr, + graphicsAllocation->getGpuAddress(), 0, + 0, 0, {1, 1, 1}, 0, 0, 0, 0); MockTimestampPacketContainer timestamp(*bcsCsr->getTimestampPacketAllocator(), 1u); blitProperties.outputTimestampPacket = timestamp.getNode(0); @@ -397,15 +397,15 @@ HWTEST_F(BcsTests, givenInputAllocationsWhenBlitDispatchedThenMakeAllAllocations auto graphicsAllocation1 = buffer1->getGraphicsAllocation(pDevice->getRootDeviceIndex()); auto graphicsAllocation2 = buffer2->getGraphicsAllocation(pDevice->getRootDeviceIndex()); - auto blitProperties1 = BlitProperties::constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection::HostPtrToBuffer, - csr, graphicsAllocation1, nullptr, hostPtr1, - graphicsAllocation1->getGpuAddress(), 0, - 0, 0, {1, 1, 1}, 0, 0, 0, 0); + auto blitProperties1 = BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection::HostPtrToBuffer, + csr, graphicsAllocation1, nullptr, hostPtr1, + graphicsAllocation1->getGpuAddress(), 0, + 0, 0, {1, 1, 1}, 0, 0, 0, 0); - auto blitProperties2 = BlitProperties::constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection::HostPtrToBuffer, - csr, graphicsAllocation2, nullptr, hostPtr2, - graphicsAllocation2->getGpuAddress(), 0, - 0, 0, {1, 1, 1}, 0, 0, 0, 0); + auto blitProperties2 = BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection::HostPtrToBuffer, + csr, graphicsAllocation2, nullptr, hostPtr2, + graphicsAllocation2->getGpuAddress(), 0, + 0, 0, {1, 1, 1}, 0, 0, 0, 0); BlitPropertiesContainer blitPropertiesContainer; blitPropertiesContainer.push_back(blitProperties1); @@ -450,15 +450,15 @@ HWTEST_F(BcsTests, givenFenceAllocationIsRequiredWhenBlitDispatchedThenMakeAllAl auto graphicsAllocation1 = buffer1->getGraphicsAllocation(pDevice->getRootDeviceIndex()); auto graphicsAllocation2 = buffer2->getGraphicsAllocation(pDevice->getRootDeviceIndex()); - auto blitProperties1 = BlitProperties::constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection::HostPtrToBuffer, - *bcsCsr, graphicsAllocation1, nullptr, hostPtr1, - graphicsAllocation1->getGpuAddress(), 0, - 0, 0, {1, 1, 1}, 0, 0, 0, 0); + auto blitProperties1 = BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection::HostPtrToBuffer, + *bcsCsr, graphicsAllocation1, nullptr, hostPtr1, + graphicsAllocation1->getGpuAddress(), 0, + 0, 0, {1, 1, 1}, 0, 0, 0, 0); - auto blitProperties2 = BlitProperties::constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection::HostPtrToBuffer, - *bcsCsr, graphicsAllocation2, nullptr, hostPtr2, - graphicsAllocation2->getGpuAddress(), 0, - 0, 0, {1, 1, 1}, 0, 0, 0, 0); + auto blitProperties2 = BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection::HostPtrToBuffer, + *bcsCsr, graphicsAllocation2, nullptr, hostPtr2, + graphicsAllocation2->getGpuAddress(), 0, + 0, 0, {1, 1, 1}, 0, 0, 0, 0); BlitPropertiesContainer blitPropertiesContainer; blitPropertiesContainer.push_back(blitProperties1); @@ -496,10 +496,10 @@ HWTEST_F(BcsTests, givenBufferWhenBlitCalledThenFlushCommandBuffer) { uint32_t newTaskCount = 17; csr.taskCount = newTaskCount - 1; - auto blitProperties = BlitProperties::constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection::HostPtrToBuffer, - csr, graphicsAllocation, nullptr, hostPtr, - graphicsAllocation->getGpuAddress(), 0, - 0, 0, {1, 1, 1}, 0, 0, 0, 0); + auto blitProperties = BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection::HostPtrToBuffer, + csr, graphicsAllocation, nullptr, hostPtr, + graphicsAllocation->getGpuAddress(), 0, + 0, 0, {1, 1, 1}, 0, 0, 0, 0); blitBuffer(&csr, blitProperties, true); @@ -547,11 +547,11 @@ HWTEST_F(BcsTests, whenBlitFromHostPtrCalledThenCallWaitWithKmdFallback) { void *hostPtr = reinterpret_cast(0x12340000); auto graphicsAllocation = buffer->getGraphicsAllocation(pDevice->getRootDeviceIndex()); - auto blitProperties = BlitProperties::constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection::HostPtrToBuffer, - *myMockCsr, graphicsAllocation, nullptr, - hostPtr, - graphicsAllocation->getGpuAddress(), 0, - 0, 0, {1, 1, 1}, 0, 0, 0, 0); + auto blitProperties = BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection::HostPtrToBuffer, + *myMockCsr, graphicsAllocation, nullptr, + hostPtr, + graphicsAllocation->getGpuAddress(), 0, + 0, 0, {1, 1, 1}, 0, 0, 0, 0); blitBuffer(myMockCsr.get(), blitProperties, false); @@ -580,10 +580,10 @@ HWTEST_F(BcsTests, whenBlitFromHostPtrCalledThenCleanTemporaryAllocations) { EXPECT_EQ(0u, mockInternalAllocationsStorage->cleanAllocationsCalled); - auto blitProperties = BlitProperties::constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection::HostPtrToBuffer, - bcsCsr, graphicsAllocation, nullptr, hostPtr, - graphicsAllocation->getGpuAddress(), 0, - 0, 0, {1, 1, 1}, 0, 0, 0, 0); + auto blitProperties = BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection::HostPtrToBuffer, + bcsCsr, graphicsAllocation, nullptr, hostPtr, + graphicsAllocation->getGpuAddress(), 0, + 0, 0, {1, 1, 1}, 0, 0, 0, 0); blitBuffer(&bcsCsr, blitProperties, false); @@ -621,12 +621,12 @@ HWTEST_F(BcsTests, givenBufferWhenBlitOperationCalledThenProgramCorrectGpuAddres { // from hostPtr HardwareParse hwParser; - auto blitProperties = BlitProperties::constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection::HostPtrToBuffer, - csr, graphicsAllocation1, - nullptr, hostPtr, - graphicsAllocation1->getGpuAddress() + - subBuffer1->getOffset(), - 0, {hostPtrOffset, 0, 0}, 0, copySize, 0, 0, 0, 0); + auto blitProperties = BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection::HostPtrToBuffer, + csr, graphicsAllocation1, + nullptr, hostPtr, + graphicsAllocation1->getGpuAddress() + + subBuffer1->getOffset(), + 0, {hostPtrOffset, 0, 0}, 0, copySize, 0, 0, 0, 0); blitBuffer(&csr, blitProperties, true); @@ -646,12 +646,12 @@ HWTEST_F(BcsTests, givenBufferWhenBlitOperationCalledThenProgramCorrectGpuAddres // to hostPtr HardwareParse hwParser; auto offset = csr.commandStream.getUsed(); - auto blitProperties = BlitProperties::constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection::BufferToHostPtr, - csr, graphicsAllocation1, - nullptr, hostPtr, - graphicsAllocation1->getGpuAddress() + - subBuffer1->getOffset(), - 0, {hostPtrOffset, 0, 0}, 0, copySize, 0, 0, 0, 0); + auto blitProperties = BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection::BufferToHostPtr, + csr, graphicsAllocation1, + nullptr, hostPtr, + graphicsAllocation1->getGpuAddress() + + subBuffer1->getOffset(), + 0, {hostPtrOffset, 0, 0}, 0, copySize, 0, 0, 0, 0); blitBuffer(&csr, blitProperties, true); @@ -745,12 +745,12 @@ HWTEST_F(BcsTests, givenMapAllocationWhenDispatchReadWriteOperationThenSetValidG { // from hostPtr HardwareParse hwParser; - auto blitProperties = BlitProperties::constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection::HostPtrToBuffer, - csr, graphicsAllocation, - mapAllocation, mapPtr, - graphicsAllocation->getGpuAddress(), - castToUint64(mapPtr), - {hostPtrOffset, 0, 0}, 0, copySize, 0, 0, 0, 0); + auto blitProperties = BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection::HostPtrToBuffer, + csr, graphicsAllocation, + mapAllocation, mapPtr, + graphicsAllocation->getGpuAddress(), + castToUint64(mapPtr), + {hostPtrOffset, 0, 0}, 0, copySize, 0, 0, 0, 0); blitBuffer(&csr, blitProperties, true); hwParser.parseCommands(csr.commandStream); @@ -769,11 +769,11 @@ HWTEST_F(BcsTests, givenMapAllocationWhenDispatchReadWriteOperationThenSetValidG // to hostPtr HardwareParse hwParser; auto offset = csr.commandStream.getUsed(); - auto blitProperties = BlitProperties::constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection::BufferToHostPtr, - csr, graphicsAllocation, - mapAllocation, mapPtr, - graphicsAllocation->getGpuAddress(), - castToUint64(mapPtr), {hostPtrOffset, 0, 0}, 0, copySize, 0, 0, 0, 0); + auto blitProperties = BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection::BufferToHostPtr, + csr, graphicsAllocation, + mapAllocation, mapPtr, + graphicsAllocation->getGpuAddress(), + castToUint64(mapPtr), {hostPtrOffset, 0, 0}, 0, copySize, 0, 0, 0, 0); blitBuffer(&csr, blitProperties, true); hwParser.parseCommands(csr.commandStream, offset); @@ -793,11 +793,11 @@ HWTEST_F(BcsTests, givenMapAllocationWhenDispatchReadWriteOperationThenSetValidG HardwareParse hwParser; auto offset = csr.commandStream.getUsed(); auto copySize = Vec3(4, 2, 1); - auto blitProperties = BlitProperties::constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection::BufferToHostPtr, - csr, graphicsAllocation, - mapAllocation, mapPtr, - graphicsAllocation->getGpuAddress(), - castToUint64(mapPtr), {hostPtrOffset, 0, 0}, 0, copySize, 0, 0, 0, 0); + auto blitProperties = BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection::BufferToHostPtr, + csr, graphicsAllocation, + mapAllocation, mapPtr, + graphicsAllocation->getGpuAddress(), + castToUint64(mapPtr), {hostPtrOffset, 0, 0}, 0, copySize, 0, 0, 0, 0); blitBuffer(&csr, blitProperties, true); hwParser.parseCommands(csr.commandStream, offset); @@ -814,12 +814,12 @@ HWTEST_F(BcsTests, givenMapAllocationWhenDispatchReadWriteOperationThenSetValidG { // bufferWrite from hostPtr HardwareParse hwParser; - auto blitProperties = BlitProperties::constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection::HostPtrToBuffer, - csr, graphicsAllocation, - mapAllocation, mapPtr, - graphicsAllocation->getGpuAddress(), - castToUint64(mapPtr), - {hostPtrOffset, 0, 0}, 0, copySize, 0, 0, 0, 0); + auto blitProperties = BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection::HostPtrToBuffer, + csr, graphicsAllocation, + mapAllocation, mapPtr, + graphicsAllocation->getGpuAddress(), + castToUint64(mapPtr), + {hostPtrOffset, 0, 0}, 0, copySize, 0, 0, 0, 0); blitBuffer(&csr, blitProperties, true); hwParser.parseCommands(csr.commandStream); @@ -1024,11 +1024,11 @@ HWTEST_F(BcsTests, givenBufferWithOffsetWhenBlitOperationCalledThenProgramCorrec // from hostPtr HardwareParse hwParser; auto offset = csr.commandStream.getUsed(); - auto blitProperties = BlitProperties::constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection::HostPtrToBuffer, - csr, graphicsAllocation1, - nullptr, hostPtr, - graphicsAllocation1->getGpuAddress(), - 0, 0, {buffer1Offset, 0, 0}, copySize, 0, 0, 0, 0); + auto blitProperties = BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection::HostPtrToBuffer, + csr, graphicsAllocation1, + nullptr, hostPtr, + graphicsAllocation1->getGpuAddress(), + 0, 0, {buffer1Offset, 0, 0}, copySize, 0, 0, 0, 0); blitBuffer(&csr, blitProperties, true); @@ -1048,11 +1048,11 @@ HWTEST_F(BcsTests, givenBufferWithOffsetWhenBlitOperationCalledThenProgramCorrec // to hostPtr HardwareParse hwParser; auto offset = csr.commandStream.getUsed(); - auto blitProperties = BlitProperties::constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection::BufferToHostPtr, - csr, graphicsAllocation1, nullptr, - hostPtr, - graphicsAllocation1->getGpuAddress(), - 0, 0, {buffer1Offset, 0, 0}, copySize, 0, 0, 0, 0); + auto blitProperties = BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection::BufferToHostPtr, + csr, graphicsAllocation1, nullptr, + hostPtr, + graphicsAllocation1->getGpuAddress(), + 0, 0, {buffer1Offset, 0, 0}, copySize, 0, 0, 0, 0); blitBuffer(&csr, blitProperties, true); @@ -1119,12 +1119,12 @@ HWTEST_F(BcsTests, givenBufferWithBigSizesWhenBlitOperationCalledThenProgramCorr // from hostPtr HardwareParse hwParser; auto offset = csr.commandStream.getUsed(); - auto blitProperties = BlitProperties::constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection::HostPtrToBuffer, - csr, graphicsAllocation, - nullptr, hostPtr, - graphicsAllocation->getGpuAddress(), - 0, srcOrigin, dstOrigin, region, - srcRowPitch, srcSlicePitch, dstRowPitch, dstSlicePitch); + auto blitProperties = BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection::HostPtrToBuffer, + csr, graphicsAllocation, + nullptr, hostPtr, + graphicsAllocation->getGpuAddress(), + 0, srcOrigin, dstOrigin, region, + srcRowPitch, srcSlicePitch, dstRowPitch, dstSlicePitch); blitBuffer(&csr, blitProperties, true); hwParser.parseCommands(csr.commandStream, offset); @@ -1266,10 +1266,10 @@ HWTEST_F(BcsTests, givenBlitterDirectSubmissionEnabledWhenProgrammingBlitterThen size_t numberNodesPerContainer = 5; auto graphicsAllocation = buffer->getGraphicsAllocation(pDevice->getRootDeviceIndex()); - auto blitProperties = BlitProperties::constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection::HostPtrToBuffer, - csr, graphicsAllocation, nullptr, hostPtr, - graphicsAllocation->getGpuAddress(), 0, - 0, 0, {1, 1, 1}, 0, 0, 0, 0); + auto blitProperties = BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection::HostPtrToBuffer, + csr, graphicsAllocation, nullptr, hostPtr, + graphicsAllocation->getGpuAddress(), 0, + 0, 0, {1, 1, 1}, 0, 0, 0, 0); MockTimestampPacketContainer timestamp0(*csr.getTimestampPacketAllocator(), numberNodesPerContainer); MockTimestampPacketContainer timestamp1(*csr.getTimestampPacketAllocator(), numberNodesPerContainer); diff --git a/opencl/test/unit_test/mem_obj/buffer_bcs_tests.cpp b/opencl/test/unit_test/mem_obj/buffer_bcs_tests.cpp index 1150a215e0..7a1db6fd83 100644 --- a/opencl/test/unit_test/mem_obj/buffer_bcs_tests.cpp +++ b/opencl/test/unit_test/mem_obj/buffer_bcs_tests.cpp @@ -41,11 +41,11 @@ struct BcsBufferTests : public ::testing::Test { auto mockBlitMemoryToAllocation = [this](const Device &device, GraphicsAllocation *memory, size_t offset, const void *hostPtr, Vec3 size) -> BlitOperationResult { - auto blitProperties = BlitProperties::constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection::HostPtrToBuffer, - *bcsCsr, memory, nullptr, - hostPtr, - memory->getGpuAddress(), 0, - 0, 0, size, 0, 0, 0, 0); + auto blitProperties = BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection::HostPtrToBuffer, + *bcsCsr, memory, nullptr, + hostPtr, + memory->getGpuAddress(), 0, + 0, 0, size, 0, 0, 0, 0); BlitPropertiesContainer container; container.push_back(blitProperties); diff --git a/shared/source/helpers/blit_commands_helper.cpp b/shared/source/helpers/blit_commands_helper.cpp index 4963b50c94..a52bfb3e51 100644 --- a/shared/source/helpers/blit_commands_helper.cpp +++ b/shared/source/helpers/blit_commands_helper.cpp @@ -16,15 +16,15 @@ namespace BlitHelperFunctions { BlitMemoryToAllocationFunc blitMemoryToAllocation = BlitHelper::blitMemoryToAllocation; } // namespace BlitHelperFunctions -BlitProperties BlitProperties::constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection blitDirection, - CommandStreamReceiver &commandStreamReceiver, - GraphicsAllocation *memObjAllocation, - GraphicsAllocation *preallocatedHostAllocation, - const void *hostPtr, uint64_t memObjGpuVa, - uint64_t hostAllocGpuVa, Vec3 hostPtrOffset, - Vec3 copyOffset, Vec3 copySize, - size_t hostRowPitch, size_t hostSlicePitch, - size_t gpuRowPitch, size_t gpuSlicePitch) { +BlitProperties BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection blitDirection, + CommandStreamReceiver &commandStreamReceiver, + GraphicsAllocation *memObjAllocation, + GraphicsAllocation *preallocatedHostAllocation, + const void *hostPtr, uint64_t memObjGpuVa, + uint64_t hostAllocGpuVa, Vec3 hostPtrOffset, + Vec3 copyOffset, Vec3 copySize, + size_t hostRowPitch, size_t hostSlicePitch, + size_t gpuRowPitch, size_t gpuSlicePitch) { GraphicsAllocation *hostAllocation = nullptr; auto clearColorAllocation = commandStreamReceiver.getClearColorAllocation(); diff --git a/shared/source/helpers/blit_commands_helper.h b/shared/source/helpers/blit_commands_helper.h index 3c161d1d8d..3b9a562214 100644 --- a/shared/source/helpers/blit_commands_helper.h +++ b/shared/source/helpers/blit_commands_helper.h @@ -39,15 +39,15 @@ struct TimestampPacketDependencies; using BlitPropertiesContainer = StackVec; struct BlitProperties { - static BlitProperties constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection blitDirection, - CommandStreamReceiver &commandStreamReceiver, - GraphicsAllocation *memObjAllocation, - GraphicsAllocation *preallocatedHostAllocation, - const void *hostPtr, uint64_t memObjGpuVa, - uint64_t hostAllocGpuVa, Vec3 hostPtrOffset, - Vec3 copyOffset, Vec3 copySize, - size_t hostRowPitch, size_t hostSlicePitch, - size_t gpuRowPitch, size_t gpuSlicePitch); + static BlitProperties constructPropertiesForReadWrite(BlitterConstants::BlitDirection blitDirection, + CommandStreamReceiver &commandStreamReceiver, + GraphicsAllocation *memObjAllocation, + GraphicsAllocation *preallocatedHostAllocation, + const void *hostPtr, uint64_t memObjGpuVa, + uint64_t hostAllocGpuVa, Vec3 hostPtrOffset, + Vec3 copyOffset, Vec3 copySize, + size_t hostRowPitch, size_t hostSlicePitch, + size_t gpuRowPitch, size_t gpuSlicePitch); static BlitProperties constructPropertiesForCopyBuffer(GraphicsAllocation *dstAllocation, GraphicsAllocation *srcAllocation, Vec3 dstOffset, Vec3 srcOffset, Vec3 copySize,