1111#include " shared/source/execution_environment/execution_environment.h"
1212#include " shared/source/execution_environment/root_device_environment.h"
1313#include " shared/source/gmm_helper/cache_settings_helper.h"
14+ #include " shared/source/gmm_helper/client_context/gmm_client_context.h"
1415#include " shared/source/gmm_helper/gmm.h"
1516#include " shared/source/gmm_helper/gmm_helper.h"
1617#include " shared/source/gmm_helper/resource_info.h"
@@ -482,9 +483,11 @@ DrmAllocation *DrmMemoryManager::allocateGraphicsMemory64kb(const AllocationData
482483}
483484
484485GraphicsAllocation *DrmMemoryManager::allocateMemoryByKMD (const AllocationData &allocationData) {
486+ auto hwInfo = executionEnvironment.rootDeviceEnvironments [allocationData.rootDeviceIndex ]->getHardwareInfo ();
487+
485488 StorageInfo systemMemoryStorageInfo = {};
486489 auto gmm = std::make_unique<Gmm>(executionEnvironment.rootDeviceEnvironments [allocationData.rootDeviceIndex ]->getGmmClientContext (), allocationData.hostPtr ,
487- allocationData.size , 0u , CacheSettingsHelper::getGmmUsageType (allocationData.type , allocationData.flags .uncacheable ), false , systemMemoryStorageInfo, true );
490+ allocationData.size , 0u , CacheSettingsHelper::getGmmUsageType (allocationData.type , allocationData.flags .uncacheable , *hwInfo ), false , systemMemoryStorageInfo, true );
488491 size_t bufferSize = allocationData.size ;
489492 uint64_t gpuRange = acquireGpuRange (bufferSize, allocationData.rootDeviceIndex , HeapIndex::HEAP_STANDARD64KB);
490493
@@ -1210,7 +1213,7 @@ void createColouredGmms(GmmClientContext *clientContext, DrmAllocation &allocati
12101213 nullptr ,
12111214 currentSize,
12121215 0u ,
1213- CacheSettingsHelper::getGmmUsageType (allocation.getAllocationType (), false ),
1216+ CacheSettingsHelper::getGmmUsageType (allocation.getAllocationType (), false , *clientContext-> getHardwareInfo () ),
12141217 compression,
12151218 limitedStorageInfo,
12161219 true );
@@ -1224,7 +1227,8 @@ void fillGmmsInAllocation(GmmClientContext *clientContext, DrmAllocation *alloca
12241227 StorageInfo limitedStorageInfo = storageInfo;
12251228 limitedStorageInfo.memoryBanks &= 1u << handleId;
12261229 limitedStorageInfo.pageTablesVisibility &= 1u << handleId;
1227- auto gmm = new Gmm (clientContext, nullptr , alignedSize, 0u , CacheSettingsHelper::getGmmUsageType (allocation->getAllocationType (), false ), false , limitedStorageInfo, true );
1230+ auto gmm = new Gmm (clientContext, nullptr , alignedSize, 0u ,
1231+ CacheSettingsHelper::getGmmUsageType (allocation->getAllocationType (), false , *clientContext->getHardwareInfo ()), false , limitedStorageInfo, true );
12281232 allocation->setGmm (gmm, handleId);
12291233 }
12301234}
@@ -1273,6 +1277,8 @@ GraphicsAllocation *DrmMemoryManager::allocateGraphicsMemoryInDevicePool(const A
12731277 return allocation;
12741278 }
12751279
1280+ auto hwInfo = executionEnvironment.rootDeviceEnvironments [allocationData.rootDeviceIndex ]->getHardwareInfo ();
1281+
12761282 std::unique_ptr<Gmm> gmm;
12771283 size_t sizeAligned = 0 ;
12781284 auto numHandles = allocationData.storageInfo .getNumBanks ();
@@ -1289,11 +1295,12 @@ GraphicsAllocation *DrmMemoryManager::allocateGraphicsMemoryInDevicePool(const A
12891295 sizeAligned = alignUp (allocationData.size , MemoryConstants::pageSize64k);
12901296 }
12911297 if (createSingleHandle) {
1298+
12921299 gmm = std::make_unique<Gmm>(executionEnvironment.rootDeviceEnvironments [allocationData.rootDeviceIndex ]->getGmmClientContext (),
12931300 nullptr ,
12941301 sizeAligned,
12951302 0u ,
1296- CacheSettingsHelper::getGmmUsageType (allocationData.type , !!allocationData.flags .uncacheable ),
1303+ CacheSettingsHelper::getGmmUsageType (allocationData.type , !!allocationData.flags .uncacheable , *hwInfo ),
12971304 allocationData.flags .preferCompressed ,
12981305 allocationData.storageInfo ,
12991306 true );
@@ -1302,7 +1309,6 @@ GraphicsAllocation *DrmMemoryManager::allocateGraphicsMemoryInDevicePool(const A
13021309
13031310 auto sizeAllocated = sizeAligned;
13041311 auto gfxPartition = getGfxPartition (allocationData.rootDeviceIndex );
1305- auto hwInfo = executionEnvironment.rootDeviceEnvironments [allocationData.rootDeviceIndex ]->getHardwareInfo ();
13061312 auto gpuAddress = getGpuAddress (this ->alignmentSelector , this ->heapAssigner , *hwInfo,
13071313 allocationData.type , gfxPartition, sizeAllocated,
13081314 allocationData.hostPtr , allocationData.flags .resource48Bit , allocationData.flags .use32BitFrontWindow );
0 commit comments