Revert "fix: don't program dummy blit prior to MI_FLUSH_DW without postsync"

This reverts commit d796fb559d.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
Compute-Runtime-Validation
2024-03-01 01:11:44 +01:00
committed by Compute-Runtime-Automation
parent 406fb76328
commit 5fce046877
18 changed files with 198 additions and 150 deletions

View File

@@ -1221,7 +1221,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryCopyBlit(uintptr_t
NEO::BlitPropertiesContainer blitPropertiesContainer{blitProperties}; NEO::BlitPropertiesContainer blitPropertiesContainer{blitProperties};
NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForBufferPerRow(blitProperties, *commandContainer.getCommandStream(), *this->dummyBlitWa.rootDeviceEnvironment); NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForBufferPerRow(blitProperties, *commandContainer.getCommandStream(), this->dummyBlitWa);
makeResidentDummyAllocation(); makeResidentDummyAllocation();
return ZE_RESULT_SUCCESS; return ZE_RESULT_SUCCESS;
} }
@@ -1265,12 +1265,12 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryCopyBlitRegion(Ali
} }
appendEventForProfiling(signalEvent, true, false); appendEventForProfiling(signalEvent, true, false);
auto &rootDeviceEnvironment = device->getNEODevice()->getRootDeviceEnvironmentRef(); auto &rootDeviceEnvironment = device->getNEODevice()->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()];
bool copyRegionPreferred = NEO::BlitCommandsHelper<GfxFamily>::isCopyRegionPreferred(copySizeModified, rootDeviceEnvironment, blitProperties.isSystemMemoryPoolUsed); bool copyRegionPreferred = NEO::BlitCommandsHelper<GfxFamily>::isCopyRegionPreferred(copySizeModified, *rootDeviceEnvironment, blitProperties.isSystemMemoryPoolUsed);
if (copyRegionPreferred) { if (copyRegionPreferred) {
NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForBufferRegion(blitProperties, *commandContainer.getCommandStream(), rootDeviceEnvironment); NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForBufferRegion(blitProperties, *commandContainer.getCommandStream(), this->dummyBlitWa);
} else { } else {
NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForBufferPerRow(blitProperties, *commandContainer.getCommandStream(), rootDeviceEnvironment); NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForBufferPerRow(blitProperties, *commandContainer.getCommandStream(), this->dummyBlitWa);
} }
makeResidentDummyAllocation(); makeResidentDummyAllocation();
@@ -1300,7 +1300,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendCopyImageBlit(NEO::Graph
commandContainer.addToResidencyContainer(clearColorAllocation); commandContainer.addToResidencyContainer(clearColorAllocation);
appendEventForProfiling(signalEvent, true, false); appendEventForProfiling(signalEvent, true, false);
NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForImageRegion(blitProperties, *commandContainer.getCommandStream(), *dummyBlitWa.rootDeviceEnvironment); NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForImageRegion(blitProperties, *commandContainer.getCommandStream(), dummyBlitWa);
makeResidentDummyAllocation(); makeResidentDummyAllocation();
appendSignalEventPostWalker(signalEvent, nullptr, false, false); appendSignalEventPostWalker(signalEvent, nullptr, false, false);
@@ -2139,7 +2139,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendBlitFill(void *ptr,
NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryColorFill(gpuAllocation, offset, patternToCommand, patternSize, NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryColorFill(gpuAllocation, offset, patternToCommand, patternSize,
*commandContainer.getCommandStream(), *commandContainer.getCommandStream(),
size, size,
neoDevice->getRootDeviceEnvironmentRef()); this->dummyBlitWa);
makeResidentDummyAllocation(); makeResidentDummyAllocation();
appendSignalEventPostWalker(signalEvent, nullptr, false, false); appendSignalEventPostWalker(signalEvent, nullptr, false, false);
@@ -2514,10 +2514,8 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendWaitOnEvents(uint32_t nu
if (isImmediateType() && isCopyOnly() && trackDependencies) { if (isImmediateType() && isCopyOnly() && trackDependencies) {
NEO::MiFlushArgs args{this->dummyBlitWa}; NEO::MiFlushArgs args{this->dummyBlitWa};
args.commandWithPostSync = true; args.commandWithPostSync = true;
args.waArgs.isWaRequired = true;
NEO::EncodeMiFlushDW<GfxFamily>::programWithWa(*commandContainer.getCommandStream(), this->csr->getBarrierCountGpuAddress(), this->csr->getNextBarrierCount() + 1, args); NEO::EncodeMiFlushDW<GfxFamily>::programWithWa(*commandContainer.getCommandStream(), this->csr->getBarrierCountGpuAddress(), this->csr->getNextBarrierCount() + 1, args);
commandContainer.addToResidencyContainer(this->csr->getTagAllocation()); commandContainer.addToResidencyContainer(this->csr->getTagAllocation());
makeResidentDummyAllocation();
} }
if (apiRequest) { if (apiRequest) {
@@ -2527,6 +2525,8 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendWaitOnEvents(uint32_t nu
handleInOrderDependencyCounter(nullptr, false); handleInOrderDependencyCounter(nullptr, false);
} }
makeResidentDummyAllocation();
if (NEO::debugManager.flags.EnableSWTags.get()) { if (NEO::debugManager.flags.EnableSWTags.get()) {
neoDevice->getRootDeviceEnvironment().tagsManager->insertTag<GfxFamily, NEO::SWTags::CallNameEndTag>( neoDevice->getRootDeviceEnvironment().tagsManager->insertTag<GfxFamily, NEO::SWTags::CallNameEndTag>(
*commandContainer.getCommandStream(), *commandContainer.getCommandStream(),
@@ -2695,7 +2695,6 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendWriteGlobalTimestamp(
NEO::MiFlushArgs args{this->dummyBlitWa}; NEO::MiFlushArgs args{this->dummyBlitWa};
args.timeStampOperation = true; args.timeStampOperation = true;
args.commandWithPostSync = true; args.commandWithPostSync = true;
args.waArgs.isWaRequired = true;
NEO::EncodeMiFlushDW<GfxFamily>::programWithWa(*commandContainer.getCommandStream(), NEO::EncodeMiFlushDW<GfxFamily>::programWithWa(*commandContainer.getCommandStream(),
allocationStruct.alignedAllocationPtr, allocationStruct.alignedAllocationPtr,
0, 0,
@@ -3244,7 +3243,6 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendBarrier(ze_event_handle_
TaskCountType value = 0u; TaskCountType value = 0u;
if (isImmediateType()) { if (isImmediateType()) {
args.commandWithPostSync = true; args.commandWithPostSync = true;
args.waArgs.isWaRequired = true;
gpuAddress = this->csr->getBarrierCountGpuAddress(); gpuAddress = this->csr->getBarrierCountGpuAddress();
value = this->csr->getNextBarrierCount() + 1; value = this->csr->getNextBarrierCount() + 1;
commandContainer.addToResidencyContainer(this->csr->getTagAllocation()); commandContainer.addToResidencyContainer(this->csr->getTagAllocation());
@@ -3456,7 +3454,6 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendWriteToMemory(void *desc
if (isCopyOnly()) { if (isCopyOnly()) {
NEO::MiFlushArgs args{this->dummyBlitWa}; NEO::MiFlushArgs args{this->dummyBlitWa};
args.commandWithPostSync = true; args.commandWithPostSync = true;
args.waArgs.isWaRequired = true;
NEO::EncodeMiFlushDW<GfxFamily>::programWithWa(*commandContainer.getCommandStream(), gpuAddress, NEO::EncodeMiFlushDW<GfxFamily>::programWithWa(*commandContainer.getCommandStream(), gpuAddress,
data, args); data, args);
makeResidentDummyAllocation(); makeResidentDummyAllocation();
@@ -3531,7 +3528,6 @@ void CommandListCoreFamily<gfxCoreFamily>::dispatchPostSyncCopy(uint64_t gpuAddr
NEO::MiFlushArgs miFlushArgs{this->dummyBlitWa}; NEO::MiFlushArgs miFlushArgs{this->dummyBlitWa};
miFlushArgs.commandWithPostSync = true; miFlushArgs.commandWithPostSync = true;
miFlushArgs.waArgs.isWaRequired = true;
NEO::EncodeMiFlushDW<GfxFamily>::programWithWa( NEO::EncodeMiFlushDW<GfxFamily>::programWithWa(
*commandContainer.getCommandStream(), *commandContainer.getCommandStream(),

View File

@@ -539,7 +539,7 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendMemoryCopy(
if (isCopyOnly()) { if (isCopyOnly()) {
auto nBlits = size / (NEO::BlitCommandsHelper<GfxFamily>::getMaxBlitWidth(this->device->getNEODevice()->getRootDeviceEnvironment()) * auto nBlits = size / (NEO::BlitCommandsHelper<GfxFamily>::getMaxBlitWidth(this->device->getNEODevice()->getRootDeviceEnvironment()) *
NEO::BlitCommandsHelper<GfxFamily>::getMaxBlitHeight(this->device->getNEODevice()->getRootDeviceEnvironment(), true)); NEO::BlitCommandsHelper<GfxFamily>::getMaxBlitHeight(this->device->getNEODevice()->getRootDeviceEnvironment(), true));
auto sizePerBlit = sizeof(typename GfxFamily::XY_COPY_BLT) + NEO::BlitCommandsHelper<GfxFamily>::estimatePostBlitCommandSize(); auto sizePerBlit = sizeof(typename GfxFamily::XY_COPY_BLT) + NEO::BlitCommandsHelper<GfxFamily>::estimatePostBlitCommandSize(this->device->getNEODevice()->getRootDeviceEnvironment());
estimatedSize += nBlits * sizePerBlit; estimatedSize += nBlits * sizePerBlit;
} }
checkAvailableSpace(numWaitEvents, relaxedOrderingDispatch, estimatedSize); checkAvailableSpace(numWaitEvents, relaxedOrderingDispatch, estimatedSize);
@@ -594,7 +594,7 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendMemoryCopyRegio
auto xBlits = static_cast<size_t>(std::ceil(srcRegion->width / static_cast<double>(BlitterConstants::maxBlitWidth))); auto xBlits = static_cast<size_t>(std::ceil(srcRegion->width / static_cast<double>(BlitterConstants::maxBlitWidth)));
auto yBlits = static_cast<size_t>(std::ceil(srcRegion->height / static_cast<double>(BlitterConstants::maxBlitHeight))); auto yBlits = static_cast<size_t>(std::ceil(srcRegion->height / static_cast<double>(BlitterConstants::maxBlitHeight)));
auto zBlits = static_cast<size_t>(srcRegion->depth); auto zBlits = static_cast<size_t>(srcRegion->depth);
auto sizePerBlit = sizeof(typename GfxFamily::XY_COPY_BLT) + NEO::BlitCommandsHelper<GfxFamily>::estimatePostBlitCommandSize(); auto sizePerBlit = sizeof(typename GfxFamily::XY_COPY_BLT) + NEO::BlitCommandsHelper<GfxFamily>::estimatePostBlitCommandSize(this->device->getNEODevice()->getRootDeviceEnvironment());
estimatedSize += xBlits * yBlits * zBlits * sizePerBlit; estimatedSize += xBlits * yBlits * zBlits * sizePerBlit;
} }
checkAvailableSpace(numWaitEvents, relaxedOrderingDispatch, estimatedSize); checkAvailableSpace(numWaitEvents, relaxedOrderingDispatch, estimatedSize);
@@ -757,7 +757,7 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendImageCopyRegion
if (isCopyOnly()) { if (isCopyOnly()) {
auto imgSize = L0::Image::fromHandle(hSrcImage)->getImageInfo().size; auto imgSize = L0::Image::fromHandle(hSrcImage)->getImageInfo().size;
auto nBlits = static_cast<size_t>(std::ceil(imgSize / static_cast<double>(BlitterConstants::maxBlitWidth * BlitterConstants::maxBlitHeight))); auto nBlits = static_cast<size_t>(std::ceil(imgSize / static_cast<double>(BlitterConstants::maxBlitWidth * BlitterConstants::maxBlitHeight)));
auto sizePerBlit = sizeof(typename GfxFamily::XY_BLOCK_COPY_BLT) + NEO::BlitCommandsHelper<GfxFamily>::estimatePostBlitCommandSize(); auto sizePerBlit = sizeof(typename GfxFamily::XY_BLOCK_COPY_BLT) + NEO::BlitCommandsHelper<GfxFamily>::estimatePostBlitCommandSize(this->device->getNEODevice()->getRootDeviceEnvironment());
estimatedSize += nBlits * sizePerBlit; estimatedSize += nBlits * sizePerBlit;
} }
checkAvailableSpace(numWaitEvents, relaxedOrderingDispatch, estimatedSize); checkAvailableSpace(numWaitEvents, relaxedOrderingDispatch, estimatedSize);

View File

@@ -464,7 +464,7 @@ HWTEST2_F(CommandListAppendUsedPacketSignalEvent,
EXPECT_EQ(2u, event->getPacketsInUse()); EXPECT_EQ(2u, event->getPacketsInUse());
size_t usedAfterSize = cmdStream->getUsed(); size_t usedAfterSize = cmdStream->getUsed();
NEO::EncodeDummyBlitWaArgs waArgs{true, const_cast<RootDeviceEnvironment *>(&device->getNEODevice()->getRootDeviceEnvironment())}; NEO::EncodeDummyBlitWaArgs waArgs{false, const_cast<RootDeviceEnvironment *>(&device->getNEODevice()->getRootDeviceEnvironment())};
size_t expectedSize = NEO::EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs) * packets; size_t expectedSize = NEO::EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs) * packets;
EXPECT_EQ(expectedSize, (usedAfterSize - usedBeforeSize)); EXPECT_EQ(expectedSize, (usedAfterSize - usedBeforeSize));

View File

@@ -689,10 +689,12 @@ HWTEST_F(BcsTests, givenBlitPropertiesContainerWhenEstimatingCommandsSizeThenCal
const size_t bltSize = (3 * max2DBlitSize); const size_t bltSize = (3 * max2DBlitSize);
const uint32_t numberOfBlitOperations = 4; const uint32_t numberOfBlitOperations = 4;
EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())}; EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())};
size_t dummyBlitWaSize = BlitCommandsHelper<FamilyType>::getDummyBlitSize(waArgs);
waArgs.isWaRequired = false;
auto baseSize = EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs) + sizeof(typename FamilyType::MI_BATCH_BUFFER_END); auto baseSize = EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs) + sizeof(typename FamilyType::MI_BATCH_BUFFER_END);
size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck<FamilyType>::getCommandSize(); size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck<FamilyType>::getCommandSize() + dummyBlitWaSize;
if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) { if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) {
cmdsSizePerBlit += EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs); cmdsSizePerBlit += EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs);
@@ -731,9 +733,11 @@ HWTEST_F(BcsTests, givenBlitPropertiesContainerWhenDirectsubmissionEnabledEstima
const size_t bltSize = (3 * max2DBlitSize); const size_t bltSize = (3 * max2DBlitSize);
const uint32_t numberOfBlitOperations = 4; const uint32_t numberOfBlitOperations = 4;
EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())}; EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())};
size_t dummyBlitWaSize = BlitCommandsHelper<FamilyType>::getDummyBlitSize(waArgs);
waArgs.isWaRequired = false;
auto baseSize = EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs) + sizeof(typename FamilyType::MI_BATCH_BUFFER_START); auto baseSize = EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs) + sizeof(typename FamilyType::MI_BATCH_BUFFER_START);
size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck<FamilyType>::getCommandSize(); size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck<FamilyType>::getCommandSize() + dummyBlitWaSize;
if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) { if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) {
cmdsSizePerBlit += EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs); cmdsSizePerBlit += EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs);
@@ -771,8 +775,10 @@ HWTEST_F(BcsTests, givenBlitPropertiesContainerWhenEstimatingCommandsSizeForWrit
const Vec3<size_t> bltSize = {(3 * max2DBlitSize), 4, 2}; const Vec3<size_t> bltSize = {(3 * max2DBlitSize), 4, 2};
const size_t numberOfBlts = 3 * bltSize.y * bltSize.z; const size_t numberOfBlts = 3 * bltSize.y * bltSize.z;
const size_t numberOfBlitOperations = 4 * bltSize.y * bltSize.z; const size_t numberOfBlitOperations = 4 * bltSize.y * bltSize.z;
EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())}; EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())};
size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck<FamilyType>::getCommandSize(); size_t dummyBlitWaSize = BlitCommandsHelper<FamilyType>::getDummyBlitSize(waArgs);
waArgs.isWaRequired = false;
size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck<FamilyType>::getCommandSize() + dummyBlitWaSize;
if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) { if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) {
cmdsSizePerBlit += EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs); cmdsSizePerBlit += EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs);
@@ -811,8 +817,10 @@ HWTEST_F(BcsTests, givenBlitPropertiesContainerWhenDirectSubmissionEnabledEstima
const Vec3<size_t> bltSize = {(3 * max2DBlitSize), 4, 2}; const Vec3<size_t> bltSize = {(3 * max2DBlitSize), 4, 2};
const size_t numberOfBlts = 3 * bltSize.y * bltSize.z; const size_t numberOfBlts = 3 * bltSize.y * bltSize.z;
const size_t numberOfBlitOperations = 4 * bltSize.y * bltSize.z; const size_t numberOfBlitOperations = 4 * bltSize.y * bltSize.z;
EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())}; EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())};
size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck<FamilyType>::getCommandSize(); size_t dummyBlitWaSize = BlitCommandsHelper<FamilyType>::getDummyBlitSize(waArgs);
waArgs.isWaRequired = false;
size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck<FamilyType>::getCommandSize() + dummyBlitWaSize;
if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) { if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) {
cmdsSizePerBlit += EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs); cmdsSizePerBlit += EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs);
@@ -850,7 +858,7 @@ HWTEST_F(BcsTests, givenTimestampPacketWriteRequestWhenEstimatingSizeForCommands
EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())}; EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())};
size_t dummyBlitWaSize = BlitCommandsHelper<FamilyType>::getDummyBlitSize(waArgs); size_t dummyBlitWaSize = BlitCommandsHelper<FamilyType>::getDummyBlitSize(waArgs);
waArgs.isWaRequired = false; waArgs.isWaRequired = false;
size_t expectedBaseSize = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck<FamilyType>::getCommandSize(); size_t expectedBaseSize = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck<FamilyType>::getCommandSize() + dummyBlitWaSize;
if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) { if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) {
expectedBaseSize += EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs); expectedBaseSize += EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs);
@@ -860,7 +868,7 @@ HWTEST_F(BcsTests, givenTimestampPacketWriteRequestWhenEstimatingSizeForCommands
expectedBaseSize += EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs); expectedBaseSize += EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs);
} }
auto expectedSizeWithTimestampPacketWrite = expectedBaseSize + EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs) + dummyBlitWaSize; auto expectedSizeWithTimestampPacketWrite = expectedBaseSize + EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs);
auto expectedSizeWithoutTimestampPacketWrite = expectedBaseSize; auto expectedSizeWithoutTimestampPacketWrite = expectedBaseSize;
auto estimatedSizeWithTimestampPacketWrite = BlitCommandsHelper<FamilyType>::estimateBlitCommandSize( auto estimatedSizeWithTimestampPacketWrite = BlitCommandsHelper<FamilyType>::estimateBlitCommandSize(
@@ -909,8 +917,10 @@ HWTEST_F(BcsTests, givenBltSizeAndCsrDependenciesWhenEstimatingCommandSizeThenAd
csrDependencies.timestampPacketContainer.push_back(&timestamp0); csrDependencies.timestampPacketContainer.push_back(&timestamp0);
csrDependencies.timestampPacketContainer.push_back(&timestamp1); csrDependencies.timestampPacketContainer.push_back(&timestamp1);
EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())}; EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())};
size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck<FamilyType>::getCommandSize(); size_t dummyBlitWaSize = BlitCommandsHelper<FamilyType>::getDummyBlitSize(waArgs);
waArgs.isWaRequired = false;
size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck<FamilyType>::getCommandSize() + dummyBlitWaSize;
if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) { if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) {
cmdsSizePerBlit += EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs); cmdsSizePerBlit += EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs);
@@ -939,8 +949,10 @@ HWTEST_F(BcsTests, givenBltSizeWithCsrDependenciesAndRelaxedOrderingWhenEstimati
csrDependencies.timestampPacketContainer.push_back(&timestamp0); csrDependencies.timestampPacketContainer.push_back(&timestamp0);
csrDependencies.timestampPacketContainer.push_back(&timestamp1); csrDependencies.timestampPacketContainer.push_back(&timestamp1);
EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())}; EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())};
size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck<FamilyType>::getCommandSize(); size_t dummyBlitWaSize = BlitCommandsHelper<FamilyType>::getDummyBlitSize(waArgs);
waArgs.isWaRequired = false;
size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck<FamilyType>::getCommandSize() + dummyBlitWaSize;
if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) { if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) {
cmdsSizePerBlit += EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs); cmdsSizePerBlit += EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs);
@@ -962,8 +974,10 @@ HWTEST_F(BcsTests, givenBltSizeWithCsrDependenciesAndRelaxedOrderingWhenEstimati
HWTEST_F(BcsTests, givenImageAndBufferWhenEstimateBlitCommandSizeThenReturnCorrectCommandSize) { HWTEST_F(BcsTests, givenImageAndBufferWhenEstimateBlitCommandSizeThenReturnCorrectCommandSize) {
for (auto isImage : {false, true}) { for (auto isImage : {false, true}) {
EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())}; EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())};
auto expectedSize = EncodeMiArbCheck<FamilyType>::getCommandSize(); size_t dummyBlitWaSize = BlitCommandsHelper<FamilyType>::getDummyBlitSize(waArgs);
waArgs.isWaRequired = false;
auto expectedSize = EncodeMiArbCheck<FamilyType>::getCommandSize() + dummyBlitWaSize;
expectedSize += isImage ? sizeof(typename FamilyType::XY_BLOCK_COPY_BLT) : sizeof(typename FamilyType::XY_COPY_BLT); expectedSize += isImage ? sizeof(typename FamilyType::XY_BLOCK_COPY_BLT) : sizeof(typename FamilyType::XY_COPY_BLT);
if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) { if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) {
@@ -1213,6 +1227,7 @@ HWTEST_F(BcsTests, givenBltSizeWithLeftoverWhenDispatchedThenProgramAllRequiredC
EXPECT_EQ(expectedWidth, bltCmd->getSourcePitch()); EXPECT_EQ(expectedWidth, bltCmd->getSourcePitch());
if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) { if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) {
UnitTestHelper<FamilyType>::verifyDummyBlitWa(&(pDevice->getRootDeviceEnvironmentRef()), cmdIterator);
auto miFlush = genCmdCast<typename FamilyType::MI_FLUSH_DW *>(*(cmdIterator++)); auto miFlush = genCmdCast<typename FamilyType::MI_FLUSH_DW *>(*(cmdIterator++));
EXPECT_NE(nullptr, miFlush); EXPECT_NE(nullptr, miFlush);
EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())}; EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())};
@@ -1237,9 +1252,7 @@ HWTEST_F(BcsTests, givenBltSizeWithLeftoverWhenDispatchedThenProgramAllRequiredC
cmdIterator++; cmdIterator++;
} }
} }
if (pDevice->getProductHelper().isDummyBlitWaRequired()) {
UnitTestHelper<FamilyType>::verifyDummyBlitWa(&(pDevice->getRootDeviceEnvironmentRef()), cmdIterator);
}
auto miFlushCmd = genCmdCast<MI_FLUSH_DW *>(*(cmdIterator++)); auto miFlushCmd = genCmdCast<MI_FLUSH_DW *>(*(cmdIterator++));
if (UnitTestHelper<FamilyType>::additionalMiFlushDwRequired) { if (UnitTestHelper<FamilyType>::additionalMiFlushDwRequired) {
@@ -1451,6 +1464,7 @@ HWTEST_P(BcsDetaliedTestsWithParams, givenBltSizeWithLeftoverWhenDispatchedThenP
offset += (expectedWidth * expectedHeight); offset += (expectedWidth * expectedHeight);
if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) { if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) {
UnitTestHelper<FamilyType>::verifyDummyBlitWa(&(pDevice->getRootDeviceEnvironmentRef()), cmdIterator);
auto miFlush = genCmdCast<typename FamilyType::MI_FLUSH_DW *>(*(cmdIterator++)); auto miFlush = genCmdCast<typename FamilyType::MI_FLUSH_DW *>(*(cmdIterator++));
EXPECT_NE(nullptr, miFlush); EXPECT_NE(nullptr, miFlush);
EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())}; EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())};
@@ -1554,6 +1568,7 @@ HWTEST_P(BcsDetaliedTestsWithParams, givenBltSizeWithLeftoverWhenDispatchedThenP
offset += (expectedWidth * expectedHeight); offset += (expectedWidth * expectedHeight);
if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) { if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) {
UnitTestHelper<FamilyType>::verifyDummyBlitWa(&(pDevice->getRootDeviceEnvironmentRef()), cmdIterator);
auto miFlush = genCmdCast<typename FamilyType::MI_FLUSH_DW *>(*(cmdIterator++)); auto miFlush = genCmdCast<typename FamilyType::MI_FLUSH_DW *>(*(cmdIterator++));
EXPECT_NE(nullptr, miFlush); EXPECT_NE(nullptr, miFlush);
EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())}; EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())};
@@ -1647,6 +1662,7 @@ HWTEST_P(BcsDetaliedTestsWithParams, givenBltSizeWithLeftoverWhenDispatchedThenP
offset += (expectedWidth * expectedHeight); offset += (expectedWidth * expectedHeight);
if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) { if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) {
UnitTestHelper<FamilyType>::verifyDummyBlitWa(&(pDevice->getRootDeviceEnvironmentRef()), cmdIterator);
auto miFlush = genCmdCast<typename FamilyType::MI_FLUSH_DW *>(*(cmdIterator++)); auto miFlush = genCmdCast<typename FamilyType::MI_FLUSH_DW *>(*(cmdIterator++));
EXPECT_NE(nullptr, miFlush); EXPECT_NE(nullptr, miFlush);
EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())}; EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())};
@@ -1654,6 +1670,8 @@ HWTEST_P(BcsDetaliedTestsWithParams, givenBltSizeWithLeftoverWhenDispatchedThenP
miFlush = genCmdCast<typename FamilyType::MI_FLUSH_DW *>(*(cmdIterator++)); miFlush = genCmdCast<typename FamilyType::MI_FLUSH_DW *>(*(cmdIterator++));
EXPECT_NE(nullptr, miFlush); EXPECT_NE(nullptr, miFlush);
} }
} else {
UnitTestHelper<FamilyType>::verifyDummyBlitWa(&(pDevice->getRootDeviceEnvironmentRef()), cmdIterator);
} }
auto miArbCheckCmd = genCmdCast<typename FamilyType::MI_ARB_CHECK *>(*(cmdIterator++)); auto miArbCheckCmd = genCmdCast<typename FamilyType::MI_ARB_CHECK *>(*(cmdIterator++));
EXPECT_NE(nullptr, miArbCheckCmd); EXPECT_NE(nullptr, miArbCheckCmd);

