@@ -35,21 +35,22 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemoryWithAlignment
35
35
MemoryAllocation *memoryAllocation = nullptr ;
36
36
37
37
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 );
40
42
counter++;
41
- memoryAllocation->uncacheable = allocationData.flags .uncacheable ;
42
43
return memoryAllocation;
43
44
}
44
45
auto ptr = allocateSystemMemory (sizeAligned, allocationData.alignment ? alignUp (allocationData.alignment , MemoryConstants::pageSize) : MemoryConstants::pageSize);
45
46
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 );
48
50
if (!memoryAllocation) {
49
51
alignedFreeWrapper (ptr);
50
52
return nullptr ;
51
53
}
52
- memoryAllocation->uncacheable = allocationData.flags .uncacheable ;
53
54
}
54
55
counter++;
55
56
return memoryAllocation;
@@ -59,12 +60,11 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemoryForNonSvmHost
59
60
auto alignedPtr = alignDown (allocationData.hostPtr , MemoryConstants::pageSize);
60
61
auto offsetInPage = ptrDiff (allocationData.hostPtr , alignedPtr);
61
62
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 );
64
66
65
67
memoryAllocation->setAllocationOffset (offsetInPage);
66
- memoryAllocation->uncacheable = false ;
67
-
68
68
counter++;
69
69
return memoryAllocation;
70
70
}
@@ -88,8 +88,9 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocate32BitGraphicsMemoryImpl(con
88
88
return nullptr ;
89
89
}
90
90
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 );
93
94
memAlloc->set32BitAllocation (true );
94
95
memAlloc->setGpuBaseAddress (GmmHelper::canonize (allocator32Bit->getBase ()));
95
96
memAlloc->sizeToFree = allocationSize;
@@ -109,7 +110,8 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocate32BitGraphicsMemoryImpl(con
109
110
MemoryAllocation *memoryAllocation = nullptr ;
110
111
if (ptrAlloc != nullptr ) {
111
112
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 );
113
115
memoryAllocation->set32BitAllocation (true );
114
116
memoryAllocation->setGpuBaseAddress (GmmHelper::canonize (allocator32Bit->getBase ()));
115
117
memoryAllocation->sizeToFree = allocationSize;
@@ -120,7 +122,8 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocate32BitGraphicsMemoryImpl(con
120
122
121
123
GraphicsAllocation *OsAgnosticMemoryManager::createGraphicsAllocationFromSharedHandle (osHandle handle, const AllocationProperties &properties, bool requireSpecificBitness) {
122
124
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 );
124
127
graphicsAllocation->setSharedHandle (handle);
125
128
graphicsAllocation->set32BitAllocation (requireSpecificBitness);
126
129
@@ -196,8 +199,9 @@ uint64_t OsAgnosticMemoryManager::getInternalHeapBaseAddress() {
196
199
}
197
200
198
201
GraphicsAllocation *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 );
201
205
allocation->fragmentsStorage = handleStorage;
202
206
return allocation;
203
207
}
@@ -241,8 +245,8 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemoryForImageImpl(
241
245
242
246
auto ptr = allocateSystemMemory (alignUp (allocationData.imgInfo ->size , MemoryConstants::pageSize), MemoryConstants::pageSize);
243
247
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 );
246
250
counter++;
247
251
}
248
252
0 commit comments