mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 01:04:57 +08:00
Use correct heap when opening device memory IPC handle
This change extends the logic of opening IPC memory handles and fills the gap between this logic and allocation of USM device buffers. When HEAP_EXTENDED is available, then it is preferred. Signed-off-by: Wrobel, Patryk <patryk.wrobel@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
eafea5e2fe
commit
4c05a54c2b
@@ -730,7 +730,9 @@ GraphicsAllocation *DrmMemoryManager::createGraphicsAllocationFromMultipleShared
|
||||
sizes.push_back(bo->peekSize());
|
||||
}
|
||||
|
||||
auto heapIndex = HeapIndex::HEAP_STANDARD2MB;
|
||||
auto gfxPartition = getGfxPartition(properties.rootDeviceIndex);
|
||||
auto prefer57bitAddressing = (gfxPartition->getHeapLimit(HeapIndex::HEAP_EXTENDED) > 0);
|
||||
auto heapIndex = prefer57bitAddressing ? HeapIndex::HEAP_EXTENDED : HeapIndex::HEAP_STANDARD2MB;
|
||||
auto gpuRange = acquireGpuRange(totalSize, properties.rootDeviceIndex, heapIndex);
|
||||
|
||||
lock.unlock();
|
||||
@@ -812,10 +814,25 @@ GraphicsAllocation *DrmMemoryManager::createGraphicsAllocationFromSharedHandle(o
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto heapIndex = isLocalMemorySupported(properties.rootDeviceIndex) ? HeapIndex::HEAP_STANDARD2MB : HeapIndex::HEAP_STANDARD;
|
||||
if (requireSpecificBitness && this->force32bitAllocations) {
|
||||
heapIndex = HeapIndex::HEAP_EXTERNAL;
|
||||
}
|
||||
auto getHeapIndex = [&] {
|
||||
if (requireSpecificBitness && this->force32bitAllocations) {
|
||||
return HeapIndex::HEAP_EXTERNAL;
|
||||
}
|
||||
|
||||
auto gfxPartition = getGfxPartition(properties.rootDeviceIndex);
|
||||
auto prefer57bitAddressing = (gfxPartition->getHeapLimit(HeapIndex::HEAP_EXTENDED) > 0);
|
||||
if (prefer57bitAddressing) {
|
||||
return HeapIndex::HEAP_EXTENDED;
|
||||
}
|
||||
|
||||
if (isLocalMemorySupported(properties.rootDeviceIndex)) {
|
||||
return HeapIndex::HEAP_STANDARD2MB;
|
||||
}
|
||||
|
||||
return HeapIndex::HEAP_STANDARD;
|
||||
};
|
||||
|
||||
auto heapIndex = getHeapIndex();
|
||||
auto gpuRange = acquireGpuRange(size, properties.rootDeviceIndex, heapIndex);
|
||||
|
||||
bo->setAddress(gpuRange);
|
||||
|
||||
Reference in New Issue
Block a user