View File

@@ -39,8 +39,9 @@ using namespace NEO;
HWTEST_F(BcsTests, givenBltSizeWhenEstimatingCommandSizeThenAddAllRequiredCommands) { HWTEST_F(BcsTests, givenBltSizeWhenEstimatingCommandSizeThenAddAllRequiredCommands) {
constexpr auto max2DBlitSize = BlitterConstants::maxBlitWidth * BlitterConstants::maxBlitHeight; constexpr auto max2DBlitSize = BlitterConstants::maxBlitWidth * BlitterConstants::maxBlitHeight;
EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())}; EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())};
size_t dummyBlitWaSize = BlitCommandsHelper<FamilyType>::getDummyBlitSize(waArgs);
waArgs.isWaRequired = false; waArgs.isWaRequired = false;
size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck<FamilyType>::getCommandSize(); size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck<FamilyType>::getCommandSize() + dummyBlitWaSize;
if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) { if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) {
cmdsSizePerBlit += EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs); cmdsSizePerBlit += EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs);
@@ -75,8 +76,10 @@ HWTEST_F(BcsTests, givenBltSizeWhenEstimatingCommandSizeThenAddAllRequiredComman
HWTEST_F(BcsTests, givenDebugCapabilityWhenEstimatingCommandSizeThenAddAllRequiredCommands) { HWTEST_F(BcsTests, givenDebugCapabilityWhenEstimatingCommandSizeThenAddAllRequiredCommands) {
constexpr auto max2DBlitSize = BlitterConstants::maxBlitWidth * BlitterConstants::maxBlitHeight; constexpr auto max2DBlitSize = BlitterConstants::maxBlitWidth * BlitterConstants::maxBlitHeight;
EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())}; EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())};
size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck<FamilyType>::getCommandSize(); size_t dummyBlitWaSize = BlitCommandsHelper<FamilyType>::getDummyBlitSize(waArgs);
waArgs.isWaRequired = false;
size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck<FamilyType>::getCommandSize() + dummyBlitWaSize;
if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) { if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) {
cmdsSizePerBlit += EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs); cmdsSizePerBlit += EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs);
@@ -104,8 +107,10 @@ HWTEST_F(BcsTests, givenDebugCapabilityWhenEstimatingCommandSizeThenAddAllRequir
} }
HWTEST_F(BcsTests, givenRelaxedOrderingEnabledWhenEstimatingCommandSizeThenAddAllRequiredCommands) { HWTEST_F(BcsTests, givenRelaxedOrderingEnabledWhenEstimatingCommandSizeThenAddAllRequiredCommands) {
EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())}; EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())};
size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck<FamilyType>::getCommandSize(); size_t dummyBlitWaSize = BlitCommandsHelper<FamilyType>::getDummyBlitSize(waArgs);
waArgs.isWaRequired = false;
size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck<FamilyType>::getCommandSize() + dummyBlitWaSize;
if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) { if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) {
cmdsSizePerBlit += EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs); cmdsSizePerBlit += EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs);
@@ -134,8 +139,10 @@ HWTEST_F(BcsTests, givenRelaxedOrderingEnabledWhenEstimatingCommandSizeThenAddAl
HWTEST_F(BcsTests, givenBltSizeWhenEstimatingCommandSizeForReadBufferRectThenAddAllRequiredCommands) { HWTEST_F(BcsTests, givenBltSizeWhenEstimatingCommandSizeForReadBufferRectThenAddAllRequiredCommands) {
constexpr auto max2DBlitSize = BlitterConstants::maxBlitWidth * BlitterConstants::maxBlitHeight; constexpr auto max2DBlitSize = BlitterConstants::maxBlitWidth * BlitterConstants::maxBlitHeight;
EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())}; EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())};
size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck<FamilyType>::getCommandSize(); size_t dummyBlitWaSize = BlitCommandsHelper<FamilyType>::getDummyBlitSize(waArgs);
waArgs.isWaRequired = false;
size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck<FamilyType>::getCommandSize() + dummyBlitWaSize;
if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) { if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) {
cmdsSizePerBlit += EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs); cmdsSizePerBlit += EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs);
@@ -170,8 +177,10 @@ HWTEST_F(BcsTests, givenBltWithBigCopySizeWhenEstimatingCommandSizeForReadBuffer
auto maxWidthToCopy = static_cast<size_t>(BlitCommandsHelper<FamilyType>::getMaxBlitWidth(rootDeviceEnvironment)); auto maxWidthToCopy = static_cast<size_t>(BlitCommandsHelper<FamilyType>::getMaxBlitWidth(rootDeviceEnvironment));
auto maxHeightToCopy = static_cast<size_t>(BlitCommandsHelper<FamilyType>::getMaxBlitHeight(rootDeviceEnvironment, false)); auto maxHeightToCopy = static_cast<size_t>(BlitCommandsHelper<FamilyType>::getMaxBlitHeight(rootDeviceEnvironment, false));
EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())}; EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())};
size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck<FamilyType>::getCommandSize(); size_t dummyBlitWaSize = BlitCommandsHelper<FamilyType>::getDummyBlitSize(waArgs);
waArgs.isWaRequired = false;
size_t cmdsSizePerBlit = sizeof(typename FamilyType::XY_COPY_BLT) + EncodeMiArbCheck<FamilyType>::getCommandSize() + dummyBlitWaSize;
if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) { if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) {
cmdsSizePerBlit += EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs); cmdsSizePerBlit += EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs);

