diff --git a/opencl/test/unit_test/helpers/timestamp_packet_tests.cpp b/opencl/test/unit_test/helpers/timestamp_packet_tests.cpp index f6584a72f2..06d7a59672 100644 --- a/opencl/test/unit_test/helpers/timestamp_packet_tests.cpp +++ b/opencl/test/unit_test/helpers/timestamp_packet_tests.cpp @@ -208,7 +208,7 @@ TEST_F(TimestampPacketTests, givenTagNodeWhatAskingForGpuAddressesThenReturnCorr EXPECT_EQ(expectedCounterAddress, TimestampPacketHelper::getGpuDependenciesCountGpuAddress(mockNode)); } -TEST_F(TimestampPacketSimpleTests, whenContextEndTagIsNotOneThenMarkAsCompleted) { +TEST_F(TimestampPacketSimpleTests, whenEndTagIsNotOneThenMarkAsCompleted) { TimestampPacketStorage timestampPacketStorage; auto &packet = timestampPacketStorage.packets[0]; timestampPacketStorage.initialize(); @@ -223,10 +223,10 @@ TEST_F(TimestampPacketSimpleTests, whenContextEndTagIsNotOneThenMarkAsCompleted) packet.contextEnd = 0; packet.globalEnd = 1; - EXPECT_TRUE(timestampPacketStorage.isCompleted()); + EXPECT_FALSE(timestampPacketStorage.isCompleted()); - packet.contextEnd = 100; - packet.globalEnd = 100; + packet.contextEnd = 0; + packet.globalEnd = 0; EXPECT_TRUE(timestampPacketStorage.isCompleted()); } @@ -272,13 +272,9 @@ TEST_F(TimestampPacketSimpleTests, whenIsCompletedIsCalledThenItReturnsProperTim EXPECT_FALSE(timestampPacketStorage.isCompleted()); packet.contextEnd = 0; - EXPECT_TRUE(timestampPacketStorage.isCompleted()); - packet.contextEnd = 100; - EXPECT_TRUE(timestampPacketStorage.isCompleted()); + EXPECT_FALSE(timestampPacketStorage.isCompleted()); packet.globalEnd = 0; EXPECT_TRUE(timestampPacketStorage.isCompleted()); - packet.globalEnd = 100; - EXPECT_TRUE(timestampPacketStorage.isCompleted()); } TEST_F(TimestampPacketSimpleTests, givenMultiplePacketsInUseWhenCompletionIsCheckedTheVerifyAllUsedNodes) { @@ -295,16 +291,10 @@ TEST_F(TimestampPacketSimpleTests, givenMultiplePacketsInUseWhenCompletionIsChec } packets[timestampPacketStorage.packetsUsed - 1].contextEnd = 0; - EXPECT_TRUE(timestampPacketStorage.isCompleted()); - - packets[timestampPacketStorage.packetsUsed - 1].contextEnd = 100; - EXPECT_TRUE(timestampPacketStorage.isCompleted()); + EXPECT_FALSE(timestampPacketStorage.isCompleted()); packets[timestampPacketStorage.packetsUsed - 1].globalEnd = 0; EXPECT_TRUE(timestampPacketStorage.isCompleted()); - - packets[timestampPacketStorage.packetsUsed - 1].globalEnd = 100; - EXPECT_TRUE(timestampPacketStorage.isCompleted()); } TEST_F(TimestampPacketSimpleTests, whenNewTagIsTakenThenReinitialize) { diff --git a/shared/source/command_stream/command_stream_receiver_hw_base.inl b/shared/source/command_stream/command_stream_receiver_hw_base.inl index 2b99a17af7..ca63acbac8 100644 --- a/shared/source/command_stream/command_stream_receiver_hw_base.inl +++ b/shared/source/command_stream/command_stream_receiver_hw_base.inl @@ -984,7 +984,7 @@ uint32_t CommandStreamReceiverHw::blitBuffer(const BlitPropertiesCont EncodeStoreMMIO::encode(commandStream, REG_GLOBAL_TIMESTAMP_LDW, timestampGlobalEndAddress); } else { auto timestampPacketGpuAddress = TimestampPacketHelper::getContextEndGpuAddress(*blitProperties.outputTimestampPacket); - EncodeMiFlushDW::programMiFlushDw(commandStream, timestampPacketGpuAddress, 0, true, true); + EncodeMiFlushDW::programMiFlushDw(commandStream, timestampPacketGpuAddress, 0, false, true); } makeResident(*blitProperties.outputTimestampPacket->getBaseGraphicsAllocation()); } diff --git a/shared/source/helpers/timestamp_packet.h b/shared/source/helpers/timestamp_packet.h index da83a3583d..e11a2f3896 100644 --- a/shared/source/helpers/timestamp_packet.h +++ b/shared/source/helpers/timestamp_packet.h @@ -47,7 +47,7 @@ struct TimestampPacketStorage { } for (uint32_t i = 0; i < packetsUsed; i++) { - if (packets[i].contextEnd == 1) { + if ((packets[i].contextEnd == 1) || (packets[i].globalEnd == 1)) { return false; } }