Refactor waitOnCompletionFence method in DrmMemoryManager

get completion address and value from command stream receiver

Related-To: NEO-6643

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2022-03-30 12:40:09 +00:00
committed by Compute-Runtime-Automation
parent e32f624bf4
commit 9d502dea25
9 changed files with 59 additions and 35 deletions

View File

@@ -316,4 +316,16 @@ inline bool DrmCommandStreamReceiver<GfxFamily>::isUserFenceWaitActive() {
return (this->drm->isVmBindAvailable() && useUserFenceWait);
}
template <typename GfxFamily>
uint64_t DrmCommandStreamReceiver<GfxFamily>::getCompletionAddress() {
uint64_t completionFenceAddress = castToUint64(const_cast<uint32_t *>(getTagAddress()));
completionFenceAddress += Drm::completionFenceOffset;
return completionFenceAddress;
}
template <typename GfxFamily>
uint32_t DrmCommandStreamReceiver<GfxFamily>::getCompletionValue(const GraphicsAllocation &gfxAllocation) {
auto osContextId = osContext->getContextId();
return gfxAllocation.getTaskCount(osContextId);
}
} // namespace NEO