[13/n] Internal 4GB allocator.

- Add common function for all memory managers to obtain internal heap base.

Change-Id: Iacdaaf598e8786dad046b3f4550f9c80ce3f15d9
This commit is contained in:
Mrozek, Michal
2018-03-12 15:24:46 +01:00
committed by sys_ocldev
parent bc08ecdcea
commit 2119d5db08
10 changed files with 37 additions and 0 deletions

View File

@@ -462,6 +462,10 @@ uint64_t DrmMemoryManager::getMaxApplicationAddress() {
return MemoryConstants::max32BitAppAddress + (uint64_t)is64bit * (MemoryConstants::max64BitAppAddress - MemoryConstants::max32BitAppAddress);
}
uint64_t DrmMemoryManager::getInternalHeapBaseAddress() {
return this->internal32bitAllocator->getBase();
}
bool DrmMemoryManager::populateOsHandles(OsHandleStorage &handleStorage) {
for (unsigned int i = 0; i < max_fragments_count; i++) {
// If there is no fragment it means it already exists.

View File

@@ -62,6 +62,7 @@ class DrmMemoryManager : public MemoryManager {
uint64_t getSystemSharedMemory() override;
uint64_t getMaxApplicationAddress() override;
uint64_t getInternalHeapBaseAddress() override;
bool populateOsHandles(OsHandleStorage &handleStorage) override;
void cleanOsHandles(OsHandleStorage &handleStorage) override;

View File

@@ -395,6 +395,10 @@ uint64_t WddmMemoryManager::getMaxApplicationAddress() {
return wddm->getMaxApplicationAddress();
}
uint64_t WddmMemoryManager::getInternalHeapBaseAddress() {
return this->wddm->getGfxPartition().Heap32[1].Base;
}
bool WddmMemoryManager::makeResidentResidencyAllocations(ResidencyContainer *allocationsForResidency) {
auto &residencyAllocations = allocationsForResidency ? *allocationsForResidency : this->residencyAllocations;

View File

@@ -67,6 +67,7 @@ class WddmMemoryManager : public MemoryManager {
uint64_t getSystemSharedMemory() override;
uint64_t getMaxApplicationAddress() override;
uint64_t getInternalHeapBaseAddress() override;
static void APIENTRY trimCallback(_Inout_ D3DKMT_TRIMNOTIFICATION *trimNotification);