Enable 64kb pages when its allowed by platform

Change-Id: I10f02bd83beabeff929e16c7293324b81bfed054
This commit is contained in:
Dunajski, Bartosz
2018-07-11 09:45:20 +02:00
parent 7735fb5767
commit 85d7081beb
8 changed files with 37 additions and 8 deletions

View File

@@ -113,7 +113,7 @@ void *MemoryManager::allocateSystemMemory(size_t size, size_t alignment) {
GraphicsAllocation *MemoryManager::allocateGraphicsMemoryForSVM(size_t size, bool coherent) {
GraphicsAllocation *graphicsAllocation = nullptr;
if (enable64kbpages) {
if (peek64kbPagesEnabled()) {
graphicsAllocation = allocateGraphicsMemory64kb(size, MemoryConstants::pageSize64k, false);
} else {
graphicsAllocation = allocateGraphicsMemory(size);
@@ -424,7 +424,7 @@ GraphicsAllocation *MemoryManager::allocateGraphicsMemory(const AllocationData &
if (allocationData.hostPtr) {
return allocateGraphicsMemory(allocationData.size, allocationData.hostPtr, allocationData.flags.forcePin);
}
if (enable64kbpages && allocationData.flags.allow64kbPages) {
if (peek64kbPagesEnabled() && allocationData.flags.allow64kbPages) {
return allocateGraphicsMemory64kb(allocationData.size, MemoryConstants::pageSize64k, allocationData.flags.forcePin);
}
return allocateGraphicsMemory(allocationData.size, MemoryConstants::pageSize, allocationData.flags.forcePin, allocationData.flags.uncacheable);

View File

@@ -193,6 +193,7 @@ class MemoryManager {
virtual GraphicsAllocation *createGraphicsAllocation(OsHandleStorage &handleStorage, size_t hostPtrSize, const void *hostPtr) = 0;
bool peek64kbPagesEnabled() const { return enable64kbpages; }
bool peekForce32BitAllocations() { return force32bitAllocations; }
void setForce32BitAllocations(bool newValue);