Use correct heap for GSBA programming

Change-Id: I85d3b478e8c3749501ca6eb76224d95b4dbbb86c
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2020-07-02 17:23:41 +02:00
committed by sys_ocldev
parent 5734d0df70
commit d712a015b4
6 changed files with 17 additions and 11 deletions

View File

@@ -35,7 +35,7 @@ struct CommandQueueHw : public CommandQueueImp {
void dispatchTaskCountWrite(NEO::LinearStream &commandStream, bool flushDataCache) override;
void programGeneralStateBaseAddress(uint64_t gsba, NEO::LinearStream &commandStream);
void programGeneralStateBaseAddress(uint64_t gsba, bool useLocalMemoryForIndirectHeap, NEO::LinearStream &commandStream);
size_t estimateStateBaseAddressCmdSize();
void programFrontEnd(uint64_t scratchAddress, NEO::LinearStream &commandStream);

View File

@@ -210,7 +210,8 @@ ze_result_t CommandQueueHw<gfxCoreFamily>::executeCommandLists(
programFrontEnd(scratchSpaceController->getScratchPatchAddress(), child);
}
if (gsbaStateDirty) {
programGeneralStateBaseAddress(scratchSpaceController->calculateNewGSH(), child);
auto indirectHeap = CommandList::fromHandle(phCommandLists[0])->commandContainer.getIndirectHeap(NEO::HeapType::INDIRECT_OBJECT);
programGeneralStateBaseAddress(scratchSpaceController->calculateNewGSH(), indirectHeap->getGraphicsAllocation()->isAllocatedInLocalMemoryPool(), child);
}
if (commandQueuePreemptionMode == NEO::PreemptionMode::Initial) {

View File

@@ -29,7 +29,7 @@
namespace L0 {
template <GFXCORE_FAMILY gfxCoreFamily>
void CommandQueueHw<gfxCoreFamily>::programGeneralStateBaseAddress(uint64_t gsba, NEO::LinearStream &commandStream) {
void CommandQueueHw<gfxCoreFamily>::programGeneralStateBaseAddress(uint64_t gsba, bool useLocalMemoryForIndirectHeap, NEO::LinearStream &commandStream) {
using GfxFamily = typename NEO::GfxFamilyMapper<gfxCoreFamily>::GfxFamily;
using STATE_BASE_ADDRESS = typename GfxFamily::STATE_BASE_ADDRESS;
using PIPE_CONTROL = typename GfxFamily::PIPE_CONTROL;
@@ -53,7 +53,7 @@ void CommandQueueHw<gfxCoreFamily>::programGeneralStateBaseAddress(uint64_t gsba
gsba,
true,
(device->getMOCS(true, false) >> 1),
neoDevice->getMemoryManager()->getInternalHeapBaseAddress(device->getRootDeviceIndex(), true),
neoDevice->getMemoryManager()->getInternalHeapBaseAddress(device->getRootDeviceIndex(), useLocalMemoryForIndirectHeap),
true,
neoDevice->getGmmHelper(),
false);

View File

@@ -172,7 +172,12 @@ HWTEST2_F(CommandQueueProgramSBATest, whenCreatingCommandQueueThenItIsInitialize
EXPECT_CALL(*memoryManager, getInternalHeapBaseAddress(rootDeviceIndex, true))
.Times(1);
commandQueue->programGeneralStateBaseAddress(0u, child);
commandQueue->programGeneralStateBaseAddress(0u, true, child);
EXPECT_CALL(*memoryManager, getInternalHeapBaseAddress(rootDeviceIndex, false))
.Times(1);
commandQueue->programGeneralStateBaseAddress(0u, false, child);
commandQueue->destroy();
}