mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 13:33:02 +08:00
feature: add Drm-specific memoryBanks computation logic
Related-To: NEO-9754 Signed-off-by: Maciej Bielski <maciej.bielski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
3dd051c3ee
commit
f99846a108
@@ -27,6 +27,7 @@
|
||||
#include "shared/source/memory_manager/allocation_properties.h"
|
||||
#include "shared/source/memory_manager/gfx_partition.h"
|
||||
#include "shared/source/memory_manager/host_ptr_manager.h"
|
||||
#include "shared/source/memory_manager/local_memory_usage.h"
|
||||
#include "shared/source/memory_manager/memory_banks.h"
|
||||
#include "shared/source/memory_manager/memory_pool.h"
|
||||
#include "shared/source/memory_manager/multi_graphics_allocation.h"
|
||||
@@ -352,6 +353,30 @@ void DrmMemoryManager::emitPinningRequest(BufferObject *bo, const AllocationData
|
||||
|
||||
StorageInfo DrmMemoryManager::createStorageInfoFromProperties(const AllocationProperties &properties) {
|
||||
auto storageInfo{MemoryManager::createStorageInfoFromProperties(properties)};
|
||||
auto *memoryInfo = getDrm(properties.rootDeviceIndex).getMemoryInfo();
|
||||
|
||||
if (memoryInfo == nullptr || localMemorySupported[properties.rootDeviceIndex] == false) {
|
||||
return storageInfo;
|
||||
}
|
||||
|
||||
const auto &localMemoryRegions{memoryInfo->getLocalMemoryRegions()};
|
||||
DEBUG_BREAK_IF(localMemoryRegions.empty());
|
||||
|
||||
DeviceBitfield allMemoryBanks{0b0};
|
||||
for (auto i = 0u; i < localMemoryRegions.size(); ++i) {
|
||||
if ((properties.subDevicesBitfield & localMemoryRegions[i].tilesMask).any()) {
|
||||
allMemoryBanks.set(i);
|
||||
}
|
||||
}
|
||||
if (allMemoryBanks.none()) {
|
||||
return storageInfo;
|
||||
}
|
||||
|
||||
DeviceBitfield preferredMemoryBanks{storageInfo.memoryBanks};
|
||||
if (localMemoryRegions.size() == 1u) {
|
||||
preferredMemoryBanks = allMemoryBanks;
|
||||
}
|
||||
storageInfo.memoryBanks = computeStorageInfoMemoryBanks(properties, preferredMemoryBanks, allMemoryBanks);
|
||||
|
||||
return storageInfo;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user