Add preemption allocation for each of the Csr

Change-Id: Id14fbfbf6e9a6a85f035e75b4a20ca198c0996e5
Signed-off-by: Hinz <daria.hinz@intel.com>
This commit is contained in:
Daria Hinz
2019-06-27 21:33:05 +02:00
committed by sys_ocldev
parent 27e9dfb2f0
commit 42b87654eb
18 changed files with 96 additions and 92 deletions

View File

@@ -179,6 +179,11 @@ void CommandStreamReceiver::cleanupResources() {
tagAllocation = nullptr;
tagAddress = nullptr;
}
if (preemptionAllocation) {
getMemoryManager()->freeGraphicsMemory(preemptionAllocation);
preemptionAllocation = nullptr;
}
}
bool CommandStreamReceiver::waitForCompletionWithTimeout(bool enableTimeout, int64_t timeoutMicroseconds, uint32_t taskCountToWait) {
@@ -364,6 +369,15 @@ bool CommandStreamReceiver::initializeTagAllocation() {
return true;
}
bool CommandStreamReceiver::createPreemptionAllocation() {
auto hwInfo = executionEnvironment.getHardwareInfo();
AllocationProperties properties{true, hwInfo->capabilityTable.requiredPreemptionSurfaceSize, GraphicsAllocation::AllocationType::PREEMPTION, false};
properties.flags.uncacheable = hwInfo->workaroundTable.waCSRUncachable;
properties.alignment = 256 * MemoryConstants::kiloByte;
this->preemptionAllocation = getMemoryManager()->allocateGraphicsMemoryWithProperties(properties);
return this->preemptionAllocation != nullptr;
}
std::unique_lock<CommandStreamReceiver::MutexType> CommandStreamReceiver::obtainUniqueOwnership() {
return std::unique_lock<CommandStreamReceiver::MutexType>(this->ownershipMutex);
}