View File

@@ -997,9 +997,7 @@ void EncodeMiFlushDW<GfxFamily>::appendWa(LinearStream &commandStream, MiFlushAr
template <typename Family> template <typename Family>
void EncodeMiFlushDW<Family>::programWithWa(LinearStream &commandStream, uint64_t immediateDataGpuAddress, uint64_t immediateData, void EncodeMiFlushDW<Family>::programWithWa(LinearStream &commandStream, uint64_t immediateDataGpuAddress, uint64_t immediateData,
MiFlushArgs &args) { MiFlushArgs &args) {
UNRECOVERABLE_IF(args.waArgs.isWaRequired && !args.commandWithPostSync);
appendWa(commandStream, args); appendWa(commandStream, args);
args.waArgs.isWaRequired = false;
auto miFlushDwCmd = commandStream.getSpaceForCmd<MI_FLUSH_DW>(); auto miFlushDwCmd = commandStream.getSpaceForCmd<MI_FLUSH_DW>();
MI_FLUSH_DW miFlush = Family::cmdInitMiFlushDw; MI_FLUSH_DW miFlush = Family::cmdInitMiFlushDw;

View File

@@ -1055,7 +1055,11 @@ TaskCountType CommandStreamReceiverHw<GfxFamily>::flushBcsTask(const BlitPropert
EncodeMiFlushDW<GfxFamily>::programWithWa(commandStream, this->globalFenceAllocation->getGpuAddress(), 0, tlbFlushArgs); EncodeMiFlushDW<GfxFamily>::programWithWa(commandStream, this->globalFenceAllocation->getGpuAddress(), 0, tlbFlushArgs);
} }
BlitCommandsHelper<GfxFamily>::dispatchBlitCommands(blitProperties, commandStream, *waArgs.rootDeviceEnvironment); BlitCommandsHelper<GfxFamily>::dispatchBlitCommands(blitProperties, commandStream, waArgs);
auto dummyAllocation = rootDeviceEnvironment->getDummyAllocation();
if (dummyAllocation) {
makeResident(*dummyAllocation);
}
if (blitProperties.outputTimestampPacket) { if (blitProperties.outputTimestampPacket) {
if (profilingEnabled) { if (profilingEnabled) {
@@ -1090,13 +1094,8 @@ TaskCountType CommandStreamReceiverHw<GfxFamily>::flushBcsTask(const BlitPropert
if (updateTag) { if (updateTag) {
MemorySynchronizationCommands<GfxFamily>::addAdditionalSynchronization(commandStream, tagAllocation->getGpuAddress(), false, peekRootDeviceEnvironment()); MemorySynchronizationCommands<GfxFamily>::addAdditionalSynchronization(commandStream, tagAllocation->getGpuAddress(), false, peekRootDeviceEnvironment());
args.commandWithPostSync = true; args.commandWithPostSync = true;
args.waArgs.isWaRequired = true;
args.notifyEnable = isUsedNotifyEnableForPostSync(); args.notifyEnable = isUsedNotifyEnableForPostSync();
EncodeMiFlushDW<GfxFamily>::programWithWa(commandStream, tagAllocation->getGpuAddress(), newTaskCount, args); EncodeMiFlushDW<GfxFamily>::programWithWa(commandStream, tagAllocation->getGpuAddress(), newTaskCount, args);
auto dummyAllocation = rootDeviceEnvironment->getDummyAllocation();
if (dummyAllocation) {
makeResident(*dummyAllocation);
}
MemorySynchronizationCommands<GfxFamily>::addAdditionalSynchronization(commandStream, tagAllocation->getGpuAddress(), false, peekRootDeviceEnvironment()); MemorySynchronizationCommands<GfxFamily>::addAdditionalSynchronization(commandStream, tagAllocation->getGpuAddress(), false, peekRootDeviceEnvironment());
} }

View File

@@ -108,22 +108,22 @@ void BlitCommandsHelper<Family>::appendBlitCommandsForImages(const BlitPropertie
} }
template <> template <>
void BlitCommandsHelper<Family>::dispatchBlitMemoryColorFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, size_t patternSize, LinearStream &linearStream, size_t size, RootDeviceEnvironment &rootDeviceEnvironment) { void BlitCommandsHelper<Family>::dispatchBlitMemoryColorFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, size_t patternSize, LinearStream &linearStream, size_t size, EncodeDummyBlitWaArgs &waArgs) {
switch (patternSize) { switch (patternSize) {
case 1: case 1:
NEO::BlitCommandsHelper<Family>::dispatchBlitMemoryFill<1>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_8_BIT_COLOR); NEO::BlitCommandsHelper<Family>::dispatchBlitMemoryFill<1>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_8_BIT_COLOR);
break; break;
case 2: case 2:
NEO::BlitCommandsHelper<Family>::dispatchBlitMemoryFill<2>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_16_BIT_COLOR); NEO::BlitCommandsHelper<Family>::dispatchBlitMemoryFill<2>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_16_BIT_COLOR);
break; break;
case 4: case 4:
NEO::BlitCommandsHelper<Family>::dispatchBlitMemoryFill<4>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_32_BIT_COLOR); NEO::BlitCommandsHelper<Family>::dispatchBlitMemoryFill<4>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_32_BIT_COLOR);
break; break;
case 8: case 8:
NEO::BlitCommandsHelper<Family>::dispatchBlitMemoryFill<8>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_64_BIT_COLOR); NEO::BlitCommandsHelper<Family>::dispatchBlitMemoryFill<8>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_64_BIT_COLOR);
break; break;
default: default:
NEO::BlitCommandsHelper<Family>::dispatchBlitMemoryFill<16>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_128_BIT_COLOR); NEO::BlitCommandsHelper<Family>::dispatchBlitMemoryFill<16>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_128_BIT_COLOR);
} }
} }

