Fix profiling in copy engine scenarios.

- We need to wait till completion prior to obtaining timestamps.

Change-Id: I1320c9d44e8c1a2c2125cbd332296de1df28491b
Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:
Michal Mrozek
2020-10-19 18:10:53 +02:00
committed by sys_ocldev
parent b2f8e80555
commit 7e45c396a2
4 changed files with 24 additions and 2 deletions

View File

@@ -969,6 +969,8 @@ uint32_t CommandStreamReceiverHw<GfxFamily>::blitBuffer(const BlitPropertiesCont
auto timestampContextEndGpuAddress = blitProperties.outputTimestampPacket->getGpuAddress() + offsetof(TimestampPacketStorage, packets[0].contextEnd);
auto timestampGlobalEndAddress = blitProperties.outputTimestampPacket->getGpuAddress() + offsetof(TimestampPacketStorage, packets[0].globalEnd);
EncodeMiFlushDW<GfxFamily>::programMiFlushDw(commandStream, 0llu, newTaskCount, false, false);
EncodeStoreMMIO<GfxFamily>::encode(commandStream, GP_THREAD_TIME_REG_ADDRESS_OFFSET_LOW, timestampContextEndGpuAddress);
EncodeStoreMMIO<GfxFamily>::encode(commandStream, REG_GLOBAL_TIMESTAMP_LDW, timestampGlobalEndAddress);
} else {

View File

@@ -74,8 +74,10 @@ size_t BlitCommandsHelper<GfxFamily>::estimateBlitCommandsSize(const Vec3<size_t
const RootDeviceEnvironment &rootDeviceEnvironment) {
size_t timestampCmdSize = 0;
if (updateTimestampPacket) {
timestampCmdSize = (profilingEnabled) ? 4 * sizeof(typename GfxFamily::MI_STORE_REGISTER_MEM)
: EncodeMiFlushDW<GfxFamily>::getMiFlushDwCmdSizeForDataWrite();
timestampCmdSize += EncodeMiFlushDW<GfxFamily>::getMiFlushDwCmdSizeForDataWrite();
if (profilingEnabled) {
timestampCmdSize += 4 * sizeof(typename GfxFamily::MI_STORE_REGISTER_MEM);
}
}
bool preferRegionCopy = isCopyRegionPreferred(copySize, rootDeviceEnvironment);