mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 09:14:47 +08:00
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:
committed by
sys_ocldev
parent
9c84458b65
commit
76501a2921
@@ -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) {
|
||||
|
||||
@@ -143,6 +143,13 @@ class Drm {
|
||||
static Drm *create(std::unique_ptr<HwDeviceId> hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment);
|
||||
static void overrideBindSupport(bool &useVmBind);
|
||||
|
||||
bool isBindAvailable() {
|
||||
return this->bindAvailable;
|
||||
}
|
||||
void setBindAvailable() {
|
||||
this->bindAvailable = true;
|
||||
}
|
||||
|
||||
protected:
|
||||
int getQueueSliceCount(drm_i915_gem_context_param_sseu *sseu);
|
||||
std::string generateUUID();
|
||||
@@ -151,6 +158,7 @@ class Drm {
|
||||
bool preemptionSupported = false;
|
||||
bool nonPersistentContextsSupported = false;
|
||||
bool requirePerContextVM = false;
|
||||
bool bindAvailable = false;
|
||||
std::unique_ptr<HwDeviceId> hwDeviceId;
|
||||
int deviceId = 0;
|
||||
int revisionId = 0;
|
||||
|
||||
Reference in New Issue
Block a user