View File

@@ -32,9 +32,9 @@ struct BlitCommandsHelper {
static uint64_t getMaxBlitHeight(const RootDeviceEnvironment &rootDeviceEnvironment, bool isSystemMemoryPoolUsed); static uint64_t getMaxBlitHeight(const RootDeviceEnvironment &rootDeviceEnvironment, bool isSystemMemoryPoolUsed);
static uint64_t getMaxBlitHeightOverride(const RootDeviceEnvironment &rootDeviceEnvironment, bool isSystemMemoryPoolUsed); static uint64_t getMaxBlitHeightOverride(const RootDeviceEnvironment &rootDeviceEnvironment, bool isSystemMemoryPoolUsed);
static void dispatchPreBlitCommand(LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment); static void dispatchPreBlitCommand(LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment);
static size_t estimatePreBlitCommandSize(); static size_t estimatePreBlitCommandSize(const RootDeviceEnvironment &rootDeviceEnvironment);
static void dispatchPostBlitCommand(LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment); static void dispatchPostBlitCommand(LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs);
static size_t estimatePostBlitCommandSize(); static size_t estimatePostBlitCommandSize(const RootDeviceEnvironment &rootDeviceEnvironment);
static size_t estimateBlitCommandSize(const Vec3<size_t> &copySize, const CsrDependencies &csrDependencies, bool updateTimestampPacket, static size_t estimateBlitCommandSize(const Vec3<size_t> &copySize, const CsrDependencies &csrDependencies, bool updateTimestampPacket,
bool profilingEnabled, bool isImage, const RootDeviceEnvironment &rootDeviceEnvironment, bool isSystemMemoryPoolUsed, bool relaxedOrderingEnabled); bool profilingEnabled, bool isImage, const RootDeviceEnvironment &rootDeviceEnvironment, bool isSystemMemoryPoolUsed, bool relaxedOrderingEnabled);
static size_t estimateBlitCommandsSize(const BlitPropertiesContainer &blitPropertiesContainer, bool profilingEnabled, 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 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 calculateBlitCommandDestinationBaseAddressCopyRegion(const BlitProperties &blitProperties, size_t slice);
static uint64_t calculateBlitCommandSourceBaseAddressCopyRegion(const BlitProperties &blitProperties, size_t slice); static uint64_t calculateBlitCommandSourceBaseAddressCopyRegion(const BlitProperties &blitProperties, size_t slice);
static void dispatchBlitCommands(const BlitProperties &blitProperties, LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment); static void dispatchBlitCommands(const BlitProperties &blitProperties, LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs);
static void dispatchBlitCommandsForBufferRegion(const BlitProperties &blitProperties, LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment); static void dispatchBlitCommandsForBufferRegion(const BlitProperties &blitProperties, LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs);
static void dispatchBlitCommandsForBufferPerRow(const BlitProperties &blitProperties, LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment); static void dispatchBlitCommandsForBufferPerRow(const BlitProperties &blitProperties, LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs);
static void dispatchBlitCommandsForImageRegion(const BlitProperties &blitProperties, LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment); 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, RootDeviceEnvironment &rootDeviceEnvironment); static void dispatchBlitMemoryColorFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, size_t patternSize, LinearStream &linearStream, size_t size, EncodeDummyBlitWaArgs &waArgs);
template <size_t patternSize> template <size_t patternSize>
static void dispatchBlitMemoryFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, LinearStream &linearStream, size_t size, RootDeviceEnvironment &rootDeviceEnvironment, COLOR_DEPTH depth); static void dispatchBlitMemoryFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, LinearStream &linearStream, size_t size, EncodeDummyBlitWaArgs &waArgs, COLOR_DEPTH depth);
static void dispatchDummyBlit(LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs); static void dispatchDummyBlit(LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs);
static size_t getDummyBlitSize(const EncodeDummyBlitWaArgs &waArgs); static size_t getDummyBlitSize(const EncodeDummyBlitWaArgs &waArgs);
static bool isDummyBlitWaNeeded(const EncodeDummyBlitWaArgs &waArgs); static bool isDummyBlitWaNeeded(const EncodeDummyBlitWaArgs &waArgs);

View File

