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

@@ -143,10 +143,11 @@ bool Device::createDeviceImpl(const HardwareInfo *pHwInfo, Device &outDevice) {
outDevice.executionEnvironment->memoryManager->setForce32BitAllocations(outDevice.getDeviceInfo().force32BitAddressess);
if (outDevice.preemptionMode == PreemptionMode::MidThread || outDevice.isSourceLevelDebuggerActive()) {
size_t requiredSize = pHwInfo->capabilityTable.requiredPreemptionSurfaceSize;
size_t alignment = 256 * MemoryConstants::kiloByte;
bool uncacheable = outDevice.getWaTable()->waCSRUncachable;
outDevice.preemptionAllocation = outDevice.executionEnvironment->memoryManager->allocateGraphicsMemory(requiredSize, alignment, false, uncacheable);
AllocationProperties properties;
properties.size = pHwInfo->capabilityTable.requiredPreemptionSurfaceSize;
properties.flags.uncacheable = outDevice.getWaTable()->waCSRUncachable;
properties.alignment = 256 * MemoryConstants::kiloByte;
outDevice.preemptionAllocation = outDevice.executionEnvironment->memoryManager->allocateGraphicsMemoryWithProperties(properties);
if (!outDevice.preemptionAllocation) {
return false;
}