Adjust early BO pin to new residency model

Resolves: NEO-5112

Change-Id: Ia65b1d75f957669999f7de423716a1e3cffc4032
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2020-09-30 08:29:12 +02:00
committed by sys_ocldev
parent 9c84458b65
commit 76501a2921
2 changed files with 22 additions and 2 deletions

View File

@@ -196,8 +196,20 @@ void BufferObject::printExecutionBuffer(drm_i915_gem_execbuffer2 &execbuf, const
}
int BufferObject::pin(BufferObject *const boToPin[], size_t numberOfBos, OsContext *osContext, uint32_t vmHandleId, uint32_t drmContextId) {
StackVec<drm_i915_gem_exec_object2, maxFragmentsCount + 1> execObject(numberOfBos + 1);
return this->exec(4u, 0u, 0u, false, osContext, vmHandleId, drmContextId, boToPin, numberOfBos, &execObject[0]);
auto retVal = 0;
if (this->drm->isBindAvailable()) {
for (auto drmIterator = 0u; drmIterator < osContext->getDeviceBitfield().size(); drmIterator++) {
if (osContext->getDeviceBitfield().test(drmIterator)) {
for (size_t i = 0; i < numberOfBos; i++) {
boToPin[i]->bind(osContext, drmIterator);
}
}
}
} else {
StackVec<drm_i915_gem_exec_object2, maxFragmentsCount + 1> execObject(numberOfBos + 1);
retVal = this->exec(4u, 0u, 0u, false, osContext, vmHandleId, drmContextId, boToPin, numberOfBos, &execObject[0]);
}
return retVal;
}
void BufferObject::addBindExtHandle(uint32_t handle) {