@@ -43,7 +43,7 @@ uint64_t BlitCommandsHelper<GfxFamily>::getMaxBlitHeight(const RootDeviceEnviron
template <typename GfxFamily> template <typename GfxFamily>
void BlitCommandsHelper<GfxFamily>::dispatchPreBlitCommand(LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment) { void BlitCommandsHelper<GfxFamily>::dispatchPreBlitCommand(LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment) {
if (BlitCommandsHelper<GfxFamily>::preBlitCommandWARequired()) { if (BlitCommandsHelper<GfxFamily>::preBlitCommandWARequired()) {
NEO::EncodeDummyBlitWaArgs waArgs{false, &rootDeviceEnvironment}; NEO::EncodeDummyBlitWaArgs waArgs{false, const_cast<RootDeviceEnvironment *>(&rootDeviceEnvironment)};
MiFlushArgs args{waArgs}; MiFlushArgs args{waArgs};
EncodeMiFlushDW<GfxFamily>::programWithWa(linearStream, 0, 0, args); EncodeMiFlushDW<GfxFamily>::programWithWa(linearStream, 0, 0, args);
@@ -51,17 +51,17 @@ void BlitCommandsHelper<GfxFamily>::dispatchPreBlitCommand(LinearStream &linearS
} }
template <typename GfxFamily> template <typename GfxFamily>
size_t BlitCommandsHelper<GfxFamily>::estimatePreBlitCommandSize() { size_t BlitCommandsHelper<GfxFamily>::estimatePreBlitCommandSize(const RootDeviceEnvironment &rootDeviceEnvironment) {
if (BlitCommandsHelper<GfxFamily>::preBlitCommandWARequired()) { if (BlitCommandsHelper<GfxFamily>::preBlitCommandWARequired()) {
return EncodeMiFlushDW<GfxFamily>::getCommandSizeWithWa({}); EncodeDummyBlitWaArgs waArgs{false, const_cast<RootDeviceEnvironment *>(&rootDeviceEnvironment)};
return EncodeMiFlushDW<GfxFamily>::getCommandSizeWithWa(waArgs);
} }
return 0u; return 0u;
} }
template <typename GfxFamily> template <typename GfxFamily>
void BlitCommandsHelper<GfxFamily>::dispatchPostBlitCommand(LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment) { void BlitCommandsHelper<GfxFamily>::dispatchPostBlitCommand(LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs) {
EncodeDummyBlitWaArgs waArgs{false, &rootDeviceEnvironment};
MiFlushArgs args{waArgs}; MiFlushArgs args{waArgs};
if (debugManager.flags.PostBlitCommand.get() != BlitterConstants::PostBlitMode::defaultMode) { if (debugManager.flags.PostBlitCommand.get() != BlitterConstants::PostBlitMode::defaultMode) {
switch (debugManager.flags.PostBlitCommand.get()) { switch (debugManager.flags.PostBlitCommand.get()) {
@@ -78,14 +78,15 @@ void BlitCommandsHelper<GfxFamily>::dispatchPostBlitCommand(LinearStream &linear
if (BlitCommandsHelper<GfxFamily>::miArbCheckWaRequired()) { if (BlitCommandsHelper<GfxFamily>::miArbCheckWaRequired()) {
EncodeMiFlushDW<GfxFamily>::programWithWa(linearStream, 0, 0, args); EncodeMiFlushDW<GfxFamily>::programWithWa(linearStream, 0, 0, args);
args.waArgs.isWaRequired = false;
} }
EncodeMiArbCheck<GfxFamily>::program(linearStream, std::nullopt); EncodeMiArbCheck<GfxFamily>::program(linearStream, std::nullopt);
} }
template <typename GfxFamily> template <typename GfxFamily>
size_t BlitCommandsHelper<GfxFamily>::estimatePostBlitCommandSize() { size_t BlitCommandsHelper<GfxFamily>::estimatePostBlitCommandSize(const RootDeviceEnvironment &rootDeviceEnvironment) {
EncodeDummyBlitWaArgs waArgs{}; EncodeDummyBlitWaArgs waArgs{true, const_cast<RootDeviceEnvironment *>(&rootDeviceEnvironment)};
if (debugManager.flags.PostBlitCommand.get() != BlitterConstants::PostBlitMode::defaultMode) { if (debugManager.flags.PostBlitCommand.get() != BlitterConstants::PostBlitMode::defaultMode) {
switch (debugManager.flags.PostBlitCommand.get()) { switch (debugManager.flags.PostBlitCommand.get()) {
@@ -110,7 +111,7 @@ size_t BlitCommandsHelper<GfxFamily>::estimateBlitCommandSize(const Vec3<size_t>
bool isImage, const RootDeviceEnvironment &rootDeviceEnvironment, bool isSystemMemoryPoolUsed, bool relaxedOrderingEnabled) { bool isImage, const RootDeviceEnvironment &rootDeviceEnvironment, bool isSystemMemoryPoolUsed, bool relaxedOrderingEnabled) {
size_t timestampCmdSize = 0; size_t timestampCmdSize = 0;
if (updateTimestampPacket) { if (updateTimestampPacket) {
EncodeDummyBlitWaArgs waArgs{true, const_cast<RootDeviceEnvironment *>(&rootDeviceEnvironment)}; EncodeDummyBlitWaArgs waArgs{false, const_cast<RootDeviceEnvironment *>(&rootDeviceEnvironment)};
timestampCmdSize += EncodeMiFlushDW<GfxFamily>::getCommandSizeWithWa(waArgs); timestampCmdSize += EncodeMiFlushDW<GfxFamily>::getCommandSizeWithWa(waArgs);
if (profilingEnabled) { if (profilingEnabled) {
timestampCmdSize += getProfilingMmioCmdsSize(); timestampCmdSize += getProfilingMmioCmdsSize();
@@ -129,12 +130,12 @@ size_t BlitCommandsHelper<GfxFamily>::estimateBlitCommandSize(const Vec3<size_t>
sizePerBlit = sizeof(typename GfxFamily::XY_COPY_BLT); sizePerBlit = sizeof(typename GfxFamily::XY_COPY_BLT);
} }
sizePerBlit += estimatePostBlitCommandSize(); sizePerBlit += estimatePostBlitCommandSize(rootDeviceEnvironment);
return TimestampPacketHelper::getRequiredCmdStreamSize<GfxFamily>(csrDependencies, relaxedOrderingEnabled) + return TimestampPacketHelper::getRequiredCmdStreamSize<GfxFamily>(csrDependencies, relaxedOrderingEnabled) +
TimestampPacketHelper::getRequiredCmdStreamSizeForMultiRootDeviceSyncNodesContainer<GfxFamily>(csrDependencies) + TimestampPacketHelper::getRequiredCmdStreamSizeForMultiRootDeviceSyncNodesContainer<GfxFamily>(csrDependencies) +
(sizePerBlit * nBlits) + (sizePerBlit * nBlits) +
timestampCmdSize + timestampCmdSize +
estimatePreBlitCommandSize(); estimatePreBlitCommandSize(rootDeviceEnvironment);
} }
template <typename GfxFamily> template <typename GfxFamily>
@@ -193,17 +194,17 @@ uint64_t BlitCommandsHelper<GfxFamily>::calculateBlitCommandSourceBaseAddress(co
} }
template <typename GfxFamily> template <typename GfxFamily>
void BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForBufferPerRow(const BlitProperties &blitProperties, LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment) { void BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForBufferPerRow(const BlitProperties &blitProperties, LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs) {
uint64_t width = 1; uint64_t width = 1;
uint64_t height = 1; uint64_t height = 1;
PRINT_DEBUG_STRING(debugManager.flags.PrintBlitDispatchDetails.get(), stdout, PRINT_DEBUG_STRING(debugManager.flags.PrintBlitDispatchDetails.get(), stdout,
"\nBlit dispatch with AuxTranslationDirection %u ", static_cast<uint32_t>(blitProperties.auxTranslationDirection)); "\nBlit dispatch with AuxTranslationDirection %u ", static_cast<uint32_t>(blitProperties.auxTranslationDirection));
dispatchPreBlitCommand(linearStream, rootDeviceEnvironment); dispatchPreBlitCommand(linearStream, *waArgs.rootDeviceEnvironment);
auto bltCmd = GfxFamily::cmdInitXyCopyBlt; auto bltCmd = GfxFamily::cmdInitXyCopyBlt;
const auto maxWidth = getMaxBlitWidth(rootDeviceEnvironment); const auto maxWidth = getMaxBlitWidth(*waArgs.rootDeviceEnvironment);
const auto maxHeight = getMaxBlitHeight(rootDeviceEnvironment, blitProperties.isSystemMemoryPoolUsed); const auto maxHeight = getMaxBlitHeight(*waArgs.rootDeviceEnvironment, blitProperties.isSystemMemoryPoolUsed);
appendColorDepth(blitProperties, bltCmd); appendColorDepth(blitProperties, bltCmd);
@@ -236,12 +237,13 @@ void BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForBufferPerRow(const Bl
bltCmd.setDestinationBaseAddress(dstAddr); bltCmd.setDestinationBaseAddress(dstAddr);
bltCmd.setSourceBaseAddress(srcAddr); bltCmd.setSourceBaseAddress(srcAddr);
appendBlitCommandsForBuffer(blitProperties, bltCmd, rootDeviceEnvironment); appendBlitCommandsForBuffer(blitProperties, bltCmd, *waArgs.rootDeviceEnvironment);
auto bltStream = linearStream.getSpaceForCmd<typename GfxFamily::XY_COPY_BLT>(); auto bltStream = linearStream.getSpaceForCmd<typename GfxFamily::XY_COPY_BLT>();
*bltStream = bltCmd; *bltStream = bltCmd;
dispatchPostBlitCommand(linearStream, rootDeviceEnvironment); waArgs.isWaRequired = true;
dispatchPostBlitCommand(linearStream, waArgs);
auto blitSize = width * height; auto blitSize = width * height;
sizeToBlit -= blitSize; sizeToBlit -= blitSize;
@@ -253,9 +255,10 @@ void BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForBufferPerRow(const Bl
template <typename GfxFamily> template <typename GfxFamily>
template <size_t patternSize> template <size_t patternSize>
void BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, LinearStream &linearStream, size_t size, RootDeviceEnvironment &rootDeviceEnvironment, COLOR_DEPTH depth) { void BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, LinearStream &linearStream, size_t size, EncodeDummyBlitWaArgs &waArgs, COLOR_DEPTH depth) {
using XY_COLOR_BLT = typename GfxFamily::XY_COLOR_BLT; using XY_COLOR_BLT = typename GfxFamily::XY_COLOR_BLT;
auto blitCmd = GfxFamily::cmdInitXyColorBlt; auto blitCmd = GfxFamily::cmdInitXyColorBlt;
auto &rootDeviceEnvironment = *waArgs.rootDeviceEnvironment;
const auto maxWidth = getMaxBlitWidth(rootDeviceEnvironment); const auto maxWidth = getMaxBlitWidth(rootDeviceEnvironment);
const auto maxHeight = getMaxBlitHeight(rootDeviceEnvironment, true); const auto maxHeight = getMaxBlitHeight(rootDeviceEnvironment, true);
@@ -286,6 +289,7 @@ void BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill(NEO::GraphicsAllocati
auto cmd = linearStream.getSpaceForCmd<XY_COLOR_BLT>(); auto cmd = linearStream.getSpaceForCmd<XY_COLOR_BLT>();
*cmd = tmpCmd; *cmd = tmpCmd;
waArgs.isWaRequired = true;
auto blitSize = width * height; auto blitSize = width * height;
offset += (blitSize * patternSize); offset += (blitSize * patternSize);
sizeToFill -= blitSize; sizeToFill -= blitSize;
@@ -293,7 +297,7 @@ void BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill(NEO::GraphicsAllocati
} }
template <typename GfxFamily> template <typename GfxFamily>
void BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForImageRegion(const BlitProperties &blitProperties, LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment) { void BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForImageRegion(const BlitProperties &blitProperties, LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs) {
auto srcSlicePitch = static_cast<uint32_t>(blitProperties.srcSlicePitch); auto srcSlicePitch = static_cast<uint32_t>(blitProperties.srcSlicePitch);
auto dstSlicePitch = static_cast<uint32_t>(blitProperties.dstSlicePitch); auto dstSlicePitch = static_cast<uint32_t>(blitProperties.dstSlicePitch);
@@ -312,14 +316,14 @@ void BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForImageRegion(const Bli
bltCmd.setSourceX1CoordinateLeft(static_cast<uint32_t>(blitProperties.srcOffset.x)); bltCmd.setSourceX1CoordinateLeft(static_cast<uint32_t>(blitProperties.srcOffset.x));
bltCmd.setSourceY1CoordinateTop(static_cast<uint32_t>(blitProperties.srcOffset.y)); bltCmd.setSourceY1CoordinateTop(static_cast<uint32_t>(blitProperties.srcOffset.y));
appendBlitCommandsBlockCopy(blitProperties, bltCmd, rootDeviceEnvironment); appendBlitCommandsBlockCopy(blitProperties, bltCmd, *(waArgs.rootDeviceEnvironment));
appendBlitCommandsForImages(blitProperties, bltCmd, rootDeviceEnvironment, srcSlicePitch, dstSlicePitch); appendBlitCommandsForImages(blitProperties, bltCmd, *(waArgs.rootDeviceEnvironment), srcSlicePitch, dstSlicePitch);
appendColorDepth(blitProperties, bltCmd); appendColorDepth(blitProperties, bltCmd);
appendSurfaceType(blitProperties, bltCmd); appendSurfaceType(blitProperties, bltCmd);
dispatchPreBlitCommand(linearStream, rootDeviceEnvironment); dispatchPreBlitCommand(linearStream, *(waArgs.rootDeviceEnvironment));
for (uint32_t i = 0; i < blitProperties.copySize.z; i++) { for (uint32_t i = 0; i < blitProperties.copySize.z; i++) {
appendSliceOffsets(blitProperties, bltCmd, i, rootDeviceEnvironment, srcSlicePitch, dstSlicePitch); appendSliceOffsets(blitProperties, bltCmd, i, *(waArgs.rootDeviceEnvironment), srcSlicePitch, dstSlicePitch);
if (debugManager.flags.PrintImageBlitBlockCopyCmdDetails.get()) { if (debugManager.flags.PrintImageBlitBlockCopyCmdDetails.get()) {
printImageBlitBlockCopyCommand(bltCmd, i); printImageBlitBlockCopyCommand(bltCmd, i);
@@ -327,7 +331,8 @@ void BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForImageRegion(const Bli
auto cmd = linearStream.getSpaceForCmd<typename GfxFamily::XY_BLOCK_COPY_BLT>(); auto cmd = linearStream.getSpaceForCmd<typename GfxFamily::XY_BLOCK_COPY_BLT>();
*cmd = bltCmd; *cmd = bltCmd;
dispatchPostBlitCommand(linearStream, rootDeviceEnvironment); waArgs.isWaRequired = true;
dispatchPostBlitCommand(linearStream, waArgs);
} }
} }
@@ -368,13 +373,13 @@ uint32_t BlitCommandsHelper<GfxFamily>::getAvailableBytesPerPixel(size_t copySiz
} }
template <typename GfxFamily> template <typename GfxFamily>
void BlitCommandsHelper<GfxFamily>::dispatchBlitCommands(const BlitProperties &blitProperties, LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment) { void BlitCommandsHelper<GfxFamily>::dispatchBlitCommands(const BlitProperties &blitProperties, LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs) {
if (blitProperties.isImageOperation()) { if (blitProperties.isImageOperation()) {
dispatchBlitCommandsForImageRegion(blitProperties, linearStream, rootDeviceEnvironment); dispatchBlitCommandsForImageRegion(blitProperties, linearStream, waArgs);
} else { } else {
bool preferCopyBufferRegion = isCopyRegionPreferred(blitProperties.copySize, rootDeviceEnvironment, blitProperties.isSystemMemoryPoolUsed); bool preferCopyBufferRegion = isCopyRegionPreferred(blitProperties.copySize, *waArgs.rootDeviceEnvironment, blitProperties.isSystemMemoryPoolUsed);
preferCopyBufferRegion ? dispatchBlitCommandsForBufferRegion(blitProperties, linearStream, rootDeviceEnvironment) preferCopyBufferRegion ? dispatchBlitCommandsForBufferRegion(blitProperties, linearStream, waArgs)
: dispatchBlitCommandsForBufferPerRow(blitProperties, linearStream, rootDeviceEnvironment); : dispatchBlitCommandsForBufferPerRow(blitProperties, linearStream, waArgs);
} }
} }
@@ -404,12 +409,12 @@ void BlitCommandsHelper<GfxFamily>::appendBlitCommandsMemCopy(const BlitProperti
} }
template <typename GfxFamily> template <typename GfxFamily>
void BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForBufferRegion(const BlitProperties &blitProperties, LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment) { void BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForBufferRegion(const BlitProperties &blitProperties, LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs) {
const auto maxWidthToCopy = getMaxBlitWidth(rootDeviceEnvironment); const auto maxWidthToCopy = getMaxBlitWidth(*waArgs.rootDeviceEnvironment);
const auto maxHeightToCopy = getMaxBlitHeight(rootDeviceEnvironment, blitProperties.isSystemMemoryPoolUsed); const auto maxHeightToCopy = getMaxBlitHeight(*waArgs.rootDeviceEnvironment, blitProperties.isSystemMemoryPoolUsed);
dispatchPreBlitCommand(linearStream, rootDeviceEnvironment); dispatchPreBlitCommand(linearStream, *waArgs.rootDeviceEnvironment);
auto bltCmd = GfxFamily::cmdInitXyCopyBlt; auto bltCmd = GfxFamily::cmdInitXyCopyBlt;
bltCmd.setSourcePitch(static_cast<uint32_t>(blitProperties.srcRowPitch)); bltCmd.setSourcePitch(static_cast<uint32_t>(blitProperties.srcRowPitch));
@@ -433,12 +438,13 @@ void BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForBufferRegion(const Bl
bltCmd.setDestinationX2CoordinateRight(width); bltCmd.setDestinationX2CoordinateRight(width);
bltCmd.setDestinationY2CoordinateBottom(height); bltCmd.setDestinationY2CoordinateBottom(height);
appendBlitCommandsForBuffer(blitProperties, bltCmd, rootDeviceEnvironment); appendBlitCommandsForBuffer(blitProperties, bltCmd, *waArgs.rootDeviceEnvironment);
auto cmd = linearStream.getSpaceForCmd<typename GfxFamily::XY_COPY_BLT>(); auto cmd = linearStream.getSpaceForCmd<typename GfxFamily::XY_COPY_BLT>();
*cmd = bltCmd; *cmd = bltCmd;
waArgs.isWaRequired = true;
dispatchPostBlitCommand(linearStream, rootDeviceEnvironment); dispatchPostBlitCommand(linearStream, waArgs);
srcAddress += width; srcAddress += width;
dstAddress += width; dstAddress += width;

View File

@@ -39,16 +39,16 @@ void BlitCommandsHelper<GfxFamily>::appendBlitCommandsForFillBuffer(NEO::Graphic
} }
template <typename GfxFamily> template <typename GfxFamily>
void BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryColorFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, size_t patternSize, LinearStream &linearStream, size_t size, RootDeviceEnvironment &rootDeviceEnvironment) { void BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryColorFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, size_t patternSize, LinearStream &linearStream, size_t size, EncodeDummyBlitWaArgs &waArgs) {
switch (patternSize) { switch (patternSize) {
case 1: case 1:
NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill<1>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_8_BIT_COLOR); NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill<1>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_8_BIT_COLOR);
break; break;
case 2: case 2:
NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill<2>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_16_BIT_COLOR1555); NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill<2>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_16_BIT_COLOR1555);
break; break;
default: default:
NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill<4>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_32_BIT_COLOR); NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill<4>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_32_BIT_COLOR);
} }
} }

View File

@@ -76,22 +76,22 @@ void BlitCommandsHelper<GfxFamily>::appendBlitCommandsForFillBuffer(NEO::Graphic
} }
template <typename GfxFamily> template <typename GfxFamily>
void BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryColorFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, size_t patternSize, LinearStream &linearStream, size_t size, RootDeviceEnvironment &rootDeviceEnvironment) { void BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryColorFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, size_t patternSize, LinearStream &linearStream, size_t size, EncodeDummyBlitWaArgs &waArgs) {
switch (patternSize) { switch (patternSize) {
case 1: case 1:
NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill<1>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_8_BIT_COLOR); NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill<1>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_8_BIT_COLOR);
break; break;
case 2: case 2:
NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill<2>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_16_BIT_COLOR); NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill<2>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_16_BIT_COLOR);
break; break;
case 4: case 4:
NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill<4>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_32_BIT_COLOR); NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill<4>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_32_BIT_COLOR);
break; break;
case 8: case 8:
NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill<8>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_64_BIT_COLOR); NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill<8>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_64_BIT_COLOR);
break; break;
default: default:
NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill<16>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_128_BIT_COLOR); NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill<16>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_128_BIT_COLOR);
} }
} }
@@ -390,6 +390,7 @@ void BlitCommandsHelper<GfxFamily>::dispatchDummyBlit(LinearStream &linearStream
auto cmd = linearStream.getSpaceForCmd<XY_COLOR_BLT>(); auto cmd = linearStream.getSpaceForCmd<XY_COLOR_BLT>();
*cmd = blitCmd; *cmd = blitCmd;
waArgs.isWaRequired = false;
} }
} }

