@@ -868,10 +868,10 @@ HWTEST_F(BcsTests, givenTimestampPacketWriteRequestWhenEstimatingSizeForCommands
868868 auto expectedSizeWithTimestampPacketWrite = expectedBaseSize + EncodeMiFlushDW<FamilyType>::getMiFlushDwCmdSizeForDataWrite ();
869869 auto expectedSizeWithoutTimestampPacketWrite = expectedBaseSize;
870870
871- auto estimatedSizeWithTimestampPacketWrite = BlitCommandsHelper<FamilyType>::estimateBlitCommandsSize (
872- {1 , 1 , 1 }, csrDependencies, true , false , pClDevice->getRootDeviceEnvironment ());
873- auto estimatedSizeWithoutTimestampPacketWrite = BlitCommandsHelper<FamilyType>::estimateBlitCommandsSize (
874- {1 , 1 , 1 }, csrDependencies, false , false , pClDevice->getRootDeviceEnvironment ());
871+ auto estimatedSizeWithTimestampPacketWrite = BlitCommandsHelper<FamilyType>::estimateBlitCommandSize (
872+ {1 , 1 , 1 }, csrDependencies, true , false , false , pClDevice->getRootDeviceEnvironment ());
873+ auto estimatedSizeWithoutTimestampPacketWrite = BlitCommandsHelper<FamilyType>::estimateBlitCommandSize (
874+ {1 , 1 , 1 }, csrDependencies, false , false , false , pClDevice->getRootDeviceEnvironment ());
875875
876876 EXPECT_EQ (expectedSizeWithTimestampPacketWrite, estimatedSizeWithTimestampPacketWrite);
877877 EXPECT_EQ (expectedSizeWithoutTimestampPacketWrite, estimatedSizeWithoutTimestampPacketWrite);
@@ -891,10 +891,10 @@ HWTEST_F(BcsTests, givenTimestampPacketWriteRequestWhenEstimatingSizeForCommands
891891
892892 auto expectedSizeWithTimestampPacketWriteAndProfiling = expectedBaseSize + BlitCommandsHelper<FamilyType>::getProfilingMmioCmdsSize ();
893893
894- auto estimatedSizeWithTimestampPacketWrite = BlitCommandsHelper<FamilyType>::estimateBlitCommandsSize (
895- {1 , 1 , 1 }, csrDependencies, true , false , pClDevice->getRootDeviceEnvironment ());
896- auto estimatedSizeWithTimestampPacketWriteAndProfiling = BlitCommandsHelper<FamilyType>::estimateBlitCommandsSize (
897- {1 , 1 , 1 }, csrDependencies, true , true , pClDevice->getRootDeviceEnvironment ());
894+ auto estimatedSizeWithTimestampPacketWrite = BlitCommandsHelper<FamilyType>::estimateBlitCommandSize (
895+ {1 , 1 , 1 }, csrDependencies, true , false , false , pClDevice->getRootDeviceEnvironment ());
896+ auto estimatedSizeWithTimestampPacketWriteAndProfiling = BlitCommandsHelper<FamilyType>::estimateBlitCommandSize (
897+ {1 , 1 , 1 }, csrDependencies, true , true , false , pClDevice->getRootDeviceEnvironment ());
898898
899899 EXPECT_EQ (expectedSizeWithTimestampPacketWriteAndProfiling, estimatedSizeWithTimestampPacketWriteAndProfiling);
900900 EXPECT_EQ (expectedBaseSize, estimatedSizeWithTimestampPacketWrite);
@@ -923,12 +923,48 @@ HWTEST_F(BcsTests, givenBltSizeAndCsrDependenciesWhenEstimatingCommandSizeThenAd
923923 expectedSize += EncodeMiFlushDW<FamilyType>::getMiFlushDwCmdSizeForDataWrite ();
924924 }
925925
926- auto estimatedSize = BlitCommandsHelper<FamilyType>::estimateBlitCommandsSize (
927- {1 , 1 , 1 }, csrDependencies, false , false , pClDevice->getRootDeviceEnvironment ());
926+ auto estimatedSize = BlitCommandsHelper<FamilyType>::estimateBlitCommandSize (
927+ {1 , 1 , 1 }, csrDependencies, false , false , false , pClDevice->getRootDeviceEnvironment ());
928928
929929 EXPECT_EQ (expectedSize, estimatedSize);
930930}
931931
932+ HWTEST_F (BcsTests, givenImageAndBufferWhenEstimateBlitCommandSizeThenReturnCorrectCommandSize) {
933+
934+ for (auto isImage : {false , true }) {
935+ auto expectedSize = sizeof (typename FamilyType::MI_ARB_CHECK);
936+ expectedSize += isImage ? sizeof (typename FamilyType::XY_BLOCK_COPY_BLT) : sizeof (typename FamilyType::XY_COPY_BLT);
937+
938+ if (BlitCommandsHelper<FamilyType>::miArbCheckWaRequired ()) {
939+ expectedSize += EncodeMiFlushDW<FamilyType>::getMiFlushDwCmdSizeForDataWrite ();
940+ }
941+ if (BlitCommandsHelper<FamilyType>::preBlitCommandWARequired ()) {
942+ expectedSize += EncodeMiFlushDW<FamilyType>::getMiFlushDwCmdSizeForDataWrite ();
943+ }
944+
945+ auto estimatedSize = BlitCommandsHelper<FamilyType>::estimateBlitCommandSize (
946+ {1 , 1 , 1 }, csrDependencies, false , false , isImage, pClDevice->getRootDeviceEnvironment ());
947+
948+ EXPECT_EQ (expectedSize, estimatedSize);
949+ }
950+ }
951+
952+ HWTEST_F (BcsTests, givenImageAndBufferBlitDirectionsWhenIsImageOperationIsCalledThenReturnCorrectValue) {
953+
954+ BlitProperties blitProperties{};
955+ std::pair<bool , BlitterConstants::BlitDirection> params[] = {{false , BlitterConstants::BlitDirection::HostPtrToBuffer},
956+ {false , BlitterConstants::BlitDirection::BufferToHostPtr},
957+ {false , BlitterConstants::BlitDirection::BufferToBuffer},
958+ {true , BlitterConstants::BlitDirection::HostPtrToImage},
959+ {true , BlitterConstants::BlitDirection::ImageToHostPtr},
960+ {true , BlitterConstants::BlitDirection::ImageToImage}};
961+
962+ for (auto [isImageDirection, blitDirection] : params) {
963+ blitProperties.blitDirection = blitDirection;
964+ EXPECT_EQ (isImageDirection, blitProperties.isImageOperation ());
965+ }
966+ }
967+
932968HWTEST_F (BcsTests, givenBltSizeWithLeftoverWhenDispatchedThenProgramAllRequiredCommands) {
933969 using MI_FLUSH_DW = typename FamilyType::MI_FLUSH_DW;
934970 using MI_SEMAPHORE_WAIT = typename FamilyType::MI_SEMAPHORE_WAIT;
0 commit comments