mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 09:14:47 +08:00
fix: add missing in-order signalling in appendCopyImageBlit
Related-To: GSD-10281 Signed-off-by: Fabian Zwoliński <fabian.zwolinski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
fd1a000ae4
commit
de4d67610c
@@ -1375,6 +1375,10 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendCopyImageBlit(NEO::Graph
|
||||
size_t bytesPerPixel, const Vec3<size_t> ©Size,
|
||||
const Vec3<size_t> &srcSize, const Vec3<size_t> &dstSize,
|
||||
Event *signalEvent) {
|
||||
if (!handleCounterBasedEventOperations(signalEvent)) {
|
||||
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
auto clearColorAllocation = device->getNEODevice()->getDefaultEngine().commandStreamReceiver->getClearColorAllocation();
|
||||
|
||||
auto blitProperties = NEO::BlitProperties::constructPropertiesForCopy(dst, src,
|
||||
@@ -1392,6 +1396,12 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendCopyImageBlit(NEO::Graph
|
||||
dummyBlitWa.isWaRequired = true;
|
||||
|
||||
appendSignalEventPostWalker(signalEvent, nullptr, nullptr, false, false, true);
|
||||
|
||||
if (this->isInOrderExecutionEnabled()) {
|
||||
appendSignalInOrderDependencyCounter(signalEvent, false);
|
||||
}
|
||||
handleInOrderDependencyCounter(signalEvent, false, false);
|
||||
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "level_zero/core/source/gfx_core_helpers/l0_gfx_core_helper.h"
|
||||
#include "level_zero/core/test/unit_tests/fixtures/in_order_cmd_list_fixture.h"
|
||||
#include "level_zero/core/test/unit_tests/mocks/mock_event.h"
|
||||
#include "level_zero/core/test/unit_tests/mocks/mock_image.h"
|
||||
|
||||
#include <type_traits>
|
||||
#include <variant>
|
||||
@@ -1652,6 +1653,25 @@ HWTEST2_F(InOrderCmdListTests, givenNonInOrderCmdListWhenPassingCounterBasedEven
|
||||
immCmdList->copyThroughLockedPtrEnabled = true;
|
||||
EXPECT_EQ(ZE_RESULT_ERROR_INVALID_ARGUMENT, immCmdList->appendMemoryCopy(alloc, ©Data, 1, eventHandle, 0, nullptr, false, false));
|
||||
|
||||
{
|
||||
auto image = std::make_unique<WhiteBox<::L0::ImageCoreFamily<gfxCoreFamily>>>();
|
||||
ze_image_region_t imgRegion = {1, 1, 1, 1, 1, 1};
|
||||
ze_image_desc_t zeDesc = {};
|
||||
zeDesc.stype = ZE_STRUCTURE_TYPE_IMAGE_DESC;
|
||||
zeDesc.type = ZE_IMAGE_TYPE_3D;
|
||||
zeDesc.format.layout = ZE_IMAGE_FORMAT_LAYOUT_8_8_8_8;
|
||||
zeDesc.format.type = ZE_IMAGE_FORMAT_TYPE_UINT;
|
||||
zeDesc.width = 11;
|
||||
zeDesc.height = 13;
|
||||
zeDesc.depth = 17;
|
||||
zeDesc.format.x = ZE_IMAGE_FORMAT_SWIZZLE_A;
|
||||
zeDesc.format.y = ZE_IMAGE_FORMAT_SWIZZLE_0;
|
||||
zeDesc.format.z = ZE_IMAGE_FORMAT_SWIZZLE_1;
|
||||
zeDesc.format.w = ZE_IMAGE_FORMAT_SWIZZLE_X;
|
||||
image->initialize(device, &zeDesc);
|
||||
EXPECT_EQ(ZE_RESULT_ERROR_INVALID_ARGUMENT, copyOnlyCmdList->appendImageCopyFromMemoryExt(image->toHandle(), ©Data, &imgRegion, 0, 0, eventHandle, 0, nullptr, false));
|
||||
}
|
||||
|
||||
context->freeMem(alloc);
|
||||
}
|
||||
|
||||
@@ -3628,6 +3648,58 @@ HWTEST2_F(InOrderCmdListTests, givenCopyOnlyInOrderModeWhenProgrammingCopyRegion
|
||||
EXPECT_EQ(0u, sdiCmd->getDataDword1());
|
||||
}
|
||||
|
||||
HWTEST2_F(InOrderCmdListTests, givenCopyOnlyInOrderModeWhenProgrammingImageCopyFromMemoryExtThenSignalInOrderAllocation, IsAtLeastXeHpCore) {
|
||||
using XY_COPY_BLT = typename std::remove_const<decltype(FamilyType::cmdInitXyBlockCopyBlt)>::type;
|
||||
using MI_STORE_DATA_IMM = typename FamilyType::MI_STORE_DATA_IMM;
|
||||
|
||||
auto immCmdList = createCopyOnlyImmCmdList<gfxCoreFamily>();
|
||||
|
||||
auto cmdStream = immCmdList->getCmdContainer().getCommandStream();
|
||||
|
||||
void *srcPtr = reinterpret_cast<void *>(0x1234);
|
||||
|
||||
auto image = std::make_unique<WhiteBox<::L0::ImageCoreFamily<gfxCoreFamily>>>();
|
||||
ze_image_desc_t desc = {};
|
||||
desc.stype = ZE_STRUCTURE_TYPE_IMAGE_DESC;
|
||||
desc.type = ZE_IMAGE_TYPE_3D;
|
||||
desc.format.layout = ZE_IMAGE_FORMAT_LAYOUT_8_8_8_8;
|
||||
desc.format.type = ZE_IMAGE_FORMAT_TYPE_UINT;
|
||||
desc.width = 11;
|
||||
desc.height = 13;
|
||||
desc.depth = 17;
|
||||
|
||||
desc.format.x = ZE_IMAGE_FORMAT_SWIZZLE_A;
|
||||
desc.format.y = ZE_IMAGE_FORMAT_SWIZZLE_0;
|
||||
desc.format.z = ZE_IMAGE_FORMAT_SWIZZLE_1;
|
||||
desc.format.w = ZE_IMAGE_FORMAT_SWIZZLE_X;
|
||||
image->initialize(device, &desc);
|
||||
|
||||
immCmdList->appendImageCopyFromMemoryExt(image->toHandle(), srcPtr, nullptr, 0, 0, nullptr, 0, nullptr, false);
|
||||
auto offset = cmdStream->getUsed();
|
||||
immCmdList->appendImageCopyFromMemoryExt(image->toHandle(), srcPtr, nullptr, 0, 0, nullptr, 0, nullptr, false);
|
||||
|
||||
GenCmdList cmdList;
|
||||
ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer(cmdList,
|
||||
ptrOffset(cmdStream->getCpuBase(), offset),
|
||||
(cmdStream->getUsed() - offset)));
|
||||
|
||||
auto copyItor = find<XY_COPY_BLT *>(cmdList.begin(), cmdList.end());
|
||||
ASSERT_NE(cmdList.end(), copyItor);
|
||||
|
||||
auto sdiItor = find<MI_STORE_DATA_IMM *>(copyItor, cmdList.end());
|
||||
ASSERT_NE(cmdList.end(), sdiItor);
|
||||
|
||||
auto sdiCmd = genCmdCast<MI_STORE_DATA_IMM *>(*sdiItor);
|
||||
|
||||
auto inOrderExecInfo = immCmdList->inOrderExecInfo;
|
||||
uint64_t syncVa = inOrderExecInfo->isHostStorageDuplicated() ? reinterpret_cast<uint64_t>(inOrderExecInfo->getBaseHostAddress()) : inOrderExecInfo->getBaseDeviceAddress();
|
||||
|
||||
EXPECT_EQ(syncVa, sdiCmd->getAddress());
|
||||
EXPECT_EQ(immCmdList->isQwordInOrderCounter(), sdiCmd->getStoreQword());
|
||||
EXPECT_EQ(2u, sdiCmd->getDataDword0());
|
||||
EXPECT_EQ(0u, sdiCmd->getDataDword1());
|
||||
}
|
||||
|
||||
HWTEST2_F(InOrderCmdListTests, givenInOrderModeWhenProgrammingAppendWaitOnEventsThenSignalSyncAllocation, IsAtLeastXeHpCore) {
|
||||
using MI_STORE_DATA_IMM = typename FamilyType::MI_STORE_DATA_IMM;
|
||||
using MI_SEMAPHORE_WAIT = typename FamilyType::MI_SEMAPHORE_WAIT;
|
||||
|
||||
Reference in New Issue
Block a user