Use GpuAddress for TimestampPacket programming

Change-Id: I1303605c33e2e0267a1716e12a0bfcb341fcfbd7
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2019-02-08 10:27:48 +01:00
committed by sys_ocldev
parent 75fe358e5d
commit dc181defba
30 changed files with 352 additions and 258 deletions

View File

@@ -1187,8 +1187,8 @@ HWTEST_P(ProfilingCommandsTest, givenKernelWhenProfilingCommandStartIsTakenThenT
ASSERT_NE(nullptr, storeReg);
uint64_t gpuAddress = storeReg->getMemoryAddress();
auto timestampFieldAddress = checkForStart ? &hwTimeStamp1->tag->ContextStartTS : &hwTimeStamp1->tag->ContextEndTS;
uint64_t expectedAddress = hwTimeStamp1->getGraphicsAllocation()->getGpuAddress() + ptrDiff(timestampFieldAddress, hwTimeStamp1->getGraphicsAllocation()->getUnderlyingBuffer());
auto timestampFieldAddress = checkForStart ? &hwTimeStamp1->tagForCpuAccess->ContextStartTS : &hwTimeStamp1->tagForCpuAccess->ContextEndTS;
uint64_t expectedAddress = hwTimeStamp1->getBaseGraphicsAllocation()->getGpuAddress() + ptrDiff(timestampFieldAddress, hwTimeStamp1->getBaseGraphicsAllocation()->getUnderlyingBuffer());
EXPECT_EQ(expectedAddress, gpuAddress);
itorStoreReg++;
@@ -1198,8 +1198,8 @@ HWTEST_P(ProfilingCommandsTest, givenKernelWhenProfilingCommandStartIsTakenThenT
ASSERT_NE(nullptr, storeReg);
gpuAddress = storeReg->getMemoryAddress();
timestampFieldAddress = checkForStart ? &hwTimeStamp2->tag->ContextStartTS : &hwTimeStamp2->tag->ContextEndTS;
expectedAddress = hwTimeStamp2->getGraphicsAllocation()->getGpuAddress() + ptrDiff(timestampFieldAddress, hwTimeStamp2->getGraphicsAllocation()->getUnderlyingBuffer());
timestampFieldAddress = checkForStart ? &hwTimeStamp2->tagForCpuAccess->ContextStartTS : &hwTimeStamp2->tagForCpuAccess->ContextEndTS;
expectedAddress = hwTimeStamp2->getBaseGraphicsAllocation()->getGpuAddress() + ptrDiff(timestampFieldAddress, hwTimeStamp2->getBaseGraphicsAllocation()->getUnderlyingBuffer());
EXPECT_EQ(expectedAddress, gpuAddress);
if (checkForStart) {
@@ -1209,8 +1209,8 @@ HWTEST_P(ProfilingCommandsTest, givenKernelWhenProfilingCommandStartIsTakenThenT
ASSERT_NE(nullptr, pipeControl);
gpuAddress = static_cast<uint64_t>(pipeControl->getAddress()) | (static_cast<uint64_t>(pipeControl->getAddressHigh()) << 32);
timestampFieldAddress = checkForStart ? &hwTimeStamp1->tag->GlobalStartTS : &hwTimeStamp1->tag->GlobalEndTS;
expectedAddress = hwTimeStamp1->getGraphicsAllocation()->getGpuAddress() + ptrDiff(timestampFieldAddress, hwTimeStamp1->getGraphicsAllocation()->getUnderlyingBuffer());
timestampFieldAddress = checkForStart ? &hwTimeStamp1->tagForCpuAccess->GlobalStartTS : &hwTimeStamp1->tagForCpuAccess->GlobalEndTS;
expectedAddress = hwTimeStamp1->getBaseGraphicsAllocation()->getGpuAddress() + ptrDiff(timestampFieldAddress, hwTimeStamp1->getBaseGraphicsAllocation()->getUnderlyingBuffer());
EXPECT_EQ(expectedAddress, gpuAddress);
itorPipeCtrl++;
@@ -1220,8 +1220,8 @@ HWTEST_P(ProfilingCommandsTest, givenKernelWhenProfilingCommandStartIsTakenThenT
ASSERT_NE(nullptr, pipeControl);
gpuAddress = static_cast<uint64_t>(pipeControl->getAddress()) | static_cast<uint64_t>(pipeControl->getAddressHigh()) << 32;
timestampFieldAddress = checkForStart ? &hwTimeStamp2->tag->GlobalStartTS : &hwTimeStamp2->tag->GlobalEndTS;
expectedAddress = hwTimeStamp2->getGraphicsAllocation()->getGpuAddress() + ptrDiff(timestampFieldAddress, hwTimeStamp2->getGraphicsAllocation()->getUnderlyingBuffer());
timestampFieldAddress = checkForStart ? &hwTimeStamp2->tagForCpuAccess->GlobalStartTS : &hwTimeStamp2->tagForCpuAccess->GlobalEndTS;
expectedAddress = hwTimeStamp2->getBaseGraphicsAllocation()->getGpuAddress() + ptrDiff(timestampFieldAddress, hwTimeStamp2->getBaseGraphicsAllocation()->getUnderlyingBuffer());
EXPECT_EQ(expectedAddress, gpuAddress);
}
}