@@ -35,21 +35,22 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemoryWithAlignment
3535 MemoryAllocation *memoryAllocation = nullptr ;
3636
3737 if (fakeBigAllocations && allocationData.size > bigAllocation) {
38- memoryAllocation = new MemoryAllocation (allocationData.type , nullptr , (void *)dummyAddress, static_cast <uint64_t >(dummyAddress),
39- allocationData.size , counter, MemoryPool::System4KBPages, allocationData.flags .multiOsContextCapable );
38+ memoryAllocation = new MemoryAllocation (
39+ allocationData.type , nullptr , (void *)dummyAddress, static_cast <uint64_t >(dummyAddress), allocationData.size , counter,
40+ MemoryPool::System4KBPages, allocationData.flags .multiOsContextCapable , allocationData.flags .uncacheable ,
41+ allocationData.flags .flushL3 );
4042 counter++;
41- memoryAllocation->uncacheable = allocationData.flags .uncacheable ;
4243 return memoryAllocation;
4344 }
4445 auto ptr = allocateSystemMemory (sizeAligned, allocationData.alignment ? alignUp (allocationData.alignment , MemoryConstants::pageSize) : MemoryConstants::pageSize);
4546 if (ptr != nullptr ) {
46- memoryAllocation = new MemoryAllocation (allocationData.type , ptr, ptr, reinterpret_cast <uint64_t >(ptr),
47- allocationData.size , counter, MemoryPool::System4KBPages, allocationData.flags .multiOsContextCapable );
47+ memoryAllocation = new MemoryAllocation (allocationData.type , ptr, ptr, reinterpret_cast <uint64_t >(ptr), allocationData.size ,
48+ counter, MemoryPool::System4KBPages, allocationData.flags .multiOsContextCapable ,
49+ allocationData.flags .uncacheable , allocationData.flags .flushL3 );
4850 if (!memoryAllocation) {
4951 alignedFreeWrapper (ptr);
5052 return nullptr ;
5153 }
52- memoryAllocation->uncacheable = allocationData.flags .uncacheable ;
5354 }
5455 counter++;
5556 return memoryAllocation;
@@ -59,12 +60,11 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemoryForNonSvmHost
5960 auto alignedPtr = alignDown (allocationData.hostPtr , MemoryConstants::pageSize);
6061 auto offsetInPage = ptrDiff (allocationData.hostPtr , alignedPtr);
6162
62- auto memoryAllocation = new MemoryAllocation (allocationData.type , nullptr , const_cast <void *>(allocationData.hostPtr ), reinterpret_cast <uint64_t >(alignedPtr),
63- allocationData.size , counter, MemoryPool::System4KBPages, false );
63+ auto memoryAllocation = new MemoryAllocation (allocationData.type , nullptr , const_cast <void *>(allocationData.hostPtr ),
64+ reinterpret_cast <uint64_t >(alignedPtr), allocationData.size , counter,
65+ MemoryPool::System4KBPages, false , false , allocationData.flags .flushL3 );
6466
6567 memoryAllocation->setAllocationOffset (offsetInPage);
66- memoryAllocation->uncacheable = false ;
67-
6868 counter++;
6969 return memoryAllocation;
7070}
@@ -88,8 +88,9 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocate32BitGraphicsMemoryImpl(con
8888 return nullptr ;
8989 }
9090 uint64_t offset = static_cast <uint64_t >(reinterpret_cast <uintptr_t >(allocationData.hostPtr ) & MemoryConstants::pageMask);
91- MemoryAllocation *memAlloc = new MemoryAllocation (allocationData.type , nullptr , const_cast <void *>(allocationData.hostPtr ), GmmHelper::canonize (gpuVirtualAddress + offset),
92- allocationData.size , counter, MemoryPool::System4KBPagesWith32BitGpuAddressing, false );
91+ MemoryAllocation *memAlloc = new MemoryAllocation (
92+ allocationData.type , nullptr , const_cast <void *>(allocationData.hostPtr ), GmmHelper::canonize (gpuVirtualAddress + offset),
93+ allocationData.size , counter, MemoryPool::System4KBPagesWith32BitGpuAddressing, false , false , false );
9394 memAlloc->set32BitAllocation (true );
9495 memAlloc->setGpuBaseAddress (GmmHelper::canonize (allocator32Bit->getBase ()));
9596 memAlloc->sizeToFree = allocationSize;
@@ -109,7 +110,8 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocate32BitGraphicsMemoryImpl(con
109110 MemoryAllocation *memoryAllocation = nullptr ;
110111 if (ptrAlloc != nullptr ) {
111112 memoryAllocation = new MemoryAllocation (allocationData.type , ptrAlloc, ptrAlloc, GmmHelper::canonize (gpuAddress),
112- allocationData.size , counter, MemoryPool::System4KBPagesWith32BitGpuAddressing, false );
113+ allocationData.size , counter, MemoryPool::System4KBPagesWith32BitGpuAddressing, false ,
114+ false , false );
113115 memoryAllocation->set32BitAllocation (true );
114116 memoryAllocation->setGpuBaseAddress (GmmHelper::canonize (allocator32Bit->getBase ()));
115117 memoryAllocation->sizeToFree = allocationSize;
@@ -120,7 +122,8 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocate32BitGraphicsMemoryImpl(con
120122
121123GraphicsAllocation *OsAgnosticMemoryManager::createGraphicsAllocationFromSharedHandle (osHandle handle, const AllocationProperties &properties, bool requireSpecificBitness) {
122124 auto graphicsAllocation = new MemoryAllocation (GraphicsAllocation::AllocationType::UNDECIDED, nullptr , reinterpret_cast <void *>(1 ), 1 ,
123- 4096u , static_cast <uint64_t >(handle), MemoryPool::SystemCpuInaccessible, false );
125+ 4096u , static_cast <uint64_t >(handle), MemoryPool::SystemCpuInaccessible, false ,
126+ false , false );
124127 graphicsAllocation->setSharedHandle (handle);
125128 graphicsAllocation->set32BitAllocation (requireSpecificBitness);
126129
@@ -196,8 +199,9 @@ uint64_t OsAgnosticMemoryManager::getInternalHeapBaseAddress() {
196199}
197200
198201GraphicsAllocation *OsAgnosticMemoryManager::createGraphicsAllocation (OsHandleStorage &handleStorage, const AllocationData &allocationData) {
199- auto allocation = new MemoryAllocation (allocationData.type , nullptr , const_cast <void *>(allocationData.hostPtr ), reinterpret_cast <uint64_t >(allocationData.hostPtr ),
200- allocationData.size , counter++, MemoryPool::System4KBPages, false );
202+ auto allocation = new MemoryAllocation (allocationData.type , nullptr , const_cast <void *>(allocationData.hostPtr ),
203+ reinterpret_cast <uint64_t >(allocationData.hostPtr ), allocationData.size , counter++,
204+ MemoryPool::System4KBPages, false , false , false );
201205 allocation->fragmentsStorage = handleStorage;
202206 return allocation;
203207}
@@ -241,8 +245,8 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemoryForImageImpl(
241245
242246 auto ptr = allocateSystemMemory (alignUp (allocationData.imgInfo ->size , MemoryConstants::pageSize), MemoryConstants::pageSize);
243247 if (ptr != nullptr ) {
244- alloc = new MemoryAllocation (allocationData.type , ptr, ptr, reinterpret_cast <uint64_t >(ptr),
245- allocationData. imgInfo -> size , counter, MemoryPool::SystemCpuInaccessible, false );
248+ alloc = new MemoryAllocation (allocationData.type , ptr, ptr, reinterpret_cast <uint64_t >(ptr), allocationData. imgInfo -> size ,
249+ counter, MemoryPool::SystemCpuInaccessible, false , false , false );
246250 counter++;
247251 }
248252
0 commit comments