Interfaces to register resources

Change-Id: Ic587aaa5a41e4e7648211cfa730a0aa5bbc2985a
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2020-09-14 13:28:47 +02:00
committed by sys_ocldev
parent 9981cdd9e2
commit d363448515
23 changed files with 392 additions and 4 deletions

View File

@@ -47,6 +47,12 @@ BufferObject::BufferObject(Drm *drm, int handle, size_t size, size_t maxOsContex
}
}
BufferObject::~BufferObject() {
for (auto &i : bindExtHandles) {
drm->unregisterResource(i);
}
};
uint32_t BufferObject::getRefCount() const {
return this->refCount.load();
}
@@ -200,4 +206,8 @@ int BufferObject::pin(BufferObject *const boToPin[], size_t numberOfBos, OsConte
return this->exec(4u, 0u, 0u, false, osContext, vmHandleId, drmContextId, boToPin, numberOfBos, &execObject[0]);
}
void BufferObject::addBindExtHandle(uint32_t handle) {
bindExtHandles.push_back(handle);
}
} // namespace NEO