View File

@@ -136,9 +136,10 @@ void BlitCommandsHelper<Family>::appendBlitCommandsMemCopy(const BlitProperties
template <> template <>
template <> template <>
void BlitCommandsHelper<Family>::dispatchBlitMemoryFill<1>(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, LinearStream &linearStream, size_t size, RootDeviceEnvironment &rootDeviceEnvironment, COLOR_DEPTH depth) { void BlitCommandsHelper<Family>::dispatchBlitMemoryFill<1>(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, LinearStream &linearStream, size_t size, EncodeDummyBlitWaArgs &waArgs, COLOR_DEPTH depth) {
using MEM_SET = typename Family::MEM_SET; using MEM_SET = typename Family::MEM_SET;
auto blitCmd = Family::cmdInitMemSet; auto blitCmd = Family::cmdInitMemSet;
auto &rootDeviceEnvironment = *waArgs.rootDeviceEnvironment;
auto mocs = rootDeviceEnvironment.getGmmHelper()->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER); auto mocs = rootDeviceEnvironment.getGmmHelper()->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER);
if (debugManager.flags.OverrideBlitterMocs.get() != -1) { if (debugManager.flags.OverrideBlitterMocs.get() != -1) {
@@ -293,6 +294,7 @@ void BlitCommandsHelper<Family>::dispatchDummyBlit(LinearStream &linearStream, E
auto cmd = linearStream.getSpaceForCmd<MEM_SET>(); auto cmd = linearStream.getSpaceForCmd<MEM_SET>();
*cmd = blitCmd; *cmd = blitCmd;
waArgs.isWaRequired = false;
} }
} }

View File

