SWDEV-289378 - Avoid CPU TS overwrite if GPU TS is available

Change-Id: I2fc1a43c048b4fa1e42f27c4cf5c72fc7ae84e9c
This commit is contained in:
German Andryeyev
2021-06-30 14:36:10 -04:00
gecommit door Maneesh Gupta
bovenliggende 50a50c66b9
commit 4fd506cfe1
+8 -1
Bestand weergeven
@@ -131,7 +131,14 @@ class Timestamp : public amd::HeapObject {
void start() { start_ = amd::Os::timeNanos(); }
// End a timestamp (get timestamp from OS)
void end() { end_ = amd::Os::timeNanos(); }
void end() {
// Timestamp value can be updated by HW profiling if current command had a stall.
// Although CPU TS should be still valid in this situation, there are cases in VM mode
// when CPU timeline is out of sync with GPU timeline and shifted time can be reported
if (end_ != 0) {
end_ = amd::Os::timeNanos();
}
}
static void setGpuTicksToTime(double ticksToTime) { ticksToTime_ = ticksToTime; }
static double getGpuTicksToTime() { return ticksToTime_; }