mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 23:03:02 +08:00
Fail when handle cannot be obtain for an allocation
If a handle cannot be obtained, like PRIME_HANDLE_TO_FD, then properly check for the error and propagate it upwards. Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
ddd5dd99ef
commit
4dfdbd612d
@@ -567,13 +567,21 @@ NEO::GraphicsAllocation *DriverHandleImp::getPeerAllocation(Device *device,
|
||||
UNRECOVERABLE_IF(numHandles == 0);
|
||||
std::vector<NEO::osHandle> handles;
|
||||
for (uint32_t i = 0; i < numHandles; i++) {
|
||||
int handle = static_cast<int>(alloc->peekInternalHandle(this->getMemoryManager(), i));
|
||||
handles.push_back(handle);
|
||||
uint64_t handle = 0;
|
||||
int ret = alloc->peekInternalHandle(this->getMemoryManager(), i, handle);
|
||||
if (ret < 0) {
|
||||
return nullptr;
|
||||
}
|
||||
handles.push_back(static_cast<NEO::osHandle>(handle));
|
||||
}
|
||||
auto neoDevice = device->getNEODevice()->getRootDevice();
|
||||
peerPtr = this->importFdHandles(neoDevice, flags, handles, &alloc);
|
||||
} else {
|
||||
uint64_t handle = alloc->peekInternalHandle(this->getMemoryManager());
|
||||
uint64_t handle = 0;
|
||||
int ret = alloc->peekInternalHandle(this->getMemoryManager(), handle);
|
||||
if (ret < 0) {
|
||||
return nullptr;
|
||||
}
|
||||
peerPtr = this->importFdHandle(device->getNEODevice(), flags, handle, &alloc);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user