@@ -154,7 +154,7 @@ HWTEST_F(BlitTests, givenDebugVariablesWhenGettingMaxBlitSizeThenHonorUseProvide
} }
HWTEST_F(BlitTests, givenDebugVariableWhenEstimatingPostBlitsCommandSizeThenReturnCorrectResult) { HWTEST_F(BlitTests, givenDebugVariableWhenEstimatingPostBlitsCommandSizeThenReturnCorrectResult) {
EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())}; EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())};
DebugManagerStateRestore restore{}; DebugManagerStateRestore restore{};
size_t arbCheckSize = EncodeMiArbCheck<FamilyType>::getCommandSize(); size_t arbCheckSize = EncodeMiArbCheck<FamilyType>::getCommandSize();
@@ -164,16 +164,17 @@ HWTEST_F(BlitTests, givenDebugVariableWhenEstimatingPostBlitsCommandSizeThenRetu
expectedDefaultSize += EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs); expectedDefaultSize += EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs);
} }
EXPECT_EQ(expectedDefaultSize, BlitCommandsHelper<FamilyType>::estimatePostBlitCommandSize()); EXPECT_EQ(expectedDefaultSize, BlitCommandsHelper<FamilyType>::estimatePostBlitCommandSize(pDevice->getRootDeviceEnvironment()));
debugManager.flags.PostBlitCommand.set(BlitterConstants::PostBlitMode::miArbCheck); debugManager.flags.PostBlitCommand.set(BlitterConstants::PostBlitMode::miArbCheck);
EXPECT_EQ(arbCheckSize, BlitCommandsHelper<FamilyType>::estimatePostBlitCommandSize()); EXPECT_EQ(arbCheckSize, BlitCommandsHelper<FamilyType>::estimatePostBlitCommandSize(pDevice->getRootDeviceEnvironment()));
debugManager.flags.PostBlitCommand.set(BlitterConstants::PostBlitMode::miFlush); debugManager.flags.PostBlitCommand.set(BlitterConstants::PostBlitMode::miFlush);
EXPECT_EQ(EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs), BlitCommandsHelper<FamilyType>::estimatePostBlitCommandSize()); waArgs.isWaRequired = true;
EXPECT_EQ(EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs), BlitCommandsHelper<FamilyType>::estimatePostBlitCommandSize(pDevice->getRootDeviceEnvironment()));
debugManager.flags.PostBlitCommand.set(BlitterConstants::PostBlitMode::none); debugManager.flags.PostBlitCommand.set(BlitterConstants::PostBlitMode::none);
EXPECT_EQ(0u, BlitCommandsHelper<FamilyType>::estimatePostBlitCommandSize()); EXPECT_EQ(0u, BlitCommandsHelper<FamilyType>::estimatePostBlitCommandSize(pDevice->getRootDeviceEnvironment()));
} }
HWTEST_F(BlitTests, givenDebugVariableWhenDispatchingPostBlitsCommandThenUseCorrectCommands) { HWTEST_F(BlitTests, givenDebugVariableWhenDispatchingPostBlitsCommandThenUseCorrectCommands) {
@@ -183,8 +184,7 @@ HWTEST_F(BlitTests, givenDebugVariableWhenDispatchingPostBlitsCommandThenUseCorr
uint32_t streamBuffer[100] = {}; uint32_t streamBuffer[100] = {};
LinearStream linearStream{streamBuffer, sizeof(streamBuffer)}; LinearStream linearStream{streamBuffer, sizeof(streamBuffer)};
GenCmdList commands{}; GenCmdList commands{};
auto &rootDeviceEnvironment = pDevice->getRootDeviceEnvironmentRef(); EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())};
EncodeDummyBlitWaArgs waArgs{false, &rootDeviceEnvironment};
size_t expectedDefaultSize = EncodeMiArbCheck<FamilyType>::getCommandSize() + BlitCommandsHelper<FamilyType>::getDummyBlitSize(waArgs); size_t expectedDefaultSize = EncodeMiArbCheck<FamilyType>::getCommandSize() + BlitCommandsHelper<FamilyType>::getDummyBlitSize(waArgs);
if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) { if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired()) {
@@ -192,7 +192,7 @@ HWTEST_F(BlitTests, givenDebugVariableWhenDispatchingPostBlitsCommandThenUseCorr
} }
// -1: default // -1: default
BlitCommandsHelper<FamilyType>::dispatchPostBlitCommand(linearStream, rootDeviceEnvironment); BlitCommandsHelper<FamilyType>::dispatchPostBlitCommand(linearStream, waArgs);
EXPECT_EQ(expectedDefaultSize, linearStream.getUsed()); EXPECT_EQ(expectedDefaultSize, linearStream.getUsed());
CmdParse<FamilyType>::parseCommandBuffer(commands, linearStream.getCpuBase(), linearStream.getUsed()); CmdParse<FamilyType>::parseCommandBuffer(commands, linearStream.getCpuBase(), linearStream.getUsed());
@@ -216,7 +216,7 @@ HWTEST_F(BlitTests, givenDebugVariableWhenDispatchingPostBlitsCommandThenUseCorr
commands.clear(); commands.clear();
debugManager.flags.PostBlitCommand.set(BlitterConstants::PostBlitMode::miArbCheck); debugManager.flags.PostBlitCommand.set(BlitterConstants::PostBlitMode::miArbCheck);
waArgs.isWaRequired = true; waArgs.isWaRequired = true;
BlitCommandsHelper<FamilyType>::dispatchPostBlitCommand(linearStream, rootDeviceEnvironment); BlitCommandsHelper<FamilyType>::dispatchPostBlitCommand(linearStream, waArgs);
CmdParse<FamilyType>::parseCommandBuffer(commands, linearStream.getCpuBase(), linearStream.getUsed()); CmdParse<FamilyType>::parseCommandBuffer(commands, linearStream.getCpuBase(), linearStream.getUsed());
arbCheck = find<MI_ARB_CHECK *>(commands.begin(), commands.end()); arbCheck = find<MI_ARB_CHECK *>(commands.begin(), commands.end());
@@ -228,7 +228,7 @@ HWTEST_F(BlitTests, givenDebugVariableWhenDispatchingPostBlitsCommandThenUseCorr
commands.clear(); commands.clear();
debugManager.flags.PostBlitCommand.set(BlitterConstants::PostBlitMode::miFlush); debugManager.flags.PostBlitCommand.set(BlitterConstants::PostBlitMode::miFlush);
waArgs.isWaRequired = true; waArgs.isWaRequired = true;
BlitCommandsHelper<FamilyType>::dispatchPostBlitCommand(linearStream, rootDeviceEnvironment); BlitCommandsHelper<FamilyType>::dispatchPostBlitCommand(linearStream, waArgs);
CmdParse<FamilyType>::parseCommandBuffer(commands, linearStream.getCpuBase(), linearStream.getUsed()); CmdParse<FamilyType>::parseCommandBuffer(commands, linearStream.getCpuBase(), linearStream.getUsed());
auto miFlush = find<MI_FLUSH_DW *>(commands.begin(), commands.end()); auto miFlush = find<MI_FLUSH_DW *>(commands.begin(), commands.end());
@@ -240,7 +240,7 @@ HWTEST_F(BlitTests, givenDebugVariableWhenDispatchingPostBlitsCommandThenUseCorr
commands.clear(); commands.clear();
debugManager.flags.PostBlitCommand.set(BlitterConstants::PostBlitMode::none); debugManager.flags.PostBlitCommand.set(BlitterConstants::PostBlitMode::none);
waArgs.isWaRequired = true; waArgs.isWaRequired = true;
BlitCommandsHelper<FamilyType>::dispatchPostBlitCommand(linearStream, rootDeviceEnvironment); BlitCommandsHelper<FamilyType>::dispatchPostBlitCommand(linearStream, waArgs);
EXPECT_EQ(0u, linearStream.getUsed()); EXPECT_EQ(0u, linearStream.getUsed());
} }
@@ -254,7 +254,8 @@ HWTEST_F(BlitTests, givenMemoryWhenFillPatternWithBlitThenCommandIsProgrammed) {
MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t), reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::system4KBPages, MemoryManager::maxOsContextCount); MemoryPool::system4KBPages, MemoryManager::maxOsContextCount);
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), pDevice->getRootDeviceEnvironmentRef()); EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()};
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), waArgs);
GenCmdList cmdList; GenCmdList cmdList;
ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer(
cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed()));
@@ -272,7 +273,8 @@ HWTEST_F(BlitTests, givenMemorySizeBiggerThanMaxWidthButLessThanTwiceMaxWidthWhe
reinterpret_cast<void *>(0x1234), 0x1000, 0, (2 * BlitterConstants::maxBlitWidth) - 1, reinterpret_cast<void *>(0x1234), 0x1000, 0, (2 * BlitterConstants::maxBlitWidth) - 1,
MemoryPool::system4KBPages, MemoryManager::maxOsContextCount); MemoryPool::system4KBPages, MemoryManager::maxOsContextCount);
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), pDevice->getRootDeviceEnvironmentRef()); EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()};
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), waArgs);
GenCmdList cmdList; GenCmdList cmdList;
ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer(
cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed()));
@@ -293,7 +295,8 @@ HWTEST_F(BlitTests, givenMemoryPointerOffsetVerifyCorrectDestinationBaseAddress)
MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t), reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::system4KBPages, MemoryManager::maxOsContextCount); MemoryPool::system4KBPages, MemoryManager::maxOsContextCount);
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0x234, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), pDevice->getRootDeviceEnvironmentRef()); EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()};
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0x234, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), waArgs);
GenCmdList cmdList; GenCmdList cmdList;
ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer(
cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed()));
@@ -320,7 +323,8 @@ HWTEST_F(BlitTests, givenMemorySizeTwiceBiggerThanMaxWidthWhenFillPatternWithBli
MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory,
reinterpret_cast<void *>(0x1234), 0x1000, 0, (2 * BlitterConstants::maxBlitWidth * sizeof(uint32_t)), reinterpret_cast<void *>(0x1234), 0x1000, 0, (2 * BlitterConstants::maxBlitWidth * sizeof(uint32_t)),
MemoryPool::system4KBPages, MemoryManager::maxOsContextCount); MemoryPool::system4KBPages, MemoryManager::maxOsContextCount);
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), pDevice->getRootDeviceEnvironmentRef()); EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()};
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), waArgs);
GenCmdList cmdList; GenCmdList cmdList;
ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer(
cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed()));
@@ -348,7 +352,8 @@ HWTEST_F(BlitTests, givenMemorySizeIsLessThanTwicenMaxWidthWhenFillPatternWithBl
MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory,
reinterpret_cast<void *>(0x1234), 0x1000, 0, ((BlitterConstants::maxBlitWidth + 1) * sizeof(uint32_t)), reinterpret_cast<void *>(0x1234), 0x1000, 0, ((BlitterConstants::maxBlitWidth + 1) * sizeof(uint32_t)),
MemoryPool::system4KBPages, MemoryManager::maxOsContextCount); MemoryPool::system4KBPages, MemoryManager::maxOsContextCount);
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), pDevice->getRootDeviceEnvironmentRef()); EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()};
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), waArgs);
GenCmdList cmdList; GenCmdList cmdList;
ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer(
cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed()));
@@ -390,7 +395,8 @@ HWTEST2_F(BlitTests, givenMemoryWhenFillPatternSizeIs4BytesThen32BitMaskISSetCor
MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t), reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::system4KBPages, MemoryManager::maxOsContextCount); MemoryPool::system4KBPages, MemoryManager::maxOsContextCount);
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), pDevice->getRootDeviceEnvironmentRef()); EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()};
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), waArgs);
GenCmdList cmdList; GenCmdList cmdList;
ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer(
cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed()));
@@ -508,7 +514,8 @@ HWTEST2_F(BlitTests, givenMemoryAndImageWhenDispatchCopyImageCallThenCommandAdde
blitProperties.bytesPerPixel = 4; blitProperties.bytesPerPixel = 4;
blitProperties.srcSize = srcSize; blitProperties.srcSize = srcSize;
blitProperties.dstSize = dstSize; blitProperties.dstSize = dstSize;
NEO::BlitCommandsHelper<FamilyType>::dispatchBlitCommandsForImageRegion(blitProperties, stream, pDevice->getRootDeviceEnvironmentRef()); EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())};
NEO::BlitCommandsHelper<FamilyType>::dispatchBlitCommandsForImageRegion(blitProperties, stream, waArgs);
GenCmdList cmdList; GenCmdList cmdList;
ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer(
cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed()));
@@ -661,13 +668,13 @@ HWTEST2_F(BlitTests, givenPlatformWhenCallingPreBlitCommandWARequiredThenReturns
HWTEST2_F(BlitTests, givenPlatformWhenCallingEstimatePreBlitCommandSizeThenZeroIsReturned, WithoutGen12Lp) { HWTEST2_F(BlitTests, givenPlatformWhenCallingEstimatePreBlitCommandSizeThenZeroIsReturned, WithoutGen12Lp) {
using MI_FLUSH_DW = typename FamilyType::MI_FLUSH_DW; using MI_FLUSH_DW = typename FamilyType::MI_FLUSH_DW;
EXPECT_EQ(0u, BlitCommandsHelper<FamilyType>::estimatePreBlitCommandSize()); EXPECT_EQ(0u, BlitCommandsHelper<FamilyType>::estimatePreBlitCommandSize(pDevice->getRootDeviceEnvironmentRef()));
} }
HWTEST2_F(BlitTests, givenPlatformWhenCallingDispatchPreBlitCommandThenNoneMiFlushDwIsProgramed, WithoutGen12Lp) { HWTEST2_F(BlitTests, givenPlatformWhenCallingDispatchPreBlitCommandThenNoneMiFlushDwIsProgramed, WithoutGen12Lp) {
using MI_FLUSH_DW = typename FamilyType::MI_FLUSH_DW; using MI_FLUSH_DW = typename FamilyType::MI_FLUSH_DW;
auto miFlushBuffer = std::make_unique<MI_FLUSH_DW>(); auto miFlushBuffer = std::make_unique<MI_FLUSH_DW>();
EncodeDummyBlitWaArgs waArgs{true, &pDevice->getRootDeviceEnvironmentRef()}; EncodeDummyBlitWaArgs waArgs{true, const_cast<RootDeviceEnvironment *>(&pDevice->getRootDeviceEnvironment())};
LinearStream linearStream(miFlushBuffer.get(), EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs)); LinearStream linearStream(miFlushBuffer.get(), EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs));
BlitCommandsHelper<FamilyType>::dispatchPreBlitCommand(linearStream, *waArgs.rootDeviceEnvironment); BlitCommandsHelper<FamilyType>::dispatchPreBlitCommand(linearStream, *waArgs.rootDeviceEnvironment);

View File

@@ -52,7 +52,8 @@ class GivenLinearStreamWhenCallDispatchBlitMemoryColorFillThenCorrectDepthIsProg
canonizedGpuAddress); canonizedGpuAddress);
uint32_t patternToCommand[4]; uint32_t patternToCommand[4];
memset(patternToCommand, 4, patternSize); memset(patternToCommand, 4, patternSize);
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, patternToCommand, patternSize, stream, mockAllocation.getUnderlyingBufferSize(), device->getRootDeviceEnvironmentRef()); EncodeDummyBlitWaArgs waArgs{false, &(device->getRootDeviceEnvironmentRef())};
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, patternToCommand, patternSize, stream, mockAllocation.getUnderlyingBufferSize(), waArgs);
GenCmdList cmdList; GenCmdList cmdList;
ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer(
cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed()));

