[31/n] Internal 4GB allocator.

- Add Indirect Heap function that will be used to program State Base Address.
- This is to allow indirect heaps to work in 2 modes, either heap will service
as whole indirect allocation OR offsets in 4GB space will be used.

Change-Id: Ic4ca1e907c1b30d2f98dc39e8ab945ce35ed6ad0
This commit is contained in:
Mrozek, Michal
2018-04-17 08:08:00 +02:00
committed by sys_ocldev
parent 6299388b71
commit 1660f904dc
2 changed files with 26 additions and 0 deletions

View File

@ -54,6 +54,7 @@ class IndirectHeap : public LinearStream {
void align(size_t alignment);
uint64_t getHeapGpuStartOffset();
uint64_t getHeapGpuBase();
protected:
bool canBeUtilizedAs4GbHeap = false;
@ -70,4 +71,11 @@ inline uint64_t IndirectHeap::getHeapGpuStartOffset() {
return 0llu;
}
}
inline uint64_t IndirectHeap::getHeapGpuBase() {
if (this->canBeUtilizedAs4GbHeap) {
return this->graphicsAllocation->gpuBaseAddress;
} else {
return this->graphicsAllocation->getGpuAddress();
}
}
}