@@ -331,7 +331,7 @@ struct BcsTests : public CommandStreamReceiverHwTest {
331331 BlitPropertiesContainer container;
332332 container.push_back (blitProperties);
333333
334- return bcsCsr->blitBuffer (container, blocking);
334+ return bcsCsr->blitBuffer (container, blocking, false );
335335 }
336336
337337 TimestampPacketContainer timestampPacketContainer;
@@ -350,8 +350,8 @@ HWTEST_F(BcsTests, givenBltSizeWhenEstimatingCommandSizeThenAddAllRequiredComman
350350 auto expectedAlignedSize = cmdsSizePerBlit * alignedNumberOfBlts;
351351 auto expectedNotAlignedSize = cmdsSizePerBlit * notAlignedNumberOfBlts;
352352
353- auto alignedEstimatedSize = BlitCommandsHelper<FamilyType>::estimateBlitCommandsSize ({alignedBltSize, 1 , 1 }, csrDependencies, false );
354- auto notAlignedEstimatedSize = BlitCommandsHelper<FamilyType>::estimateBlitCommandsSize ({notAlignedBltSize, 1 , 1 }, csrDependencies, false );
353+ auto alignedEstimatedSize = BlitCommandsHelper<FamilyType>::estimateBlitCommandsSize ({alignedBltSize, 1 , 1 }, csrDependencies, false , false );
354+ auto notAlignedEstimatedSize = BlitCommandsHelper<FamilyType>::estimateBlitCommandsSize ({notAlignedBltSize, 1 , 1 }, csrDependencies, false , false );
355355
356356 EXPECT_EQ (expectedAlignedSize, alignedEstimatedSize);
357357 EXPECT_EQ (expectedNotAlignedSize, notAlignedEstimatedSize);
@@ -368,8 +368,8 @@ HWTEST_F(BcsTests, givenBltSizeWhenEstimatingCommandSizeForReadBufferRectThenAdd
368368 auto expectedAlignedSize = cmdsSizePerBlit * alignedNumberOfBlts;
369369 auto expectedNotAlignedSize = cmdsSizePerBlit * notAlignedNumberOfBlts;
370370
371- auto alignedEstimatedSize = BlitCommandsHelper<FamilyType>::estimateBlitCommandsSize (alignedBltSize, csrDependencies, false );
372- auto notAlignedEstimatedSize = BlitCommandsHelper<FamilyType>::estimateBlitCommandsSize (notAlignedBltSize, csrDependencies, false );
371+ auto alignedEstimatedSize = BlitCommandsHelper<FamilyType>::estimateBlitCommandsSize (alignedBltSize, csrDependencies, false , false );
372+ auto notAlignedEstimatedSize = BlitCommandsHelper<FamilyType>::estimateBlitCommandsSize (notAlignedBltSize, csrDependencies, false , false );
373373
374374 EXPECT_EQ (expectedAlignedSize, alignedEstimatedSize);
375375 EXPECT_EQ (expectedNotAlignedSize, notAlignedEstimatedSize);
@@ -409,7 +409,7 @@ HWTEST_F(BcsTests, givenBlitPropertiesContainerWhenExstimatingCommandsSizeThenCa
409409
410410 expectedAlignedSize = alignUp (expectedAlignedSize, MemoryConstants::cacheLineSize);
411411
412- auto alignedEstimatedSize = BlitCommandsHelper<FamilyType>::estimateBlitCommandsSize (blitPropertiesContainer, pDevice->getHardwareInfo ());
412+ auto alignedEstimatedSize = BlitCommandsHelper<FamilyType>::estimateBlitCommandsSize (blitPropertiesContainer, pDevice->getHardwareInfo (), false );
413413
414414 EXPECT_EQ (expectedAlignedSize, alignedEstimatedSize);
415415}
@@ -437,7 +437,7 @@ HWTEST_F(BcsTests, givenBlitPropertiesContainerWhenExstimatingCommandsSizeForWri
437437
438438 expectedAlignedSize = alignUp (expectedAlignedSize, MemoryConstants::cacheLineSize);
439439
440- auto alignedEstimatedSize = BlitCommandsHelper<FamilyType>::estimateBlitCommandsSize (blitPropertiesContainer, pDevice->getHardwareInfo ());
440+ auto alignedEstimatedSize = BlitCommandsHelper<FamilyType>::estimateBlitCommandsSize (blitPropertiesContainer, pDevice->getHardwareInfo (), false );
441441
442442 EXPECT_EQ (expectedAlignedSize, alignedEstimatedSize);
443443}
@@ -448,8 +448,8 @@ HWTEST_F(BcsTests, givenTimestampPacketWriteRequestWhenEstimatingSizeForCommands
448448 auto expectedSizeWithTimestampPacketWrite = expectedBaseSize + EncodeMiFlushDW<FamilyType>::getMiFlushDwCmdSizeForDataWrite ();
449449 auto expectedSizeWithoutTimestampPacketWrite = expectedBaseSize;
450450
451- auto estimatedSizeWithTimestampPacketWrite = BlitCommandsHelper<FamilyType>::estimateBlitCommandsSize ({1 , 1 , 1 }, csrDependencies, true );
452- auto estimatedSizeWithoutTimestampPacketWrite = BlitCommandsHelper<FamilyType>::estimateBlitCommandsSize ({1 , 1 , 1 }, csrDependencies, false );
451+ auto estimatedSizeWithTimestampPacketWrite = BlitCommandsHelper<FamilyType>::estimateBlitCommandsSize ({1 , 1 , 1 }, csrDependencies, true , false );
452+ auto estimatedSizeWithoutTimestampPacketWrite = BlitCommandsHelper<FamilyType>::estimateBlitCommandsSize ({1 , 1 , 1 }, csrDependencies, false , false );
453453
454454 EXPECT_EQ (expectedSizeWithTimestampPacketWrite, estimatedSizeWithTimestampPacketWrite);
455455 EXPECT_EQ (expectedSizeWithoutTimestampPacketWrite, estimatedSizeWithoutTimestampPacketWrite);
@@ -469,7 +469,7 @@ HWTEST_F(BcsTests, givenBltSizeAndCsrDependenciesWhenEstimatingCommandSizeThenAd
469469 size_t expectedSize = (cmdsSizePerBlit * numberOfBlts) +
470470 TimestampPacketHelper::getRequiredCmdStreamSize<FamilyType>(csrDependencies);
471471
472- auto estimatedSize = BlitCommandsHelper<FamilyType>::estimateBlitCommandsSize ({1 , 1 , 1 }, csrDependencies, false );
472+ auto estimatedSize = BlitCommandsHelper<FamilyType>::estimateBlitCommandsSize ({1 , 1 , 1 }, csrDependencies, false , false );
473473
474474 EXPECT_EQ (expectedSize, estimatedSize);
475475}
@@ -972,7 +972,7 @@ HWTEST_F(BcsTests, givenMultipleBlitPropertiesWhenDispatchingThenProgramCommands
972972 blitPropertiesContainer.push_back (blitProperties1);
973973 blitPropertiesContainer.push_back (blitProperties2);
974974
975- csr.blitBuffer (blitPropertiesContainer, true );
975+ csr.blitBuffer (blitPropertiesContainer, true , false );
976976
977977 HardwareParse hwParser;
978978 hwParser.parseCommands <FamilyType>(csr.commandStream );
@@ -1001,6 +1001,46 @@ HWTEST_F(BcsTests, givenMultipleBlitPropertiesWhenDispatchingThenProgramCommands
10011001 EXPECT_EQ (2u , dependenciesFound);
10021002}
10031003
1004+ HWTEST_F (BcsTests, givenProfilingEnabledWhenBlitBufferThenCommandBufferIsConstructedProperly) {
1005+ auto bcsOsContext = std::unique_ptr<OsContext>(OsContext::create (nullptr , 0 , 0 , aub_stream::ENGINE_BCS, PreemptionMode::Disabled,
1006+ false , false , false ));
1007+ auto bcsCsr = std::make_unique<UltCommandStreamReceiver<FamilyType>>(*pDevice->getExecutionEnvironment (), pDevice->getRootDeviceIndex ());
1008+ bcsCsr->setupContext (*bcsOsContext);
1009+ bcsCsr->initializeTagAllocation ();
1010+
1011+ cl_int retVal = CL_SUCCESS;
1012+ auto buffer = clUniquePtr<Buffer>(Buffer::create (context.get (), CL_MEM_READ_WRITE, 1 , nullptr , retVal));
1013+ void *hostPtr = reinterpret_cast <void *>(0x12340000 );
1014+
1015+ auto blitProperties = BlitProperties::constructPropertiesForReadWriteBuffer (BlitterConstants::BlitDirection::HostPtrToBuffer,
1016+ *bcsCsr, buffer->getGraphicsAllocation (), nullptr , hostPtr,
1017+ buffer->getGraphicsAllocation ()->getGpuAddress (), 0 ,
1018+ 0 , 0 , {1 , 1 , 1 }, 0 , 0 , 0 , 0 );
1019+
1020+ MockTimestampPacketContainer timestamp (*bcsCsr->getTimestampPacketAllocator (), 1u );
1021+ blitProperties.outputTimestampPacket = timestamp.getNode (0 );
1022+
1023+ BlitPropertiesContainer blitPropertiesContainer;
1024+ blitPropertiesContainer.push_back (blitProperties);
1025+
1026+ bcsCsr->blitBuffer (blitPropertiesContainer, false , true );
1027+
1028+ HardwareParse hwParser;
1029+ hwParser.parseCommands <FamilyType>(bcsCsr->commandStream );
1030+ auto &cmdList = hwParser.cmdList ;
1031+
1032+ auto cmdIterator = find<typename FamilyType::MI_STORE_REGISTER_MEM *>(cmdList.begin (), cmdList.end ());
1033+ ASSERT_NE (cmdList.end (), cmdIterator);
1034+ cmdIterator = find<typename FamilyType::MI_STORE_REGISTER_MEM *>(++cmdIterator, cmdList.end ());
1035+ ASSERT_NE (cmdList.end (), cmdIterator);
1036+ cmdIterator = find<typename FamilyType::XY_COPY_BLT *>(++cmdIterator, cmdList.end ());
1037+ ASSERT_NE (cmdList.end (), cmdIterator);
1038+ cmdIterator = find<typename FamilyType::MI_STORE_REGISTER_MEM *>(++cmdIterator, cmdList.end ());
1039+ ASSERT_NE (cmdList.end (), cmdIterator);
1040+ cmdIterator = find<typename FamilyType::MI_STORE_REGISTER_MEM *>(++cmdIterator, cmdList.end ());
1041+ ASSERT_NE (cmdList.end (), cmdIterator);
1042+ }
1043+
10041044HWTEST_F (BcsTests, givenInputAllocationsWhenBlitDispatchedThenMakeAllAllocationsResident) {
10051045 auto &csr = pDevice->getUltCommandStreamReceiver <FamilyType>();
10061046 csr.storeMakeResidentAllocations = true ;
@@ -1027,7 +1067,7 @@ HWTEST_F(BcsTests, givenInputAllocationsWhenBlitDispatchedThenMakeAllAllocations
10271067 blitPropertiesContainer.push_back (blitProperties1);
10281068 blitPropertiesContainer.push_back (blitProperties2);
10291069
1030- csr.blitBuffer (blitPropertiesContainer, false );
1070+ csr.blitBuffer (blitPropertiesContainer, false , false );
10311071
10321072 EXPECT_TRUE (csr.isMadeResident (buffer1->getGraphicsAllocation ()));
10331073 EXPECT_TRUE (csr.isMadeResident (buffer2->getGraphicsAllocation ()));
@@ -1070,7 +1110,7 @@ HWTEST_F(BcsTests, givenFenceAllocationIsRequiredWhenBlitDispatchedThenMakeAllAl
10701110 blitPropertiesContainer.push_back (blitProperties1);
10711111 blitPropertiesContainer.push_back (blitProperties2);
10721112
1073- bcsCsr->blitBuffer (blitPropertiesContainer, false );
1113+ bcsCsr->blitBuffer (blitPropertiesContainer, false , false );
10741114
10751115 EXPECT_TRUE (bcsCsr->isMadeResident (buffer1->getGraphicsAllocation ()));
10761116 EXPECT_TRUE (bcsCsr->isMadeResident (buffer2->getGraphicsAllocation ()));
0 commit comments