Simplify memory manager API [1/n]

pass struct with properties to allocate graphics memory methods:
for protected methods use AllocationData
for public methods use AllocationProperties

Change-Id: Ie1c3cb6b5e330bc4adac2ca8b0bf02d30ec76065
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2018-11-30 11:01:33 +01:00
committed by sys_ocldev
parent ace20aba5b
commit c8748b77a0
30 changed files with 235 additions and 163 deletions

View File

@@ -355,7 +355,10 @@ bool CommandStreamReceiver::createAllocationForHostSurface(HostPtrSurface &surfa
allocation = memoryManager->allocateGraphicsMemoryForHostPtr(surface.getSurfaceSize(), surface.getMemoryPointer(), device.isFullRangeSvm(), requiresL3Flush);
if (allocation == nullptr && surface.peekIsPtrCopyAllowed()) {
// Try with no host pointer allocation and copy
allocation = memoryManager->allocateGraphicsMemory(surface.getSurfaceSize(), MemoryConstants::pageSize, false, false);
AllocationProperties properties;
properties.alignment = MemoryConstants::pageSize;
properties.size = surface.getSurfaceSize();
allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties);
if (allocation) {
memcpy_s(allocation->getUnderlyingBuffer(), allocation->getUnderlyingBufferSize(), surface.getMemoryPointer(), surface.getSurfaceSize());