mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
refactor: extract common logic for waiting on user fences in Drm
Related-To: NEO-6643 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
0a5f78fbfe
commit
4a5f1b9358
@ -1621,4 +1621,18 @@ PhyicalDevicePciSpeedInfo Drm::getPciSpeedInfo() const {
|
||||
|
||||
return pciSpeedInfo;
|
||||
}
|
||||
|
||||
void Drm::waitOnUserFences(const OsContextLinux &osContext, uint64_t address, uint64_t value, uint32_t numActiveTiles, uint32_t postSyncOffset) {
|
||||
auto &drmContextIds = osContext.getDrmContextIds();
|
||||
UNRECOVERABLE_IF(numActiveTiles > drmContextIds.size());
|
||||
auto completionFenceCpuAddress = address;
|
||||
for (auto drmIterator = 0u; drmIterator < numActiveTiles; drmIterator++) {
|
||||
if (*reinterpret_cast<uint32_t *>(completionFenceCpuAddress) < value) {
|
||||
constexpr int64_t timeout = -1;
|
||||
constexpr uint16_t flags = 0;
|
||||
waitUserFence(drmContextIds[drmIterator], completionFenceCpuAddress, value, Drm::ValueWidth::U32, timeout, flags);
|
||||
}
|
||||
completionFenceCpuAddress = ptrOffset(completionFenceCpuAddress, postSyncOffset);
|
||||
}
|
||||
}
|
||||
} // namespace NEO
|
||||
|
Reference in New Issue
Block a user