From d796fb559d6802a23abef0cb81b02b5ec7a89487 Mon Sep 17 00:00:00 2001 From: Mateusz Jablonski Date: Thu, 29 Feb 2024 08:43:12 +0000 Subject: [PATCH] fix: don't program dummy blit prior to MI_FLUSH_DW without postsync add missing dummy blits before MI_FLUSH_DW with postsync Related-To: NEO-9996 Signed-off-by: Mateusz Jablonski --- level_zero/core/source/cmdlist/cmdlist_hw.inl | 22 +++--- .../source/cmdlist/cmdlist_hw_immediate.inl | 6 +- .../test_cmdlist_append_event_reset.cpp | 2 +- .../command_stream_receiver_hw_1_tests.cpp | 56 +++++--------- .../command_stream_receiver_hw_2_tests.cpp | 27 +++---- .../command_container/command_encoder.inl | 2 + .../command_stream_receiver_hw_base.inl | 11 +-- .../command_stream_receiver_hw_gen12lp.cpp | 14 ++-- shared/source/helpers/blit_commands_helper.h | 20 ++--- .../helpers/blit_commands_helper_base.inl | 74 +++++++++---------- .../blit_commands_helper_bdw_and_later.inl | 10 +-- .../blit_commands_helper_xehp_and_later.inl | 13 ++-- ...command_stream_receiver_hw_xe_hpc_core.cpp | 4 +- .../helpers/blit_commands_helper_tests.cpp | 47 +++++------- .../helpers/blit_commands_helper_tests.inl | 5 +- .../blit_commands_helper_tests_gen12lp.cpp | 8 +- ...est_blit_commands_helper_pvc_and_later.cpp | 34 +++------ ...st_blit_commands_helper_xehp_and_later.cpp | 3 +- 18 files changed, 155 insertions(+), 203 deletions(-) diff --git a/level_zero/core/source/cmdlist/cmdlist_hw.inl b/level_zero/core/source/cmdlist/cmdlist_hw.inl index 6fb5d1e5da..5e99be4d82 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw.inl @@ -1221,7 +1221,7 @@ ze_result_t CommandListCoreFamily::appendMemoryCopyBlit(uintptr_t NEO::BlitPropertiesContainer blitPropertiesContainer{blitProperties}; - NEO::BlitCommandsHelper::dispatchBlitCommandsForBufferPerRow(blitProperties, *commandContainer.getCommandStream(), this->dummyBlitWa); + NEO::BlitCommandsHelper::dispatchBlitCommandsForBufferPerRow(blitProperties, *commandContainer.getCommandStream(), *this->dummyBlitWa.rootDeviceEnvironment); makeResidentDummyAllocation(); return ZE_RESULT_SUCCESS; } @@ -1265,12 +1265,12 @@ ze_result_t CommandListCoreFamily::appendMemoryCopyBlitRegion(Ali } appendEventForProfiling(signalEvent, true, false); - auto &rootDeviceEnvironment = device->getNEODevice()->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]; - bool copyRegionPreferred = NEO::BlitCommandsHelper::isCopyRegionPreferred(copySizeModified, *rootDeviceEnvironment, blitProperties.isSystemMemoryPoolUsed); + auto &rootDeviceEnvironment = device->getNEODevice()->getRootDeviceEnvironmentRef(); + bool copyRegionPreferred = NEO::BlitCommandsHelper::isCopyRegionPreferred(copySizeModified, rootDeviceEnvironment, blitProperties.isSystemMemoryPoolUsed); if (copyRegionPreferred) { - NEO::BlitCommandsHelper::dispatchBlitCommandsForBufferRegion(blitProperties, *commandContainer.getCommandStream(), this->dummyBlitWa); + NEO::BlitCommandsHelper::dispatchBlitCommandsForBufferRegion(blitProperties, *commandContainer.getCommandStream(), rootDeviceEnvironment); } else { - NEO::BlitCommandsHelper::dispatchBlitCommandsForBufferPerRow(blitProperties, *commandContainer.getCommandStream(), this->dummyBlitWa); + NEO::BlitCommandsHelper::dispatchBlitCommandsForBufferPerRow(blitProperties, *commandContainer.getCommandStream(), rootDeviceEnvironment); } makeResidentDummyAllocation(); @@ -1300,7 +1300,7 @@ ze_result_t CommandListCoreFamily::appendCopyImageBlit(NEO::Graph commandContainer.addToResidencyContainer(clearColorAllocation); appendEventForProfiling(signalEvent, true, false); - NEO::BlitCommandsHelper::dispatchBlitCommandsForImageRegion(blitProperties, *commandContainer.getCommandStream(), dummyBlitWa); + NEO::BlitCommandsHelper::dispatchBlitCommandsForImageRegion(blitProperties, *commandContainer.getCommandStream(), *dummyBlitWa.rootDeviceEnvironment); makeResidentDummyAllocation(); appendSignalEventPostWalker(signalEvent, nullptr, false, false); @@ -2139,7 +2139,7 @@ ze_result_t CommandListCoreFamily::appendBlitFill(void *ptr, NEO::BlitCommandsHelper::dispatchBlitMemoryColorFill(gpuAllocation, offset, patternToCommand, patternSize, *commandContainer.getCommandStream(), size, - this->dummyBlitWa); + neoDevice->getRootDeviceEnvironmentRef()); makeResidentDummyAllocation(); appendSignalEventPostWalker(signalEvent, nullptr, false, false); @@ -2514,8 +2514,10 @@ ze_result_t CommandListCoreFamily::appendWaitOnEvents(uint32_t nu if (isImmediateType() && isCopyOnly() && trackDependencies) { NEO::MiFlushArgs args{this->dummyBlitWa}; args.commandWithPostSync = true; + args.waArgs.isWaRequired = true; NEO::EncodeMiFlushDW::programWithWa(*commandContainer.getCommandStream(), this->csr->getBarrierCountGpuAddress(), this->csr->getNextBarrierCount() + 1, args); commandContainer.addToResidencyContainer(this->csr->getTagAllocation()); + makeResidentDummyAllocation(); } if (apiRequest) { @@ -2525,8 +2527,6 @@ ze_result_t CommandListCoreFamily::appendWaitOnEvents(uint32_t nu handleInOrderDependencyCounter(nullptr, false); } - makeResidentDummyAllocation(); - if (NEO::debugManager.flags.EnableSWTags.get()) { neoDevice->getRootDeviceEnvironment().tagsManager->insertTag( *commandContainer.getCommandStream(), @@ -2695,6 +2695,7 @@ ze_result_t CommandListCoreFamily::appendWriteGlobalTimestamp( NEO::MiFlushArgs args{this->dummyBlitWa}; args.timeStampOperation = true; args.commandWithPostSync = true; + args.waArgs.isWaRequired = true; NEO::EncodeMiFlushDW::programWithWa(*commandContainer.getCommandStream(), allocationStruct.alignedAllocationPtr, 0, @@ -3243,6 +3244,7 @@ ze_result_t CommandListCoreFamily::appendBarrier(ze_event_handle_ TaskCountType value = 0u; if (isImmediateType()) { args.commandWithPostSync = true; + args.waArgs.isWaRequired = true; gpuAddress = this->csr->getBarrierCountGpuAddress(); value = this->csr->getNextBarrierCount() + 1; commandContainer.addToResidencyContainer(this->csr->getTagAllocation()); @@ -3454,6 +3456,7 @@ ze_result_t CommandListCoreFamily::appendWriteToMemory(void *desc if (isCopyOnly()) { NEO::MiFlushArgs args{this->dummyBlitWa}; args.commandWithPostSync = true; + args.waArgs.isWaRequired = true; NEO::EncodeMiFlushDW::programWithWa(*commandContainer.getCommandStream(), gpuAddress, data, args); makeResidentDummyAllocation(); @@ -3528,6 +3531,7 @@ void CommandListCoreFamily::dispatchPostSyncCopy(uint64_t gpuAddr NEO::MiFlushArgs miFlushArgs{this->dummyBlitWa}; miFlushArgs.commandWithPostSync = true; + miFlushArgs.waArgs.isWaRequired = true; NEO::EncodeMiFlushDW::programWithWa( *commandContainer.getCommandStream(), diff --git a/level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl b/level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl index 43838a1bc0..cf43b013c3 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl @@ -539,7 +539,7 @@ ze_result_t CommandListCoreFamilyImmediate::appendMemoryCopy( if (isCopyOnly()) { auto nBlits = size / (NEO::BlitCommandsHelper::getMaxBlitWidth(this->device->getNEODevice()->getRootDeviceEnvironment()) * NEO::BlitCommandsHelper::getMaxBlitHeight(this->device->getNEODevice()->getRootDeviceEnvironment(), true)); - auto sizePerBlit = sizeof(typename GfxFamily::XY_COPY_BLT) + NEO::BlitCommandsHelper::estimatePostBlitCommandSize(this->device->getNEODevice()->getRootDeviceEnvironment()); + auto sizePerBlit = sizeof(typename GfxFamily::XY_COPY_BLT) + NEO::BlitCommandsHelper::estimatePostBlitCommandSize(); estimatedSize += nBlits * sizePerBlit; } checkAvailableSpace(numWaitEvents, relaxedOrderingDispatch, estimatedSize); @@ -594,7 +594,7 @@ ze_result_t CommandListCoreFamilyImmediate::appendMemoryCopyRegio auto xBlits = static_cast(std::ceil(srcRegion->width / static_cast(BlitterConstants::maxBlitWidth))); auto yBlits = static_cast(std::ceil(srcRegion->height / static_cast(BlitterConstants::maxBlitHeight))); auto zBlits = static_cast(srcRegion->depth); - auto sizePerBlit = sizeof(typename GfxFamily::XY_COPY_BLT) + NEO::BlitCommandsHelper::estimatePostBlitCommandSize(this->device->getNEODevice()->getRootDeviceEnvironment()); + auto sizePerBlit = sizeof(typename GfxFamily::XY_COPY_BLT) + NEO::BlitCommandsHelper::estimatePostBlitCommandSize(); estimatedSize += xBlits * yBlits * zBlits * sizePerBlit; } checkAvailableSpace(numWaitEvents, relaxedOrderingDispatch, estimatedSize); @@ -757,7 +757,7 @@ ze_result_t CommandListCoreFamilyImmediate::appendImageCopyRegion if (isCopyOnly()) { auto imgSize = L0::Image::fromHandle(hSrcImage)->getImageInfo().size; auto nBlits = static_cast(std::ceil(imgSize / static_cast(BlitterConstants::maxBlitWidth * BlitterConstants::maxBlitHeight))); - auto sizePerBlit = sizeof(typename GfxFamily::XY_BLOCK_COPY_BLT) + NEO::BlitCommandsHelper::estimatePostBlitCommandSize(this->device->getNEODevice()->getRootDeviceEnvironment()); + auto sizePerBlit = sizeof(typename GfxFamily::XY_BLOCK_COPY_BLT) + NEO::BlitCommandsHelper::estimatePostBlitCommandSize(); estimatedSize += nBlits * sizePerBlit; } checkAvailableSpace(numWaitEvents, relaxedOrderingDispatch, estimatedSize); diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_event_reset.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_event_reset.cpp index 38962e318d..33c30f2863 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_event_reset.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_event_reset.cpp @@ -464,7 +464,7 @@ HWTEST2_F(CommandListAppendUsedPacketSignalEvent, EXPECT_EQ(2u, event->getPacketsInUse()); size_t usedAfterSize = cmdStream->getUsed(); - NEO::EncodeDummyBlitWaArgs waArgs{false, const_cast(&device->getNEODevice()->getRootDeviceEnvironment())}; + NEO::EncodeDummyBlitWaArgs waArgs{true, const_cast(&device->getNEODevice()->getRootDeviceEnvironment())}; size_t expectedSize = NEO::EncodeMiFlushDW::getCommandSizeWithWa(waArgs) * packets; EXPECT_EQ(expectedSize, (usedAfterSize - usedBeforeSize)); 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 f01461f0b9..63dcf9f441 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 @@ -689,12 +689,10 @@ HWTEST_F(BcsTests, givenBlitPropertiesContainerWhenEstimatingCommandsSizeThenCal const size_t bltSize = (3 * max2DBlitSize); const uint32_t numberOfBlitOperations = 4; - EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())}; - size_t dummyBlitWaSize = BlitCommandsHelper::getDummyBlitSize(waArgs); - waArgs.isWaRequired = false; + EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())}; auto baseSize = EncodeMiFlushDW::getCommandSizeWithWa(waArgs) + sizeof(typename FamilyType::MI_BATCH_BUFFER_END); - size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck::getCommandSize() + dummyBlitWaSize; + size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck::getCommandSize(); if (BlitCommandsHelper::miArbCheckWaRequired()) { cmdsSizePerBlit += EncodeMiFlushDW::getCommandSizeWithWa(waArgs); @@ -733,11 +731,9 @@ HWTEST_F(BcsTests, givenBlitPropertiesContainerWhenDirectsubmissionEnabledEstima const size_t bltSize = (3 * max2DBlitSize); const uint32_t numberOfBlitOperations = 4; - EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())}; - size_t dummyBlitWaSize = BlitCommandsHelper::getDummyBlitSize(waArgs); - waArgs.isWaRequired = false; + EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())}; auto baseSize = EncodeMiFlushDW::getCommandSizeWithWa(waArgs) + sizeof(typename FamilyType::MI_BATCH_BUFFER_START); - size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck::getCommandSize() + dummyBlitWaSize; + size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck::getCommandSize(); if (BlitCommandsHelper::miArbCheckWaRequired()) { cmdsSizePerBlit += EncodeMiFlushDW::getCommandSizeWithWa(waArgs); @@ -775,10 +771,8 @@ HWTEST_F(BcsTests, givenBlitPropertiesContainerWhenEstimatingCommandsSizeForWrit const Vec3 bltSize = {(3 * max2DBlitSize), 4, 2}; const size_t numberOfBlts = 3 * bltSize.y * bltSize.z; const size_t numberOfBlitOperations = 4 * bltSize.y * bltSize.z; - EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())}; - size_t dummyBlitWaSize = BlitCommandsHelper::getDummyBlitSize(waArgs); - waArgs.isWaRequired = false; - size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck::getCommandSize() + dummyBlitWaSize; + EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())}; + size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck::getCommandSize(); if (BlitCommandsHelper::miArbCheckWaRequired()) { cmdsSizePerBlit += EncodeMiFlushDW::getCommandSizeWithWa(waArgs); @@ -817,10 +811,8 @@ HWTEST_F(BcsTests, givenBlitPropertiesContainerWhenDirectSubmissionEnabledEstima const Vec3 bltSize = {(3 * max2DBlitSize), 4, 2}; const size_t numberOfBlts = 3 * bltSize.y * bltSize.z; const size_t numberOfBlitOperations = 4 * bltSize.y * bltSize.z; - EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())}; - size_t dummyBlitWaSize = BlitCommandsHelper::getDummyBlitSize(waArgs); - waArgs.isWaRequired = false; - size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck::getCommandSize() + dummyBlitWaSize; + EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())}; + size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck::getCommandSize(); if (BlitCommandsHelper::miArbCheckWaRequired()) { cmdsSizePerBlit += EncodeMiFlushDW::getCommandSizeWithWa(waArgs); @@ -858,7 +850,7 @@ HWTEST_F(BcsTests, givenTimestampPacketWriteRequestWhenEstimatingSizeForCommands EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())}; size_t dummyBlitWaSize = BlitCommandsHelper::getDummyBlitSize(waArgs); waArgs.isWaRequired = false; - size_t expectedBaseSize = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck::getCommandSize() + dummyBlitWaSize; + size_t expectedBaseSize = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck::getCommandSize(); if (BlitCommandsHelper::miArbCheckWaRequired()) { expectedBaseSize += EncodeMiFlushDW::getCommandSizeWithWa(waArgs); @@ -868,7 +860,7 @@ HWTEST_F(BcsTests, givenTimestampPacketWriteRequestWhenEstimatingSizeForCommands expectedBaseSize += EncodeMiFlushDW::getCommandSizeWithWa(waArgs); } - auto expectedSizeWithTimestampPacketWrite = expectedBaseSize + EncodeMiFlushDW::getCommandSizeWithWa(waArgs); + auto expectedSizeWithTimestampPacketWrite = expectedBaseSize + EncodeMiFlushDW::getCommandSizeWithWa(waArgs) + dummyBlitWaSize; auto expectedSizeWithoutTimestampPacketWrite = expectedBaseSize; auto estimatedSizeWithTimestampPacketWrite = BlitCommandsHelper::estimateBlitCommandSize( @@ -917,10 +909,8 @@ HWTEST_F(BcsTests, givenBltSizeAndCsrDependenciesWhenEstimatingCommandSizeThenAd csrDependencies.timestampPacketContainer.push_back(×tamp0); csrDependencies.timestampPacketContainer.push_back(×tamp1); - EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())}; - size_t dummyBlitWaSize = BlitCommandsHelper::getDummyBlitSize(waArgs); - waArgs.isWaRequired = false; - size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck::getCommandSize() + dummyBlitWaSize; + EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())}; + size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck::getCommandSize(); if (BlitCommandsHelper::miArbCheckWaRequired()) { cmdsSizePerBlit += EncodeMiFlushDW::getCommandSizeWithWa(waArgs); @@ -949,10 +939,8 @@ HWTEST_F(BcsTests, givenBltSizeWithCsrDependenciesAndRelaxedOrderingWhenEstimati csrDependencies.timestampPacketContainer.push_back(×tamp0); csrDependencies.timestampPacketContainer.push_back(×tamp1); - EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())}; - size_t dummyBlitWaSize = BlitCommandsHelper::getDummyBlitSize(waArgs); - waArgs.isWaRequired = false; - size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck::getCommandSize() + dummyBlitWaSize; + EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())}; + size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck::getCommandSize(); if (BlitCommandsHelper::miArbCheckWaRequired()) { cmdsSizePerBlit += EncodeMiFlushDW::getCommandSizeWithWa(waArgs); @@ -974,10 +962,8 @@ HWTEST_F(BcsTests, givenBltSizeWithCsrDependenciesAndRelaxedOrderingWhenEstimati HWTEST_F(BcsTests, givenImageAndBufferWhenEstimateBlitCommandSizeThenReturnCorrectCommandSize) { for (auto isImage : {false, true}) { - EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())}; - size_t dummyBlitWaSize = BlitCommandsHelper::getDummyBlitSize(waArgs); - waArgs.isWaRequired = false; - auto expectedSize = EncodeMiArbCheck::getCommandSize() + dummyBlitWaSize; + EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())}; + auto expectedSize = EncodeMiArbCheck::getCommandSize(); expectedSize += isImage ? sizeof(typename FamilyType::XY_BLOCK_COPY_BLT) : sizeof(typename FamilyType::XY_COPY_BLT); if (BlitCommandsHelper::miArbCheckWaRequired()) { @@ -1227,7 +1213,6 @@ HWTEST_F(BcsTests, givenBltSizeWithLeftoverWhenDispatchedThenProgramAllRequiredC EXPECT_EQ(expectedWidth, bltCmd->getSourcePitch()); if (BlitCommandsHelper::miArbCheckWaRequired()) { - UnitTestHelper::verifyDummyBlitWa(&(pDevice->getRootDeviceEnvironmentRef()), cmdIterator); auto miFlush = genCmdCast(*(cmdIterator++)); EXPECT_NE(nullptr, miFlush); EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())}; @@ -1252,7 +1237,9 @@ HWTEST_F(BcsTests, givenBltSizeWithLeftoverWhenDispatchedThenProgramAllRequiredC cmdIterator++; } } - + if (pDevice->getProductHelper().isDummyBlitWaRequired()) { + UnitTestHelper::verifyDummyBlitWa(&(pDevice->getRootDeviceEnvironmentRef()), cmdIterator); + } auto miFlushCmd = genCmdCast(*(cmdIterator++)); if (UnitTestHelper::additionalMiFlushDwRequired) { @@ -1464,7 +1451,6 @@ HWTEST_P(BcsDetaliedTestsWithParams, givenBltSizeWithLeftoverWhenDispatchedThenP offset += (expectedWidth * expectedHeight); if (BlitCommandsHelper::miArbCheckWaRequired()) { - UnitTestHelper::verifyDummyBlitWa(&(pDevice->getRootDeviceEnvironmentRef()), cmdIterator); auto miFlush = genCmdCast(*(cmdIterator++)); EXPECT_NE(nullptr, miFlush); EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())}; @@ -1568,7 +1554,6 @@ HWTEST_P(BcsDetaliedTestsWithParams, givenBltSizeWithLeftoverWhenDispatchedThenP offset += (expectedWidth * expectedHeight); if (BlitCommandsHelper::miArbCheckWaRequired()) { - UnitTestHelper::verifyDummyBlitWa(&(pDevice->getRootDeviceEnvironmentRef()), cmdIterator); auto miFlush = genCmdCast(*(cmdIterator++)); EXPECT_NE(nullptr, miFlush); EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())}; @@ -1662,7 +1647,6 @@ HWTEST_P(BcsDetaliedTestsWithParams, givenBltSizeWithLeftoverWhenDispatchedThenP offset += (expectedWidth * expectedHeight); if (BlitCommandsHelper::miArbCheckWaRequired()) { - UnitTestHelper::verifyDummyBlitWa(&(pDevice->getRootDeviceEnvironmentRef()), cmdIterator); auto miFlush = genCmdCast(*(cmdIterator++)); EXPECT_NE(nullptr, miFlush); EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())}; @@ -1670,8 +1654,6 @@ HWTEST_P(BcsDetaliedTestsWithParams, givenBltSizeWithLeftoverWhenDispatchedThenP miFlush = genCmdCast(*(cmdIterator++)); EXPECT_NE(nullptr, miFlush); } - } else { - UnitTestHelper::verifyDummyBlitWa(&(pDevice->getRootDeviceEnvironmentRef()), cmdIterator); } auto miArbCheckCmd = genCmdCast(*(cmdIterator++)); EXPECT_NE(nullptr, miArbCheckCmd); 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 afb9adaa63..35aa13fcd2 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 @@ -39,9 +39,8 @@ using namespace NEO; HWTEST_F(BcsTests, givenBltSizeWhenEstimatingCommandSizeThenAddAllRequiredCommands) { constexpr auto max2DBlitSize = BlitterConstants::maxBlitWidth * BlitterConstants::maxBlitHeight; EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())}; - size_t dummyBlitWaSize = BlitCommandsHelper::getDummyBlitSize(waArgs); waArgs.isWaRequired = false; - size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck::getCommandSize() + dummyBlitWaSize; + size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck::getCommandSize(); if (BlitCommandsHelper::miArbCheckWaRequired()) { cmdsSizePerBlit += EncodeMiFlushDW::getCommandSizeWithWa(waArgs); @@ -76,10 +75,8 @@ HWTEST_F(BcsTests, givenBltSizeWhenEstimatingCommandSizeThenAddAllRequiredComman HWTEST_F(BcsTests, givenDebugCapabilityWhenEstimatingCommandSizeThenAddAllRequiredCommands) { constexpr auto max2DBlitSize = BlitterConstants::maxBlitWidth * BlitterConstants::maxBlitHeight; - EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())}; - size_t dummyBlitWaSize = BlitCommandsHelper::getDummyBlitSize(waArgs); - waArgs.isWaRequired = false; - size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck::getCommandSize() + dummyBlitWaSize; + EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())}; + size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck::getCommandSize(); if (BlitCommandsHelper::miArbCheckWaRequired()) { cmdsSizePerBlit += EncodeMiFlushDW::getCommandSizeWithWa(waArgs); @@ -107,10 +104,8 @@ HWTEST_F(BcsTests, givenDebugCapabilityWhenEstimatingCommandSizeThenAddAllRequir } HWTEST_F(BcsTests, givenRelaxedOrderingEnabledWhenEstimatingCommandSizeThenAddAllRequiredCommands) { - EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())}; - size_t dummyBlitWaSize = BlitCommandsHelper::getDummyBlitSize(waArgs); - waArgs.isWaRequired = false; - size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck::getCommandSize() + dummyBlitWaSize; + EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())}; + size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck::getCommandSize(); if (BlitCommandsHelper::miArbCheckWaRequired()) { cmdsSizePerBlit += EncodeMiFlushDW::getCommandSizeWithWa(waArgs); @@ -139,10 +134,8 @@ HWTEST_F(BcsTests, givenRelaxedOrderingEnabledWhenEstimatingCommandSizeThenAddAl HWTEST_F(BcsTests, givenBltSizeWhenEstimatingCommandSizeForReadBufferRectThenAddAllRequiredCommands) { constexpr auto max2DBlitSize = BlitterConstants::maxBlitWidth * BlitterConstants::maxBlitHeight; - EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())}; - size_t dummyBlitWaSize = BlitCommandsHelper::getDummyBlitSize(waArgs); - waArgs.isWaRequired = false; - size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck::getCommandSize() + dummyBlitWaSize; + EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())}; + size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck::getCommandSize(); if (BlitCommandsHelper::miArbCheckWaRequired()) { cmdsSizePerBlit += EncodeMiFlushDW::getCommandSizeWithWa(waArgs); @@ -177,10 +170,8 @@ HWTEST_F(BcsTests, givenBltWithBigCopySizeWhenEstimatingCommandSizeForReadBuffer auto maxWidthToCopy = static_cast(BlitCommandsHelper::getMaxBlitWidth(rootDeviceEnvironment)); auto maxHeightToCopy = static_cast(BlitCommandsHelper::getMaxBlitHeight(rootDeviceEnvironment, false)); - EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())}; - size_t dummyBlitWaSize = BlitCommandsHelper::getDummyBlitSize(waArgs); - waArgs.isWaRequired = false; - size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck::getCommandSize() + dummyBlitWaSize; + EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())}; + size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck::getCommandSize(); if (BlitCommandsHelper::miArbCheckWaRequired()) { cmdsSizePerBlit += EncodeMiFlushDW::getCommandSizeWithWa(waArgs); diff --git a/shared/source/command_container/command_encoder.inl b/shared/source/command_container/command_encoder.inl index 480fe10466..cf78b4c7b8 100644 --- a/shared/source/command_container/command_encoder.inl +++ b/shared/source/command_container/command_encoder.inl @@ -997,7 +997,9 @@ void EncodeMiFlushDW::appendWa(LinearStream &commandStream, MiFlushAr template void EncodeMiFlushDW::programWithWa(LinearStream &commandStream, uint64_t immediateDataGpuAddress, uint64_t immediateData, MiFlushArgs &args) { + UNRECOVERABLE_IF(args.waArgs.isWaRequired && !args.commandWithPostSync); appendWa(commandStream, args); + args.waArgs.isWaRequired = false; auto miFlushDwCmd = commandStream.getSpaceForCmd(); MI_FLUSH_DW miFlush = Family::cmdInitMiFlushDw; diff --git a/shared/source/command_stream/command_stream_receiver_hw_base.inl b/shared/source/command_stream/command_stream_receiver_hw_base.inl index 08b4de37f0..af23ad4f59 100644 --- a/shared/source/command_stream/command_stream_receiver_hw_base.inl +++ b/shared/source/command_stream/command_stream_receiver_hw_base.inl @@ -1055,11 +1055,7 @@ TaskCountType CommandStreamReceiverHw::flushBcsTask(const BlitPropert EncodeMiFlushDW::programWithWa(commandStream, this->globalFenceAllocation->getGpuAddress(), 0, tlbFlushArgs); } - BlitCommandsHelper::dispatchBlitCommands(blitProperties, commandStream, waArgs); - auto dummyAllocation = rootDeviceEnvironment->getDummyAllocation(); - if (dummyAllocation) { - makeResident(*dummyAllocation); - } + BlitCommandsHelper::dispatchBlitCommands(blitProperties, commandStream, *waArgs.rootDeviceEnvironment); if (blitProperties.outputTimestampPacket) { if (profilingEnabled) { @@ -1094,8 +1090,13 @@ TaskCountType CommandStreamReceiverHw::flushBcsTask(const BlitPropert if (updateTag) { MemorySynchronizationCommands::addAdditionalSynchronization(commandStream, tagAllocation->getGpuAddress(), false, peekRootDeviceEnvironment()); args.commandWithPostSync = true; + args.waArgs.isWaRequired = true; args.notifyEnable = isUsedNotifyEnableForPostSync(); EncodeMiFlushDW::programWithWa(commandStream, tagAllocation->getGpuAddress(), newTaskCount, args); + auto dummyAllocation = rootDeviceEnvironment->getDummyAllocation(); + if (dummyAllocation) { + makeResident(*dummyAllocation); + } MemorySynchronizationCommands::addAdditionalSynchronization(commandStream, tagAllocation->getGpuAddress(), false, peekRootDeviceEnvironment()); } diff --git a/shared/source/gen12lp/command_stream_receiver_hw_gen12lp.cpp b/shared/source/gen12lp/command_stream_receiver_hw_gen12lp.cpp index 2747bb9fa9..41fc0cc7b9 100644 --- a/shared/source/gen12lp/command_stream_receiver_hw_gen12lp.cpp +++ b/shared/source/gen12lp/command_stream_receiver_hw_gen12lp.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2023 Intel Corporation + * Copyright (C) 2019-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -108,22 +108,22 @@ void BlitCommandsHelper::appendBlitCommandsForImages(const BlitPropertie } template <> -void BlitCommandsHelper::dispatchBlitMemoryColorFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, size_t patternSize, LinearStream &linearStream, size_t size, EncodeDummyBlitWaArgs &waArgs) { +void BlitCommandsHelper::dispatchBlitMemoryColorFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, size_t patternSize, LinearStream &linearStream, size_t size, RootDeviceEnvironment &rootDeviceEnvironment) { switch (patternSize) { case 1: - NEO::BlitCommandsHelper::dispatchBlitMemoryFill<1>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_8_BIT_COLOR); + NEO::BlitCommandsHelper::dispatchBlitMemoryFill<1>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_8_BIT_COLOR); break; case 2: - NEO::BlitCommandsHelper::dispatchBlitMemoryFill<2>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_16_BIT_COLOR); + NEO::BlitCommandsHelper::dispatchBlitMemoryFill<2>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_16_BIT_COLOR); break; case 4: - NEO::BlitCommandsHelper::dispatchBlitMemoryFill<4>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_32_BIT_COLOR); + NEO::BlitCommandsHelper::dispatchBlitMemoryFill<4>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_32_BIT_COLOR); break; case 8: - NEO::BlitCommandsHelper::dispatchBlitMemoryFill<8>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_64_BIT_COLOR); + NEO::BlitCommandsHelper::dispatchBlitMemoryFill<8>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_64_BIT_COLOR); break; default: - NEO::BlitCommandsHelper::dispatchBlitMemoryFill<16>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_128_BIT_COLOR); + NEO::BlitCommandsHelper::dispatchBlitMemoryFill<16>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_128_BIT_COLOR); } } diff --git a/shared/source/helpers/blit_commands_helper.h b/shared/source/helpers/blit_commands_helper.h index a49a436a08..4a65cdd424 100644 --- a/shared/source/helpers/blit_commands_helper.h +++ b/shared/source/helpers/blit_commands_helper.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2023 Intel Corporation + * Copyright (C) 2019-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -32,9 +32,9 @@ struct BlitCommandsHelper { static uint64_t getMaxBlitHeight(const RootDeviceEnvironment &rootDeviceEnvironment, bool isSystemMemoryPoolUsed); static uint64_t getMaxBlitHeightOverride(const RootDeviceEnvironment &rootDeviceEnvironment, bool isSystemMemoryPoolUsed); static void dispatchPreBlitCommand(LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment); - static size_t estimatePreBlitCommandSize(const RootDeviceEnvironment &rootDeviceEnvironment); - static void dispatchPostBlitCommand(LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs); - static size_t estimatePostBlitCommandSize(const RootDeviceEnvironment &rootDeviceEnvironment); + static size_t estimatePreBlitCommandSize(); + static void dispatchPostBlitCommand(LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment); + static size_t estimatePostBlitCommandSize(); static size_t estimateBlitCommandSize(const Vec3 ©Size, const CsrDependencies &csrDependencies, bool updateTimestampPacket, bool profilingEnabled, bool isImage, const RootDeviceEnvironment &rootDeviceEnvironment, bool isSystemMemoryPoolUsed, bool relaxedOrderingEnabled); static size_t estimateBlitCommandsSize(const BlitPropertiesContainer &blitPropertiesContainer, bool profilingEnabled, @@ -45,13 +45,13 @@ struct BlitCommandsHelper { static uint64_t calculateBlitCommandSourceBaseAddress(const BlitProperties &blitProperties, uint64_t offset, uint64_t row, uint64_t slice); static uint64_t calculateBlitCommandDestinationBaseAddressCopyRegion(const BlitProperties &blitProperties, size_t slice); static uint64_t calculateBlitCommandSourceBaseAddressCopyRegion(const BlitProperties &blitProperties, size_t slice); - static void dispatchBlitCommands(const BlitProperties &blitProperties, LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs); - static void dispatchBlitCommandsForBufferRegion(const BlitProperties &blitProperties, LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs); - static void dispatchBlitCommandsForBufferPerRow(const BlitProperties &blitProperties, LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs); - static void dispatchBlitCommandsForImageRegion(const BlitProperties &blitProperties, LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs); - static void dispatchBlitMemoryColorFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, size_t patternSize, LinearStream &linearStream, size_t size, EncodeDummyBlitWaArgs &waArgs); + static void dispatchBlitCommands(const BlitProperties &blitProperties, LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment); + static void dispatchBlitCommandsForBufferRegion(const BlitProperties &blitProperties, LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment); + static void dispatchBlitCommandsForBufferPerRow(const BlitProperties &blitProperties, LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment); + static void dispatchBlitCommandsForImageRegion(const BlitProperties &blitProperties, LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment); + static void dispatchBlitMemoryColorFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, size_t patternSize, LinearStream &linearStream, size_t size, RootDeviceEnvironment &rootDeviceEnvironment); template - static void dispatchBlitMemoryFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, LinearStream &linearStream, size_t size, EncodeDummyBlitWaArgs &waArgs, COLOR_DEPTH depth); + static void dispatchBlitMemoryFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, LinearStream &linearStream, size_t size, RootDeviceEnvironment &rootDeviceEnvironment, COLOR_DEPTH depth); static void dispatchDummyBlit(LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs); static size_t getDummyBlitSize(const EncodeDummyBlitWaArgs &waArgs); static bool isDummyBlitWaNeeded(const EncodeDummyBlitWaArgs &waArgs); diff --git a/shared/source/helpers/blit_commands_helper_base.inl b/shared/source/helpers/blit_commands_helper_base.inl index 9b8d6ce756..afe7f601a4 100644 --- a/shared/source/helpers/blit_commands_helper_base.inl +++ b/shared/source/helpers/blit_commands_helper_base.inl @@ -43,7 +43,7 @@ uint64_t BlitCommandsHelper::getMaxBlitHeight(const RootDeviceEnviron template void BlitCommandsHelper::dispatchPreBlitCommand(LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment) { if (BlitCommandsHelper::preBlitCommandWARequired()) { - NEO::EncodeDummyBlitWaArgs waArgs{false, const_cast(&rootDeviceEnvironment)}; + NEO::EncodeDummyBlitWaArgs waArgs{false, &rootDeviceEnvironment}; MiFlushArgs args{waArgs}; EncodeMiFlushDW::programWithWa(linearStream, 0, 0, args); @@ -51,17 +51,17 @@ void BlitCommandsHelper::dispatchPreBlitCommand(LinearStream &linearS } template -size_t BlitCommandsHelper::estimatePreBlitCommandSize(const RootDeviceEnvironment &rootDeviceEnvironment) { +size_t BlitCommandsHelper::estimatePreBlitCommandSize() { if (BlitCommandsHelper::preBlitCommandWARequired()) { - EncodeDummyBlitWaArgs waArgs{false, const_cast(&rootDeviceEnvironment)}; - return EncodeMiFlushDW::getCommandSizeWithWa(waArgs); + return EncodeMiFlushDW::getCommandSizeWithWa({}); } return 0u; } template -void BlitCommandsHelper::dispatchPostBlitCommand(LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs) { +void BlitCommandsHelper::dispatchPostBlitCommand(LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment) { + EncodeDummyBlitWaArgs waArgs{false, &rootDeviceEnvironment}; MiFlushArgs args{waArgs}; if (debugManager.flags.PostBlitCommand.get() != BlitterConstants::PostBlitMode::defaultMode) { switch (debugManager.flags.PostBlitCommand.get()) { @@ -78,15 +78,14 @@ void BlitCommandsHelper::dispatchPostBlitCommand(LinearStream &linear if (BlitCommandsHelper::miArbCheckWaRequired()) { EncodeMiFlushDW::programWithWa(linearStream, 0, 0, args); - args.waArgs.isWaRequired = false; } EncodeMiArbCheck::program(linearStream, std::nullopt); } template -size_t BlitCommandsHelper::estimatePostBlitCommandSize(const RootDeviceEnvironment &rootDeviceEnvironment) { - EncodeDummyBlitWaArgs waArgs{true, const_cast(&rootDeviceEnvironment)}; +size_t BlitCommandsHelper::estimatePostBlitCommandSize() { + EncodeDummyBlitWaArgs waArgs{}; if (debugManager.flags.PostBlitCommand.get() != BlitterConstants::PostBlitMode::defaultMode) { switch (debugManager.flags.PostBlitCommand.get()) { @@ -111,7 +110,7 @@ size_t BlitCommandsHelper::estimateBlitCommandSize(const Vec3 bool isImage, const RootDeviceEnvironment &rootDeviceEnvironment, bool isSystemMemoryPoolUsed, bool relaxedOrderingEnabled) { size_t timestampCmdSize = 0; if (updateTimestampPacket) { - EncodeDummyBlitWaArgs waArgs{false, const_cast(&rootDeviceEnvironment)}; + EncodeDummyBlitWaArgs waArgs{true, const_cast(&rootDeviceEnvironment)}; timestampCmdSize += EncodeMiFlushDW::getCommandSizeWithWa(waArgs); if (profilingEnabled) { timestampCmdSize += getProfilingMmioCmdsSize(); @@ -130,12 +129,12 @@ size_t BlitCommandsHelper::estimateBlitCommandSize(const Vec3 sizePerBlit = sizeof(typename GfxFamily::XY_COPY_BLT); } - sizePerBlit += estimatePostBlitCommandSize(rootDeviceEnvironment); + sizePerBlit += estimatePostBlitCommandSize(); return TimestampPacketHelper::getRequiredCmdStreamSize(csrDependencies, relaxedOrderingEnabled) + TimestampPacketHelper::getRequiredCmdStreamSizeForMultiRootDeviceSyncNodesContainer(csrDependencies) + (sizePerBlit * nBlits) + timestampCmdSize + - estimatePreBlitCommandSize(rootDeviceEnvironment); + estimatePreBlitCommandSize(); } template @@ -194,17 +193,17 @@ uint64_t BlitCommandsHelper::calculateBlitCommandSourceBaseAddress(co } template -void BlitCommandsHelper::dispatchBlitCommandsForBufferPerRow(const BlitProperties &blitProperties, LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs) { +void BlitCommandsHelper::dispatchBlitCommandsForBufferPerRow(const BlitProperties &blitProperties, LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment) { uint64_t width = 1; uint64_t height = 1; PRINT_DEBUG_STRING(debugManager.flags.PrintBlitDispatchDetails.get(), stdout, "\nBlit dispatch with AuxTranslationDirection %u ", static_cast(blitProperties.auxTranslationDirection)); - dispatchPreBlitCommand(linearStream, *waArgs.rootDeviceEnvironment); + dispatchPreBlitCommand(linearStream, rootDeviceEnvironment); auto bltCmd = GfxFamily::cmdInitXyCopyBlt; - const auto maxWidth = getMaxBlitWidth(*waArgs.rootDeviceEnvironment); - const auto maxHeight = getMaxBlitHeight(*waArgs.rootDeviceEnvironment, blitProperties.isSystemMemoryPoolUsed); + const auto maxWidth = getMaxBlitWidth(rootDeviceEnvironment); + const auto maxHeight = getMaxBlitHeight(rootDeviceEnvironment, blitProperties.isSystemMemoryPoolUsed); appendColorDepth(blitProperties, bltCmd); @@ -237,13 +236,12 @@ void BlitCommandsHelper::dispatchBlitCommandsForBufferPerRow(const Bl bltCmd.setDestinationBaseAddress(dstAddr); bltCmd.setSourceBaseAddress(srcAddr); - appendBlitCommandsForBuffer(blitProperties, bltCmd, *waArgs.rootDeviceEnvironment); + appendBlitCommandsForBuffer(blitProperties, bltCmd, rootDeviceEnvironment); auto bltStream = linearStream.getSpaceForCmd(); *bltStream = bltCmd; - waArgs.isWaRequired = true; - dispatchPostBlitCommand(linearStream, waArgs); + dispatchPostBlitCommand(linearStream, rootDeviceEnvironment); auto blitSize = width * height; sizeToBlit -= blitSize; @@ -255,10 +253,9 @@ void BlitCommandsHelper::dispatchBlitCommandsForBufferPerRow(const Bl template template -void BlitCommandsHelper::dispatchBlitMemoryFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, LinearStream &linearStream, size_t size, EncodeDummyBlitWaArgs &waArgs, COLOR_DEPTH depth) { +void BlitCommandsHelper::dispatchBlitMemoryFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, LinearStream &linearStream, size_t size, RootDeviceEnvironment &rootDeviceEnvironment, COLOR_DEPTH depth) { using XY_COLOR_BLT = typename GfxFamily::XY_COLOR_BLT; auto blitCmd = GfxFamily::cmdInitXyColorBlt; - auto &rootDeviceEnvironment = *waArgs.rootDeviceEnvironment; const auto maxWidth = getMaxBlitWidth(rootDeviceEnvironment); const auto maxHeight = getMaxBlitHeight(rootDeviceEnvironment, true); @@ -289,7 +286,6 @@ void BlitCommandsHelper::dispatchBlitMemoryFill(NEO::GraphicsAllocati auto cmd = linearStream.getSpaceForCmd(); *cmd = tmpCmd; - waArgs.isWaRequired = true; auto blitSize = width * height; offset += (blitSize * patternSize); sizeToFill -= blitSize; @@ -297,7 +293,7 @@ void BlitCommandsHelper::dispatchBlitMemoryFill(NEO::GraphicsAllocati } template -void BlitCommandsHelper::dispatchBlitCommandsForImageRegion(const BlitProperties &blitProperties, LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs) { +void BlitCommandsHelper::dispatchBlitCommandsForImageRegion(const BlitProperties &blitProperties, LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment) { auto srcSlicePitch = static_cast(blitProperties.srcSlicePitch); auto dstSlicePitch = static_cast(blitProperties.dstSlicePitch); @@ -316,14 +312,14 @@ void BlitCommandsHelper::dispatchBlitCommandsForImageRegion(const Bli bltCmd.setSourceX1CoordinateLeft(static_cast(blitProperties.srcOffset.x)); bltCmd.setSourceY1CoordinateTop(static_cast(blitProperties.srcOffset.y)); - appendBlitCommandsBlockCopy(blitProperties, bltCmd, *(waArgs.rootDeviceEnvironment)); - appendBlitCommandsForImages(blitProperties, bltCmd, *(waArgs.rootDeviceEnvironment), srcSlicePitch, dstSlicePitch); + appendBlitCommandsBlockCopy(blitProperties, bltCmd, rootDeviceEnvironment); + appendBlitCommandsForImages(blitProperties, bltCmd, rootDeviceEnvironment, srcSlicePitch, dstSlicePitch); appendColorDepth(blitProperties, bltCmd); appendSurfaceType(blitProperties, bltCmd); - dispatchPreBlitCommand(linearStream, *(waArgs.rootDeviceEnvironment)); + dispatchPreBlitCommand(linearStream, rootDeviceEnvironment); for (uint32_t i = 0; i < blitProperties.copySize.z; i++) { - appendSliceOffsets(blitProperties, bltCmd, i, *(waArgs.rootDeviceEnvironment), srcSlicePitch, dstSlicePitch); + appendSliceOffsets(blitProperties, bltCmd, i, rootDeviceEnvironment, srcSlicePitch, dstSlicePitch); if (debugManager.flags.PrintImageBlitBlockCopyCmdDetails.get()) { printImageBlitBlockCopyCommand(bltCmd, i); @@ -331,8 +327,7 @@ void BlitCommandsHelper::dispatchBlitCommandsForImageRegion(const Bli auto cmd = linearStream.getSpaceForCmd(); *cmd = bltCmd; - waArgs.isWaRequired = true; - dispatchPostBlitCommand(linearStream, waArgs); + dispatchPostBlitCommand(linearStream, rootDeviceEnvironment); } } @@ -373,13 +368,13 @@ uint32_t BlitCommandsHelper::getAvailableBytesPerPixel(size_t copySiz } template -void BlitCommandsHelper::dispatchBlitCommands(const BlitProperties &blitProperties, LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs) { +void BlitCommandsHelper::dispatchBlitCommands(const BlitProperties &blitProperties, LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment) { if (blitProperties.isImageOperation()) { - dispatchBlitCommandsForImageRegion(blitProperties, linearStream, waArgs); + dispatchBlitCommandsForImageRegion(blitProperties, linearStream, rootDeviceEnvironment); } else { - bool preferCopyBufferRegion = isCopyRegionPreferred(blitProperties.copySize, *waArgs.rootDeviceEnvironment, blitProperties.isSystemMemoryPoolUsed); - preferCopyBufferRegion ? dispatchBlitCommandsForBufferRegion(blitProperties, linearStream, waArgs) - : dispatchBlitCommandsForBufferPerRow(blitProperties, linearStream, waArgs); + bool preferCopyBufferRegion = isCopyRegionPreferred(blitProperties.copySize, rootDeviceEnvironment, blitProperties.isSystemMemoryPoolUsed); + preferCopyBufferRegion ? dispatchBlitCommandsForBufferRegion(blitProperties, linearStream, rootDeviceEnvironment) + : dispatchBlitCommandsForBufferPerRow(blitProperties, linearStream, rootDeviceEnvironment); } } @@ -409,12 +404,12 @@ void BlitCommandsHelper::appendBlitCommandsMemCopy(const BlitProperti } template -void BlitCommandsHelper::dispatchBlitCommandsForBufferRegion(const BlitProperties &blitProperties, LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs) { +void BlitCommandsHelper::dispatchBlitCommandsForBufferRegion(const BlitProperties &blitProperties, LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment) { - const auto maxWidthToCopy = getMaxBlitWidth(*waArgs.rootDeviceEnvironment); - const auto maxHeightToCopy = getMaxBlitHeight(*waArgs.rootDeviceEnvironment, blitProperties.isSystemMemoryPoolUsed); + const auto maxWidthToCopy = getMaxBlitWidth(rootDeviceEnvironment); + const auto maxHeightToCopy = getMaxBlitHeight(rootDeviceEnvironment, blitProperties.isSystemMemoryPoolUsed); - dispatchPreBlitCommand(linearStream, *waArgs.rootDeviceEnvironment); + dispatchPreBlitCommand(linearStream, rootDeviceEnvironment); auto bltCmd = GfxFamily::cmdInitXyCopyBlt; bltCmd.setSourcePitch(static_cast(blitProperties.srcRowPitch)); @@ -438,13 +433,12 @@ void BlitCommandsHelper::dispatchBlitCommandsForBufferRegion(const Bl bltCmd.setDestinationX2CoordinateRight(width); bltCmd.setDestinationY2CoordinateBottom(height); - appendBlitCommandsForBuffer(blitProperties, bltCmd, *waArgs.rootDeviceEnvironment); + appendBlitCommandsForBuffer(blitProperties, bltCmd, rootDeviceEnvironment); auto cmd = linearStream.getSpaceForCmd(); *cmd = bltCmd; - waArgs.isWaRequired = true; - dispatchPostBlitCommand(linearStream, waArgs); + dispatchPostBlitCommand(linearStream, rootDeviceEnvironment); srcAddress += width; dstAddress += width; diff --git a/shared/source/helpers/blit_commands_helper_bdw_and_later.inl b/shared/source/helpers/blit_commands_helper_bdw_and_later.inl index 10603fa344..60bddaba0f 100644 --- a/shared/source/helpers/blit_commands_helper_bdw_and_later.inl +++ b/shared/source/helpers/blit_commands_helper_bdw_and_later.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 Intel Corporation + * Copyright (C) 2020-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -39,16 +39,16 @@ void BlitCommandsHelper::appendBlitCommandsForFillBuffer(NEO::Graphic } template -void BlitCommandsHelper::dispatchBlitMemoryColorFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, size_t patternSize, LinearStream &linearStream, size_t size, EncodeDummyBlitWaArgs &waArgs) { +void BlitCommandsHelper::dispatchBlitMemoryColorFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, size_t patternSize, LinearStream &linearStream, size_t size, RootDeviceEnvironment &rootDeviceEnvironment) { switch (patternSize) { case 1: - NEO::BlitCommandsHelper::dispatchBlitMemoryFill<1>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_8_BIT_COLOR); + NEO::BlitCommandsHelper::dispatchBlitMemoryFill<1>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_8_BIT_COLOR); break; case 2: - NEO::BlitCommandsHelper::dispatchBlitMemoryFill<2>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_16_BIT_COLOR1555); + NEO::BlitCommandsHelper::dispatchBlitMemoryFill<2>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_16_BIT_COLOR1555); break; default: - NEO::BlitCommandsHelper::dispatchBlitMemoryFill<4>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_32_BIT_COLOR); + NEO::BlitCommandsHelper::dispatchBlitMemoryFill<4>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_32_BIT_COLOR); } } diff --git a/shared/source/helpers/blit_commands_helper_xehp_and_later.inl b/shared/source/helpers/blit_commands_helper_xehp_and_later.inl index d3f58c707e..169141e043 100644 --- a/shared/source/helpers/blit_commands_helper_xehp_and_later.inl +++ b/shared/source/helpers/blit_commands_helper_xehp_and_later.inl @@ -76,22 +76,22 @@ void BlitCommandsHelper::appendBlitCommandsForFillBuffer(NEO::Graphic } template -void BlitCommandsHelper::dispatchBlitMemoryColorFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, size_t patternSize, LinearStream &linearStream, size_t size, EncodeDummyBlitWaArgs &waArgs) { +void BlitCommandsHelper::dispatchBlitMemoryColorFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, size_t patternSize, LinearStream &linearStream, size_t size, RootDeviceEnvironment &rootDeviceEnvironment) { switch (patternSize) { case 1: - NEO::BlitCommandsHelper::dispatchBlitMemoryFill<1>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_8_BIT_COLOR); + NEO::BlitCommandsHelper::dispatchBlitMemoryFill<1>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_8_BIT_COLOR); break; case 2: - NEO::BlitCommandsHelper::dispatchBlitMemoryFill<2>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_16_BIT_COLOR); + NEO::BlitCommandsHelper::dispatchBlitMemoryFill<2>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_16_BIT_COLOR); break; case 4: - NEO::BlitCommandsHelper::dispatchBlitMemoryFill<4>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_32_BIT_COLOR); + NEO::BlitCommandsHelper::dispatchBlitMemoryFill<4>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_32_BIT_COLOR); break; case 8: - NEO::BlitCommandsHelper::dispatchBlitMemoryFill<8>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_64_BIT_COLOR); + NEO::BlitCommandsHelper::dispatchBlitMemoryFill<8>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_64_BIT_COLOR); break; default: - NEO::BlitCommandsHelper::dispatchBlitMemoryFill<16>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_128_BIT_COLOR); + NEO::BlitCommandsHelper::dispatchBlitMemoryFill<16>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_128_BIT_COLOR); } } @@ -390,7 +390,6 @@ void BlitCommandsHelper::dispatchDummyBlit(LinearStream &linearStream auto cmd = linearStream.getSpaceForCmd(); *cmd = blitCmd; - waArgs.isWaRequired = false; } } diff --git a/shared/source/xe_hpc_core/command_stream_receiver_hw_xe_hpc_core.cpp b/shared/source/xe_hpc_core/command_stream_receiver_hw_xe_hpc_core.cpp index fcd7d5aa63..dd367e0443 100644 --- a/shared/source/xe_hpc_core/command_stream_receiver_hw_xe_hpc_core.cpp +++ b/shared/source/xe_hpc_core/command_stream_receiver_hw_xe_hpc_core.cpp @@ -136,10 +136,9 @@ void BlitCommandsHelper::appendBlitCommandsMemCopy(const BlitProperties template <> template <> -void BlitCommandsHelper::dispatchBlitMemoryFill<1>(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, LinearStream &linearStream, size_t size, EncodeDummyBlitWaArgs &waArgs, COLOR_DEPTH depth) { +void BlitCommandsHelper::dispatchBlitMemoryFill<1>(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, LinearStream &linearStream, size_t size, RootDeviceEnvironment &rootDeviceEnvironment, COLOR_DEPTH depth) { using MEM_SET = typename Family::MEM_SET; auto blitCmd = Family::cmdInitMemSet; - auto &rootDeviceEnvironment = *waArgs.rootDeviceEnvironment; auto mocs = rootDeviceEnvironment.getGmmHelper()->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER); if (debugManager.flags.OverrideBlitterMocs.get() != -1) { @@ -294,7 +293,6 @@ void BlitCommandsHelper::dispatchDummyBlit(LinearStream &linearStream, E auto cmd = linearStream.getSpaceForCmd(); *cmd = blitCmd; - waArgs.isWaRequired = false; } } diff --git a/shared/test/unit_test/helpers/blit_commands_helper_tests.cpp b/shared/test/unit_test/helpers/blit_commands_helper_tests.cpp index 797ac8d9d3..bb34e03da0 100644 --- a/shared/test/unit_test/helpers/blit_commands_helper_tests.cpp +++ b/shared/test/unit_test/helpers/blit_commands_helper_tests.cpp @@ -154,7 +154,7 @@ HWTEST_F(BlitTests, givenDebugVariablesWhenGettingMaxBlitSizeThenHonorUseProvide } HWTEST_F(BlitTests, givenDebugVariableWhenEstimatingPostBlitsCommandSizeThenReturnCorrectResult) { - EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())}; + EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())}; DebugManagerStateRestore restore{}; size_t arbCheckSize = EncodeMiArbCheck::getCommandSize(); @@ -164,17 +164,16 @@ HWTEST_F(BlitTests, givenDebugVariableWhenEstimatingPostBlitsCommandSizeThenRetu expectedDefaultSize += EncodeMiFlushDW::getCommandSizeWithWa(waArgs); } - EXPECT_EQ(expectedDefaultSize, BlitCommandsHelper::estimatePostBlitCommandSize(pDevice->getRootDeviceEnvironment())); + EXPECT_EQ(expectedDefaultSize, BlitCommandsHelper::estimatePostBlitCommandSize()); debugManager.flags.PostBlitCommand.set(BlitterConstants::PostBlitMode::miArbCheck); - EXPECT_EQ(arbCheckSize, BlitCommandsHelper::estimatePostBlitCommandSize(pDevice->getRootDeviceEnvironment())); + EXPECT_EQ(arbCheckSize, BlitCommandsHelper::estimatePostBlitCommandSize()); debugManager.flags.PostBlitCommand.set(BlitterConstants::PostBlitMode::miFlush); - waArgs.isWaRequired = true; - EXPECT_EQ(EncodeMiFlushDW::getCommandSizeWithWa(waArgs), BlitCommandsHelper::estimatePostBlitCommandSize(pDevice->getRootDeviceEnvironment())); + EXPECT_EQ(EncodeMiFlushDW::getCommandSizeWithWa(waArgs), BlitCommandsHelper::estimatePostBlitCommandSize()); debugManager.flags.PostBlitCommand.set(BlitterConstants::PostBlitMode::none); - EXPECT_EQ(0u, BlitCommandsHelper::estimatePostBlitCommandSize(pDevice->getRootDeviceEnvironment())); + EXPECT_EQ(0u, BlitCommandsHelper::estimatePostBlitCommandSize()); } HWTEST_F(BlitTests, givenDebugVariableWhenDispatchingPostBlitsCommandThenUseCorrectCommands) { @@ -184,7 +183,8 @@ HWTEST_F(BlitTests, givenDebugVariableWhenDispatchingPostBlitsCommandThenUseCorr uint32_t streamBuffer[100] = {}; LinearStream linearStream{streamBuffer, sizeof(streamBuffer)}; GenCmdList commands{}; - EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())}; + auto &rootDeviceEnvironment = pDevice->getRootDeviceEnvironmentRef(); + EncodeDummyBlitWaArgs waArgs{false, &rootDeviceEnvironment}; size_t expectedDefaultSize = EncodeMiArbCheck::getCommandSize() + BlitCommandsHelper::getDummyBlitSize(waArgs); if (BlitCommandsHelper::miArbCheckWaRequired()) { @@ -192,7 +192,7 @@ HWTEST_F(BlitTests, givenDebugVariableWhenDispatchingPostBlitsCommandThenUseCorr } // -1: default - BlitCommandsHelper::dispatchPostBlitCommand(linearStream, waArgs); + BlitCommandsHelper::dispatchPostBlitCommand(linearStream, rootDeviceEnvironment); EXPECT_EQ(expectedDefaultSize, linearStream.getUsed()); CmdParse::parseCommandBuffer(commands, linearStream.getCpuBase(), linearStream.getUsed()); @@ -216,7 +216,7 @@ HWTEST_F(BlitTests, givenDebugVariableWhenDispatchingPostBlitsCommandThenUseCorr commands.clear(); debugManager.flags.PostBlitCommand.set(BlitterConstants::PostBlitMode::miArbCheck); waArgs.isWaRequired = true; - BlitCommandsHelper::dispatchPostBlitCommand(linearStream, waArgs); + BlitCommandsHelper::dispatchPostBlitCommand(linearStream, rootDeviceEnvironment); CmdParse::parseCommandBuffer(commands, linearStream.getCpuBase(), linearStream.getUsed()); arbCheck = find(commands.begin(), commands.end()); @@ -228,7 +228,7 @@ HWTEST_F(BlitTests, givenDebugVariableWhenDispatchingPostBlitsCommandThenUseCorr commands.clear(); debugManager.flags.PostBlitCommand.set(BlitterConstants::PostBlitMode::miFlush); waArgs.isWaRequired = true; - BlitCommandsHelper::dispatchPostBlitCommand(linearStream, waArgs); + BlitCommandsHelper::dispatchPostBlitCommand(linearStream, rootDeviceEnvironment); CmdParse::parseCommandBuffer(commands, linearStream.getCpuBase(), linearStream.getUsed()); auto miFlush = find(commands.begin(), commands.end()); @@ -240,7 +240,7 @@ HWTEST_F(BlitTests, givenDebugVariableWhenDispatchingPostBlitsCommandThenUseCorr commands.clear(); debugManager.flags.PostBlitCommand.set(BlitterConstants::PostBlitMode::none); waArgs.isWaRequired = true; - BlitCommandsHelper::dispatchPostBlitCommand(linearStream, waArgs); + BlitCommandsHelper::dispatchPostBlitCommand(linearStream, rootDeviceEnvironment); EXPECT_EQ(0u, linearStream.getUsed()); } @@ -254,8 +254,7 @@ HWTEST_F(BlitTests, givenMemoryWhenFillPatternWithBlitThenCommandIsProgrammed) { MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::system4KBPages, MemoryManager::maxOsContextCount); - EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()}; - BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), waArgs); + BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), pDevice->getRootDeviceEnvironmentRef()); GenCmdList cmdList; ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); @@ -273,8 +272,7 @@ HWTEST_F(BlitTests, givenMemorySizeBiggerThanMaxWidthButLessThanTwiceMaxWidthWhe reinterpret_cast(0x1234), 0x1000, 0, (2 * BlitterConstants::maxBlitWidth) - 1, MemoryPool::system4KBPages, MemoryManager::maxOsContextCount); - EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()}; - BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), waArgs); + BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), pDevice->getRootDeviceEnvironmentRef()); GenCmdList cmdList; ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); @@ -295,8 +293,7 @@ HWTEST_F(BlitTests, givenMemoryPointerOffsetVerifyCorrectDestinationBaseAddress) MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::system4KBPages, MemoryManager::maxOsContextCount); - EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()}; - BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0x234, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), waArgs); + BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0x234, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), pDevice->getRootDeviceEnvironmentRef()); GenCmdList cmdList; ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); @@ -323,8 +320,7 @@ HWTEST_F(BlitTests, givenMemorySizeTwiceBiggerThanMaxWidthWhenFillPatternWithBli MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, (2 * BlitterConstants::maxBlitWidth * sizeof(uint32_t)), MemoryPool::system4KBPages, MemoryManager::maxOsContextCount); - EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()}; - BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), waArgs); + BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), pDevice->getRootDeviceEnvironmentRef()); GenCmdList cmdList; ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); @@ -352,8 +348,7 @@ HWTEST_F(BlitTests, givenMemorySizeIsLessThanTwicenMaxWidthWhenFillPatternWithBl MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, ((BlitterConstants::maxBlitWidth + 1) * sizeof(uint32_t)), MemoryPool::system4KBPages, MemoryManager::maxOsContextCount); - EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()}; - BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), waArgs); + BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), pDevice->getRootDeviceEnvironmentRef()); GenCmdList cmdList; ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); @@ -395,8 +390,7 @@ HWTEST2_F(BlitTests, givenMemoryWhenFillPatternSizeIs4BytesThen32BitMaskISSetCor MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::system4KBPages, MemoryManager::maxOsContextCount); - EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()}; - BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), waArgs); + BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), pDevice->getRootDeviceEnvironmentRef()); GenCmdList cmdList; ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); @@ -514,8 +508,7 @@ HWTEST2_F(BlitTests, givenMemoryAndImageWhenDispatchCopyImageCallThenCommandAdde blitProperties.bytesPerPixel = 4; blitProperties.srcSize = srcSize; blitProperties.dstSize = dstSize; - EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())}; - NEO::BlitCommandsHelper::dispatchBlitCommandsForImageRegion(blitProperties, stream, waArgs); + NEO::BlitCommandsHelper::dispatchBlitCommandsForImageRegion(blitProperties, stream, pDevice->getRootDeviceEnvironmentRef()); GenCmdList cmdList; ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); @@ -668,13 +661,13 @@ HWTEST2_F(BlitTests, givenPlatformWhenCallingPreBlitCommandWARequiredThenReturns HWTEST2_F(BlitTests, givenPlatformWhenCallingEstimatePreBlitCommandSizeThenZeroIsReturned, WithoutGen12Lp) { using MI_FLUSH_DW = typename FamilyType::MI_FLUSH_DW; - EXPECT_EQ(0u, BlitCommandsHelper::estimatePreBlitCommandSize(pDevice->getRootDeviceEnvironmentRef())); + EXPECT_EQ(0u, BlitCommandsHelper::estimatePreBlitCommandSize()); } HWTEST2_F(BlitTests, givenPlatformWhenCallingDispatchPreBlitCommandThenNoneMiFlushDwIsProgramed, WithoutGen12Lp) { using MI_FLUSH_DW = typename FamilyType::MI_FLUSH_DW; auto miFlushBuffer = std::make_unique(); - EncodeDummyBlitWaArgs waArgs{true, const_cast(&pDevice->getRootDeviceEnvironment())}; + EncodeDummyBlitWaArgs waArgs{true, &pDevice->getRootDeviceEnvironmentRef()}; LinearStream linearStream(miFlushBuffer.get(), EncodeMiFlushDW::getCommandSizeWithWa(waArgs)); BlitCommandsHelper::dispatchPreBlitCommand(linearStream, *waArgs.rootDeviceEnvironment); diff --git a/shared/test/unit_test/helpers/blit_commands_helper_tests.inl b/shared/test/unit_test/helpers/blit_commands_helper_tests.inl index 63fd25a697..ed531a0104 100644 --- a/shared/test/unit_test/helpers/blit_commands_helper_tests.inl +++ b/shared/test/unit_test/helpers/blit_commands_helper_tests.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2023 Intel Corporation + * Copyright (C) 2021-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -52,8 +52,7 @@ class GivenLinearStreamWhenCallDispatchBlitMemoryColorFillThenCorrectDepthIsProg canonizedGpuAddress); uint32_t patternToCommand[4]; memset(patternToCommand, 4, patternSize); - EncodeDummyBlitWaArgs waArgs{false, &(device->getRootDeviceEnvironmentRef())}; - BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, patternToCommand, patternSize, stream, mockAllocation.getUnderlyingBufferSize(), waArgs); + BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, patternToCommand, patternSize, stream, mockAllocation.getUnderlyingBufferSize(), device->getRootDeviceEnvironmentRef()); GenCmdList cmdList; ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); diff --git a/shared/test/unit_test/helpers/blit_commands_helper_tests_gen12lp.cpp b/shared/test/unit_test/helpers/blit_commands_helper_tests_gen12lp.cpp index 23dfbc7037..127554acf5 100644 --- a/shared/test/unit_test/helpers/blit_commands_helper_tests_gen12lp.cpp +++ b/shared/test/unit_test/helpers/blit_commands_helper_tests_gen12lp.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 Intel Corporation + * Copyright (C) 2020-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -251,8 +251,8 @@ HWTEST2_F(BlitTests, givenGen12LpPlatformWhenPreBlitCommandWARequiredThenReturns HWTEST2_F(BlitTests, givenGen12LpPlatformWhenEstimatePreBlitCommandSizeThenSizeOfFlushIsReturned, IsGen12LP) { using MI_FLUSH_DW = typename FamilyType::MI_FLUSH_DW; - EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())}; - EXPECT_EQ(EncodeMiFlushDW::getCommandSizeWithWa(waArgs), BlitCommandsHelper::estimatePreBlitCommandSize(pDevice->getRootDeviceEnvironmentRef())); + EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())}; + EXPECT_EQ(EncodeMiFlushDW::getCommandSizeWithWa(waArgs), BlitCommandsHelper::estimatePreBlitCommandSize()); } HWTEST2_F(BlitTests, givenGen12LpPlatformWhenDispatchPreBlitCommandThenMiFlushDwIsProgramed, IsGen12LP) { @@ -261,7 +261,7 @@ HWTEST2_F(BlitTests, givenGen12LpPlatformWhenDispatchPreBlitCommandThenMiFlushDw EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())}; LinearStream linearStream(miFlushBuffer.get(), EncodeMiFlushDW::getCommandSizeWithWa(waArgs)); - BlitCommandsHelper::dispatchPreBlitCommand(linearStream, *(&pDevice->getRootDeviceEnvironmentRef())); + BlitCommandsHelper::dispatchPreBlitCommand(linearStream, *waArgs.rootDeviceEnvironment); HardwareParse hwParser; hwParser.parseCommands(linearStream); diff --git a/shared/test/unit_test/helpers/test_blit_commands_helper_pvc_and_later.cpp b/shared/test/unit_test/helpers/test_blit_commands_helper_pvc_and_later.cpp index 003e714875..e7ad032bef 100644 --- a/shared/test/unit_test/helpers/test_blit_commands_helper_pvc_and_later.cpp +++ b/shared/test/unit_test/helpers/test_blit_commands_helper_pvc_and_later.cpp @@ -25,8 +25,7 @@ HWTEST2_F(BlitTests, givenOneBytePatternWhenFillPatternWithBlitThenCommandIsProg MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::system4KBPages, MemoryManager::maxOsContextCount); - EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()}; - BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), waArgs); + BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), pDevice->getRootDeviceEnvironmentRef()); GenCmdList cmdList; ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); @@ -42,8 +41,7 @@ HWTEST2_F(BlitTests, givenDeviceWithoutDefaultGmmWhenAppendBlitCommandsForVillBu MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::system4KBPages, MemoryManager::maxOsContextCount); - EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()}; - BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), waArgs); + BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), pDevice->getRootDeviceEnvironmentRef()); GenCmdList cmdList; ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); @@ -67,8 +65,7 @@ HWTEST2_F(BlitTests, givenGmmWithDisabledCompresionWhenAppendBlitCommandsForVill reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::system4KBPages, MemoryManager::maxOsContextCount); mockAllocation.setGmm(gmm.get(), 0u); - EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()}; - BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), waArgs); + BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), pDevice->getRootDeviceEnvironmentRef()); GenCmdList cmdList; ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); @@ -92,9 +89,8 @@ HWTEST2_F(BlitTests, givenGmmWithEnabledCompresionWhenAppendBlitCommandsForVillB reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::system4KBPages, MemoryManager::maxOsContextCount); mockAllocation.setGmm(gmm.get(), 0u); - const auto &rootDeviceEnvironment = pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]; - EncodeDummyBlitWaArgs waArgs{false, const_cast(rootDeviceEnvironment.get())}; - BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), waArgs); + auto &rootDeviceEnvironment = pDevice->getRootDeviceEnvironmentRef(); + BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), rootDeviceEnvironment); GenCmdList cmdList; ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); @@ -105,7 +101,7 @@ HWTEST2_F(BlitTests, givenGmmWithEnabledCompresionWhenAppendBlitCommandsForVillB EXPECT_EQ(blitCmd->getDestinationCompressible(), MEM_SET::DESTINATION_COMPRESSIBLE::DESTINATION_COMPRESSIBLE_COMPRESSIBLE); auto resourceFormat = gmm->gmmResourceInfo->getResourceFormat(); - auto compressionFormat = rootDeviceEnvironment->getGmmClientContext()->getSurfaceStateCompressionFormat(resourceFormat); + auto compressionFormat = rootDeviceEnvironment.getGmmClientContext()->getSurfaceStateCompressionFormat(resourceFormat); EXPECT_EQ(compressionFormat, blitCmd->getCompressionFormat40()); } } @@ -122,8 +118,7 @@ HWTEST2_F(BlitTests, givenOverridedMocksValueWhenAppendBlitCommandsForVillBuffer MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::system4KBPages, MemoryManager::maxOsContextCount); - EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()}; - BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), waArgs); + BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), pDevice->getRootDeviceEnvironmentRef()); GenCmdList cmdList; ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); @@ -146,8 +141,7 @@ HWTEST2_F(BlitTests, givenEnableStatelessCompressionWithUnifiedMemoryAndSystemMe MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::system4KBPages, MemoryManager::maxOsContextCount); - EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()}; - BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), waArgs); + BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), pDevice->getRootDeviceEnvironmentRef()); GenCmdList cmdList; ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); @@ -178,8 +172,7 @@ HWTEST2_F(BlitTests, givenEnableStatelessCompressionWithUnifiedMemoryAndLocalMem MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::localMemory, MemoryManager::maxOsContextCount); - EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()}; - BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), waArgs); + BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), pDevice->getRootDeviceEnvironmentRef()); GenCmdList cmdList; ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); @@ -200,8 +193,7 @@ HWTEST2_F(BlitTests, givenMemorySizeBiggerThanMaxWidthButLessThanTwiceMaxWidthWh MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, (2 * BlitterConstants::maxBlitSetWidth) - 1, MemoryPool::system4KBPages, MemoryManager::maxOsContextCount); - EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()}; - BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), waArgs); + BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), pDevice->getRootDeviceEnvironmentRef()); GenCmdList cmdList; ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); @@ -221,8 +213,7 @@ HWTEST2_F(BlitTests, givenMemorySizeTwiceBiggerThanMaxWidthWhenFillPatternWithBl MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, reinterpret_cast(0x1234), 0x1000, 0, (2 * BlitterConstants::maxBlitSetWidth), MemoryPool::system4KBPages, MemoryManager::maxOsContextCount); - EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()}; - BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), waArgs); + BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), pDevice->getRootDeviceEnvironmentRef()); GenCmdList cmdList; ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); @@ -307,8 +298,7 @@ HWTEST2_F(BlitTests, givenMemoryAndImageWhenDispatchCopyImageCallThenCommandAdde blitProperties.bytesPerPixel = 4; blitProperties.srcSize = srcSize; blitProperties.dstSize = dstSize; - EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())}; - NEO::BlitCommandsHelper::dispatchBlitCommandsForImageRegion(blitProperties, stream, waArgs); + NEO::BlitCommandsHelper::dispatchBlitCommandsForImageRegion(blitProperties, stream, pDevice->getRootDeviceEnvironmentRef()); GenCmdList cmdList; ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); diff --git a/shared/test/unit_test/helpers/test_blit_commands_helper_xehp_and_later.cpp b/shared/test/unit_test/helpers/test_blit_commands_helper_xehp_and_later.cpp index fb669ec0ff..4facfd66a9 100644 --- a/shared/test/unit_test/helpers/test_blit_commands_helper_xehp_and_later.cpp +++ b/shared/test/unit_test/helpers/test_blit_commands_helper_xehp_and_later.cpp @@ -458,8 +458,7 @@ HWTEST2_F(BlitTests, givenDebugVariableWhenDispatchBlitCommandsForImageRegionIsC blitProperties.dstSize = {1, 1, 1}; testing::internal::CaptureStdout(); - EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())}; - BlitCommandsHelper::dispatchBlitCommandsForImageRegion(blitProperties, stream, waArgs); + BlitCommandsHelper::dispatchBlitCommandsForImageRegion(blitProperties, stream, pDevice->getRootDeviceEnvironmentRef()); std::string output = testing::internal::GetCapturedStdout(); std::stringstream expectedOutput;