Fix reservation size

Change-Id: I1cc3d4405b00365908c5915c9d2a1c512d572530
This commit is contained in:
Kamil Diedrich
2020-10-07 14:32:23 +02:00
committed by sys_ocldev
parent a9d0ead3c5
commit 960860e4cb
7 changed files with 25 additions and 3 deletions

View File

@ -93,7 +93,7 @@ ErrorCode CommandContainer::initialize(Device *device) {
instructionHeapBaseAddress = device->getMemoryManager()->getInternalHeapBaseAddress(device->getRootDeviceIndex(), !hwHelper.useSystemMemoryPlacementForISA(getDevice()->getHardwareInfo()));
indirectHeaps[IndirectHeap::Type::SURFACE_STATE]->getSpace(4 * MemoryConstants::pageSize);
indirectHeaps[IndirectHeap::Type::SURFACE_STATE]->getSpace(reservedSshSize);
iddBlock = nullptr;
nextIddInBlock = this->getNumIddPerBlock();
@ -135,7 +135,7 @@ void CommandContainer::reset() {
addToResidencyContainer(indirectHeap->getGraphicsAllocation());
}
indirectHeaps[IndirectHeap::Type::SURFACE_STATE]->getSpace(4 * MemoryConstants::pageSize);
indirectHeaps[IndirectHeap::Type::SURFACE_STATE]->getSpace(reservedSshSize);
iddBlock = nullptr;
nextIddInBlock = this->getNumIddPerBlock();
@ -190,7 +190,7 @@ IndirectHeap *CommandContainer::getHeapWithRequiredSizeAndAlignment(HeapType hea
setIndirectHeapAllocation(heapType, newAlloc);
setHeapDirty(heapType);
if (heapType == HeapType::SURFACE_STATE) {
indirectHeap->getSpace(4 * MemoryConstants::pageSize);
indirectHeap->getSpace(reservedSshSize);
}
}

View File

@ -100,6 +100,9 @@ class CommandContainer : public NonCopyableOrMovableClass {
void setIddBlock(void *iddBlock) { this->iddBlock = iddBlock; }
void *getIddBlock() { return iddBlock; }
uint32_t getNumIddPerBlock() const { return numIddsPerBlock; }
void setReservedSshSize(size_t reserveSize) {
reservedSshSize = reserveSize;
}
protected:
void *iddBlock = nullptr;
@ -112,6 +115,7 @@ class CommandContainer : public NonCopyableOrMovableClass {
uint64_t indirectObjectHeapBaseAddress = 0u;
uint32_t dirtyHeaps = std::numeric_limits<uint32_t>::max();
uint32_t numIddsPerBlock = 64;
size_t reservedSshSize = 0;
std::unique_ptr<LinearStream> commandStream;
std::unique_ptr<IndirectHeap> indirectHeaps[HeapType::NUM_TYPES];