mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 18:06:32 +08:00
Always specify rootDeviceIndex for graphics memory allocations
Related-To: NEO-2941 Change-Id: Ia2362fd6b4e72ede02919152475f40b3edbc3658 Signed-off-by: Igor Venevtsev <igor.venevtsev@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
5f021afd6d
commit
63fd26f6d6
@@ -419,11 +419,9 @@ GraphicsAllocation *DrmMemoryManager::createGraphicsAllocationFromSharedHandle(o
|
||||
auto boHandle = openFd.handle;
|
||||
auto bo = findAndReferenceSharedBufferObject(boHandle);
|
||||
|
||||
uint32_t rootDeviceIndex = AllocationProperties::noDeviceSpecified == properties.rootDeviceIndex ? 0 : properties.rootDeviceIndex;
|
||||
|
||||
if (bo == nullptr) {
|
||||
size_t size = lseekFunction(handle, 0, SEEK_END);
|
||||
bo = createSharedBufferObject(boHandle, size, requireSpecificBitness, rootDeviceIndex);
|
||||
bo = createSharedBufferObject(boHandle, size, requireSpecificBitness, properties.rootDeviceIndex);
|
||||
|
||||
if (!bo) {
|
||||
return nullptr;
|
||||
@@ -434,12 +432,12 @@ GraphicsAllocation *DrmMemoryManager::createGraphicsAllocationFromSharedHandle(o
|
||||
|
||||
lock.unlock();
|
||||
|
||||
auto drmAllocation = new DrmAllocation(rootDeviceIndex, properties.allocationType, bo, reinterpret_cast<void *>(bo->gpuAddress), bo->size,
|
||||
auto drmAllocation = new DrmAllocation(properties.rootDeviceIndex, properties.allocationType, bo, reinterpret_cast<void *>(bo->gpuAddress), bo->size,
|
||||
handle, MemoryPool::SystemCpuInaccessible);
|
||||
|
||||
if (requireSpecificBitness && this->force32bitAllocations) {
|
||||
drmAllocation->set32BitAllocation(true);
|
||||
drmAllocation->setGpuBaseAddress(GmmHelper::canonize(getExternalHeapBaseAddress(rootDeviceIndex)));
|
||||
drmAllocation->setGpuBaseAddress(GmmHelper::canonize(getExternalHeapBaseAddress(properties.rootDeviceIndex)));
|
||||
}
|
||||
|
||||
if (properties.imgInfo) {
|
||||
|
||||
@@ -254,8 +254,7 @@ GraphicsAllocation *WddmMemoryManager::createAllocationFromHandle(osHandle handl
|
||||
}
|
||||
|
||||
GraphicsAllocation *WddmMemoryManager::createGraphicsAllocationFromSharedHandle(osHandle handle, const AllocationProperties &properties, bool requireSpecificBitness) {
|
||||
uint32_t rootDeviceIndex = properties.rootDeviceIndex == AllocationProperties::noDeviceSpecified ? 0 : properties.rootDeviceIndex;
|
||||
return createAllocationFromHandle(handle, requireSpecificBitness, false, properties.allocationType, rootDeviceIndex);
|
||||
return createAllocationFromHandle(handle, requireSpecificBitness, false, properties.allocationType, properties.rootDeviceIndex);
|
||||
}
|
||||
|
||||
GraphicsAllocation *WddmMemoryManager::createGraphicsAllocationFromNTHandle(void *handle, uint32_t rootDeviceIndex) {
|
||||
|
||||
Reference in New Issue
Block a user