View File

@@ -251,8 +251,8 @@ HWTEST2_F(BlitTests, givenGen12LpPlatformWhenPreBlitCommandWARequiredThenReturns
HWTEST2_F(BlitTests, givenGen12LpPlatformWhenEstimatePreBlitCommandSizeThenSizeOfFlushIsReturned, IsGen12LP) { HWTEST2_F(BlitTests, givenGen12LpPlatformWhenEstimatePreBlitCommandSizeThenSizeOfFlushIsReturned, IsGen12LP) {
using MI_FLUSH_DW = typename FamilyType::MI_FLUSH_DW; using MI_FLUSH_DW = typename FamilyType::MI_FLUSH_DW;
EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())}; EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())};
EXPECT_EQ(EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs), BlitCommandsHelper<FamilyType>::estimatePreBlitCommandSize()); EXPECT_EQ(EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs), BlitCommandsHelper<FamilyType>::estimatePreBlitCommandSize(pDevice->getRootDeviceEnvironmentRef()));
} }
HWTEST2_F(BlitTests, givenGen12LpPlatformWhenDispatchPreBlitCommandThenMiFlushDwIsProgramed, IsGen12LP) { HWTEST2_F(BlitTests, givenGen12LpPlatformWhenDispatchPreBlitCommandThenMiFlushDwIsProgramed, IsGen12LP) {
@@ -261,7 +261,7 @@ HWTEST2_F(BlitTests, givenGen12LpPlatformWhenDispatchPreBlitCommandThenMiFlushDw
EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())}; EncodeDummyBlitWaArgs waArgs{true, &(pDevice->getRootDeviceEnvironmentRef())};
LinearStream linearStream(miFlushBuffer.get(), EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs)); LinearStream linearStream(miFlushBuffer.get(), EncodeMiFlushDW<FamilyType>::getCommandSizeWithWa(waArgs));
BlitCommandsHelper<FamilyType>::dispatchPreBlitCommand(linearStream, *waArgs.rootDeviceEnvironment); BlitCommandsHelper<FamilyType>::dispatchPreBlitCommand(linearStream, *(&pDevice->getRootDeviceEnvironmentRef()));
HardwareParse hwParser; HardwareParse hwParser;
hwParser.parseCommands<FamilyType>(linearStream); hwParser.parseCommands<FamilyType>(linearStream);

View File

@@ -25,7 +25,8 @@ HWTEST2_F(BlitTests, givenOneBytePatternWhenFillPatternWithBlitThenCommandIsProg
MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t), reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::system4KBPages, MemoryManager::maxOsContextCount); MemoryPool::system4KBPages, MemoryManager::maxOsContextCount);
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), pDevice->getRootDeviceEnvironmentRef()); EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()};
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), waArgs);
GenCmdList cmdList; GenCmdList cmdList;
ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer(
cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed()));
@@ -41,7 +42,8 @@ HWTEST2_F(BlitTests, givenDeviceWithoutDefaultGmmWhenAppendBlitCommandsForVillBu
MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t), reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::system4KBPages, MemoryManager::maxOsContextCount); MemoryPool::system4KBPages, MemoryManager::maxOsContextCount);
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), pDevice->getRootDeviceEnvironmentRef()); EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()};
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), waArgs);
GenCmdList cmdList; GenCmdList cmdList;
ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer(
cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed()));
@@ -65,7 +67,8 @@ HWTEST2_F(BlitTests, givenGmmWithDisabledCompresionWhenAppendBlitCommandsForVill
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t), reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::system4KBPages, MemoryManager::maxOsContextCount); MemoryPool::system4KBPages, MemoryManager::maxOsContextCount);
mockAllocation.setGmm(gmm.get(), 0u); mockAllocation.setGmm(gmm.get(), 0u);
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), pDevice->getRootDeviceEnvironmentRef()); EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()};
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), waArgs);
GenCmdList cmdList; GenCmdList cmdList;
ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer(
cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed()));
@@ -89,8 +92,9 @@ HWTEST2_F(BlitTests, givenGmmWithEnabledCompresionWhenAppendBlitCommandsForVillB
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t), reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::system4KBPages, MemoryManager::maxOsContextCount); MemoryPool::system4KBPages, MemoryManager::maxOsContextCount);
mockAllocation.setGmm(gmm.get(), 0u); mockAllocation.setGmm(gmm.get(), 0u);
auto &rootDeviceEnvironment = pDevice->getRootDeviceEnvironmentRef(); const auto &rootDeviceEnvironment = pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()];
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), rootDeviceEnvironment); EncodeDummyBlitWaArgs waArgs{false, const_cast<RootDeviceEnvironment *>(rootDeviceEnvironment.get())};
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), waArgs);
GenCmdList cmdList; GenCmdList cmdList;
ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer(
cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed()));
@@ -101,7 +105,7 @@ HWTEST2_F(BlitTests, givenGmmWithEnabledCompresionWhenAppendBlitCommandsForVillB
EXPECT_EQ(blitCmd->getDestinationCompressible(), MEM_SET::DESTINATION_COMPRESSIBLE::DESTINATION_COMPRESSIBLE_COMPRESSIBLE); EXPECT_EQ(blitCmd->getDestinationCompressible(), MEM_SET::DESTINATION_COMPRESSIBLE::DESTINATION_COMPRESSIBLE_COMPRESSIBLE);
auto resourceFormat = gmm->gmmResourceInfo->getResourceFormat(); auto resourceFormat = gmm->gmmResourceInfo->getResourceFormat();
auto compressionFormat = rootDeviceEnvironment.getGmmClientContext()->getSurfaceStateCompressionFormat(resourceFormat); auto compressionFormat = rootDeviceEnvironment->getGmmClientContext()->getSurfaceStateCompressionFormat(resourceFormat);
EXPECT_EQ(compressionFormat, blitCmd->getCompressionFormat40()); EXPECT_EQ(compressionFormat, blitCmd->getCompressionFormat40());
} }
} }
@@ -118,7 +122,8 @@ HWTEST2_F(BlitTests, givenOverridedMocksValueWhenAppendBlitCommandsForVillBuffer
MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t), reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::system4KBPages, MemoryManager::maxOsContextCount); MemoryPool::system4KBPages, MemoryManager::maxOsContextCount);
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), pDevice->getRootDeviceEnvironmentRef()); EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()};
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), waArgs);
GenCmdList cmdList; GenCmdList cmdList;
ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer(
cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed()));
@@ -141,7 +146,8 @@ HWTEST2_F(BlitTests, givenEnableStatelessCompressionWithUnifiedMemoryAndSystemMe
MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t), reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::system4KBPages, MemoryManager::maxOsContextCount); MemoryPool::system4KBPages, MemoryManager::maxOsContextCount);
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), pDevice->getRootDeviceEnvironmentRef()); EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()};
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), waArgs);
GenCmdList cmdList; GenCmdList cmdList;
ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer(
cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed()));
@@ -172,7 +178,8 @@ HWTEST2_F(BlitTests, givenEnableStatelessCompressionWithUnifiedMemoryAndLocalMem
MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory,
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t), reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
MemoryPool::localMemory, MemoryManager::maxOsContextCount); MemoryPool::localMemory, MemoryManager::maxOsContextCount);
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), pDevice->getRootDeviceEnvironmentRef()); EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()};
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), waArgs);
GenCmdList cmdList; GenCmdList cmdList;
ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer(
cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed()));
@@ -193,7 +200,8 @@ HWTEST2_F(BlitTests, givenMemorySizeBiggerThanMaxWidthButLessThanTwiceMaxWidthWh
MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory,
reinterpret_cast<void *>(0x1234), 0x1000, 0, (2 * BlitterConstants::maxBlitSetWidth) - 1, reinterpret_cast<void *>(0x1234), 0x1000, 0, (2 * BlitterConstants::maxBlitSetWidth) - 1,
MemoryPool::system4KBPages, MemoryManager::maxOsContextCount); MemoryPool::system4KBPages, MemoryManager::maxOsContextCount);
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), pDevice->getRootDeviceEnvironmentRef()); EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()};
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), waArgs);
GenCmdList cmdList; GenCmdList cmdList;
ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer(
cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed()));
@@ -213,7 +221,8 @@ HWTEST2_F(BlitTests, givenMemorySizeTwiceBiggerThanMaxWidthWhenFillPatternWithBl
MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory, MockGraphicsAllocation mockAllocation(0, AllocationType::internalHostMemory,
reinterpret_cast<void *>(0x1234), 0x1000, 0, (2 * BlitterConstants::maxBlitSetWidth), reinterpret_cast<void *>(0x1234), 0x1000, 0, (2 * BlitterConstants::maxBlitSetWidth),
MemoryPool::system4KBPages, MemoryManager::maxOsContextCount); MemoryPool::system4KBPages, MemoryManager::maxOsContextCount);
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), pDevice->getRootDeviceEnvironmentRef()); EncodeDummyBlitWaArgs waArgs{false, pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()].get()};
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint8_t), stream, mockAllocation.getUnderlyingBufferSize(), waArgs);
GenCmdList cmdList; GenCmdList cmdList;
ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer(
cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed()));
@@ -298,7 +307,8 @@ HWTEST2_F(BlitTests, givenMemoryAndImageWhenDispatchCopyImageCallThenCommandAdde
blitProperties.bytesPerPixel = 4; blitProperties.bytesPerPixel = 4;
blitProperties.srcSize = srcSize; blitProperties.srcSize = srcSize;
blitProperties.dstSize = dstSize; blitProperties.dstSize = dstSize;
NEO::BlitCommandsHelper<FamilyType>::dispatchBlitCommandsForImageRegion(blitProperties, stream, pDevice->getRootDeviceEnvironmentRef()); EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())};
NEO::BlitCommandsHelper<FamilyType>::dispatchBlitCommandsForImageRegion(blitProperties, stream, waArgs);
GenCmdList cmdList; GenCmdList cmdList;
ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer(
cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed())); cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed()));

View File

@@ -458,7 +458,8 @@ HWTEST2_F(BlitTests, givenDebugVariableWhenDispatchBlitCommandsForImageRegionIsC
blitProperties.dstSize = {1, 1, 1}; blitProperties.dstSize = {1, 1, 1};
testing::internal::CaptureStdout(); testing::internal::CaptureStdout();
BlitCommandsHelper<FamilyType>::dispatchBlitCommandsForImageRegion(blitProperties, stream, pDevice->getRootDeviceEnvironmentRef()); EncodeDummyBlitWaArgs waArgs{false, &(pDevice->getRootDeviceEnvironmentRef())};
BlitCommandsHelper<FamilyType>::dispatchBlitCommandsForImageRegion(blitProperties, stream, waArgs);
std::string output = testing::internal::GetCapturedStdout(); std::string output = testing::internal::GetCapturedStdout();
std::stringstream expectedOutput; std::stringstream expectedOutput;