Call VM prefetch for KMD-migrated shared allocation on all VMs

Call VM prefetch ioctl on all VMs for the KMD to apply
a synchronoues bind operation of buffer objects on all VMs.

Related-To: NEO-7841

Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
This commit is contained in:
Milczarek, Slawomir
2023-04-04 09:15:52 +00:00
committed by Compute-Runtime-Automation
parent e1af516c25
commit b839f26ed7
2 changed files with 26 additions and 10 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2022 Intel Corporation
* Copyright (C) 2020-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -346,9 +346,13 @@ bool DrmAllocation::setMemPrefetch(Drm *drm, SubDeviceIdsVec &subDeviceIds) {
for (uint8_t handleId = 0u; handleId < EngineLimits::maxHandleCount; handleId++) {
if (storageInfo.memoryBanks.test(handleId)) {
auto bo = this->getBOs()[handleId];
auto vmHandleId = subDeviceIds[handleId % subDeviceIds.size()];
auto subDeviceId = DebugManager.flags.CreateContextWithAccessCounters.get() > 0 ? vmHandleId : handleId;
success &= prefetchBO(bo, vmHandleId, subDeviceId);
auto subDeviceId = handleId;
if (DebugManager.flags.CreateContextWithAccessCounters.get() > 0) {
subDeviceId = subDeviceIds[handleId % subDeviceIds.size()];
}
for (auto vmHandleId : subDeviceIds) {
success &= prefetchBO(bo, vmHandleId, subDeviceId);
}
}
}
} else {