Select correct heap base address for ISA

Change-Id: I400f965faa4615519729756daa78350a46c46ff2
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski 2020-09-22 15:48:24 +02:00 committed by sys_ocldev
parent 1d4568e548
commit 2a69b1ed78
32 changed files with 146 additions and 24 deletions

View File

@ -43,6 +43,9 @@ void CommandQueueHw<gfxCoreFamily>::programGeneralStateBaseAddress(uint64_t gsba
*pcCmd = cmd;
NEO::Device *neoDevice = device->getNEODevice();
auto &hwInfo = neoDevice->getHardwareInfo();
auto &hwHelper = NEO::HwHelper::get(hwInfo.platform.eRenderCoreFamily);
NEO::EncodeWA<GfxFamily>::encodeAdditionalPipelineSelect(*neoDevice, commandStream, true);
auto pSbaCmd = static_cast<STATE_BASE_ADDRESS *>(commandStream.getSpace(sizeof(STATE_BASE_ADDRESS)));
@ -56,6 +59,7 @@ void CommandQueueHw<gfxCoreFamily>::programGeneralStateBaseAddress(uint64_t gsba
true,
(device->getMOCS(true, false) >> 1),
neoDevice->getMemoryManager()->getInternalHeapBaseAddress(device->getRootDeviceIndex(), useLocalMemoryForIndirectHeap),
neoDevice->getMemoryManager()->getInternalHeapBaseAddress(device->getRootDeviceIndex(), !hwHelper.useSystemMemoryPlacementForISA(hwInfo)),
true,
neoDevice->getGmmHelper(),
false);

View File

@ -108,13 +108,38 @@ HWTEST2_F(CommandQueueProgramSBATest, whenCreatingCommandQueueThenItIsInitialize
uint32_t alignedSize = 4096u;
NEO::LinearStream child(commandQueue->commandStream->getSpace(alignedSize), alignedSize);
EXPECT_CALL(*memoryManager, getInternalHeapBaseAddress(rootDeviceIndex, true))
.Times(1);
auto &hwHelper = HwHelper::get(neoDevice->getHardwareInfo().platform.eRenderCoreFamily);
bool isaInLocalMemory = !hwHelper.useSystemMemoryPlacementForISA(neoDevice->getHardwareInfo());
if (isaInLocalMemory) {
EXPECT_CALL(*memoryManager, getInternalHeapBaseAddress(rootDeviceIndex, true))
.Times(2);
EXPECT_CALL(*memoryManager, getInternalHeapBaseAddress(rootDeviceIndex, false))
.Times(0);
} else {
EXPECT_CALL(*memoryManager, getInternalHeapBaseAddress(rootDeviceIndex, true))
.Times(1); // IOH
EXPECT_CALL(*memoryManager, getInternalHeapBaseAddress(rootDeviceIndex, false))
.Times(1); // instruction heap
}
commandQueue->programGeneralStateBaseAddress(0u, true, child);
EXPECT_CALL(*memoryManager, getInternalHeapBaseAddress(rootDeviceIndex, false))
.Times(1);
if (isaInLocalMemory) {
EXPECT_CALL(*memoryManager, getInternalHeapBaseAddress(rootDeviceIndex, false))
.Times(1); // IOH
EXPECT_CALL(*memoryManager, getInternalHeapBaseAddress(rootDeviceIndex, true))
.Times(1); // instruction heap
} else {
EXPECT_CALL(*memoryManager, getInternalHeapBaseAddress(rootDeviceIndex, true))
.Times(0);
EXPECT_CALL(*memoryManager, getInternalHeapBaseAddress(rootDeviceIndex, false))
.Times(2);
}
commandQueue->programGeneralStateBaseAddress(0u, false, child);

View File

@ -223,7 +223,11 @@ HWTEST_F(EnqueueCopyBufferRectTest, WhenCopyingBufferRect2DThenL3ProgrammingIsCo
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueCopyBufferRectTest, When2DEnqueueIsDoneThenStateBaseAddressIsProperlyProgrammed) {
enqueueCopyBufferRect2D<FamilyType>();
auto &ultCsr = this->pDevice->getUltCommandStreamReceiver<FamilyType>();
auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily);
validateStateBaseAddress<FamilyType>(ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, pIOH->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()),
ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo())),
pDSH, pIOH, pSSH, itorPipelineSelect, itorWalker, cmdList, 0llu);
}
@ -343,7 +347,11 @@ HWTEST_F(EnqueueCopyBufferRectTest, WhenCopyingBufferRect3DThenL3ProgrammingIsCo
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueCopyBufferRectTest, When3DEnqueueIsDoneThenStateBaseAddressIsProperlyProgrammed) {
enqueueCopyBufferRect3D<FamilyType>();
auto &ultCsr = this->pDevice->getUltCommandStreamReceiver<FamilyType>();
auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily);
validateStateBaseAddress<FamilyType>(ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, pIOH->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()),
ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo())),
pDSH, pIOH, pSSH, itorPipelineSelect, itorWalker, cmdList, 0llu);
}

View File

@ -192,7 +192,11 @@ HWTEST_F(EnqueueCopyBufferTest, WhenCopyingBufferThenL3ProgrammingIsCorrect) {
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueCopyBufferTest, WhenEnqueueIsDoneThenStateBaseAddressIsProperlyProgrammed) {
enqueueCopyBufferAndParse<FamilyType>();
auto &ultCsr = this->pDevice->getUltCommandStreamReceiver<FamilyType>();
auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily);
validateStateBaseAddress<FamilyType>(ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, pIOH->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()),
ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo())),
pDSH, pIOH, pSSH, itorPipelineSelect, itorWalker, cmdList, 0llu);
}

View File

@ -96,7 +96,11 @@ HWTEST_F(EnqueueCopyBufferToImageTest, WhenCopyingBufferToImageThenL3Programming
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueCopyBufferToImageTest, WhenEnqueueIsDoneThenStateBaseAddressIsProperlyProgrammed) {
enqueueCopyBufferToImage<FamilyType>();
auto &ultCsr = this->pDevice->getUltCommandStreamReceiver<FamilyType>();
auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily);
validateStateBaseAddress<FamilyType>(ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, pIOH->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()),
ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo())),
pDSH, pIOH, pSSH, itorPipelineSelect, itorWalker, cmdList, 0llu);
}

View File

@ -98,7 +98,11 @@ HWTEST_F(EnqueueCopyImageTest, WhenCopyingImageThenL3ProgrammingIsCorrect) {
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueCopyImageTest, WhenEnqueueIsDoneThenStateBaseAddressIsProperlyProgrammed) {
enqueueCopyImage<FamilyType>();
auto &ultCsr = this->pDevice->getUltCommandStreamReceiver<FamilyType>();
auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily);
validateStateBaseAddress<FamilyType>(ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, pIOH->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()),
ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo())),
pDSH, pIOH, pSSH, itorPipelineSelect, itorWalker, cmdList, 0llu);
}

View File

@ -97,7 +97,11 @@ HWTEST_F(EnqueueCopyImageToBufferTest, WhenCopyingImageToBufferThenL3Programming
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueCopyImageToBufferTest, WhenEnqueueIsDoneThenStateBaseAddressIsProperlyProgrammed) {
enqueueCopyImageToBuffer<FamilyType>();
auto &ultCsr = this->pDevice->getUltCommandStreamReceiver<FamilyType>();
auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily);
validateStateBaseAddress<FamilyType>(ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, pIOH->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()),
ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo())),
pDSH, pIOH, pSSH, itorPipelineSelect, itorWalker, cmdList, 0llu);
}

View File

@ -213,7 +213,11 @@ HWTEST_F(EnqueueFillBufferCmdTests, WhenFillingBufferThenL3ProgrammingIsCorrect)
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueFillBufferCmdTests, WhenEnqueueIsDoneThenStateBaseAddressIsProperlyProgrammed) {
enqueueFillBuffer<FamilyType>();
auto &ultCsr = this->pDevice->getUltCommandStreamReceiver<FamilyType>();
auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily);
validateStateBaseAddress<FamilyType>(ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, pIOH->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()),
ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo())),
pDSH, pIOH, pSSH, itorPipelineSelect, itorWalker, cmdList, 0llu);
}

View File

@ -105,7 +105,11 @@ HWTEST_F(EnqueueFillImageTest, WhenFillingImageThenL3ProgrammingIsCorrect) {
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueFillImageTest, WhenEnqueueIsDoneThenStateBaseAddressIsProperlyProgrammed) {
enqueueFillImage<FamilyType>();
auto &ultCsr = this->pDevice->getUltCommandStreamReceiver<FamilyType>();
auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily);
validateStateBaseAddress<FamilyType>(ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, pIOH->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()),
ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo())),
pDSH, pIOH, pSSH, itorPipelineSelect, itorWalker, cmdList, 0llu);
}

View File

@ -186,7 +186,11 @@ HWCMDTEST_P(IGFX_GEN8_CORE, EnqueueWorkItemTestsWithLimitedParamSet, LoadRegiste
HWCMDTEST_P(IGFX_GEN8_CORE, EnqueueWorkItemTestsWithLimitedParamSet, WhenEnqueueIsDoneThenStateBaseAddressIsProperlyProgrammed) {
enqueueKernel<FamilyType>();
auto &ultCsr = this->pDevice->getUltCommandStreamReceiver<FamilyType>();
auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily);
validateStateBaseAddress<FamilyType>(ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, pIOH->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()),
ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo())),
pDSH, pIOH, pSSH, itorPipelineSelect, itorWalker, cmdList,
context->getMemoryManager()->peekForce32BitAllocations() ? context->getMemoryManager()->getExternalHeapBaseAddress(ultCsr.rootDeviceIndex, false) : 0llu);
}

View File

@ -209,7 +209,11 @@ HWTEST_F(EnqueueReadBufferRectTest, WhenReadingBufferThenL3ProgrammingIsCorrect)
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueReadBufferRectTest, When2DEnqueueIsDoneThenStateBaseAddressIsProperlyProgrammed) {
enqueueReadBufferRect2D<FamilyType>();
auto &ultCsr = this->pDevice->getUltCommandStreamReceiver<FamilyType>();
auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily);
validateStateBaseAddress<FamilyType>(ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, pIOH->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()),
ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo())),
pDSH, pIOH, pSSH, itorPipelineSelect, itorWalker, cmdList, 0llu);
}

View File

@ -173,7 +173,11 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueReadBufferTypeTest, WhenEnqueueIsDoneThenStat
srcBuffer->forceDisallowCPUCopy = true;
enqueueReadBuffer<FamilyType>();
auto &ultCsr = this->pDevice->getUltCommandStreamReceiver<FamilyType>();
auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily);
validateStateBaseAddress<FamilyType>(ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, pIOH->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()),
ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo())),
pDSH, pIOH, pSSH, itorPipelineSelect, itorWalker, cmdList, 0llu);
}

View File

@ -108,7 +108,11 @@ HWTEST_F(EnqueueReadImageTest, WhenReadingImageThenL3ProgrammingIsCorrect) {
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueReadImageTest, WhenEnqueueIsDoneThenStateBaseAddressIsProperlyProgrammed) {
enqueueReadImage<FamilyType>();
auto &ultCsr = this->pDevice->getUltCommandStreamReceiver<FamilyType>();
auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily);
validateStateBaseAddress<FamilyType>(ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, pIOH->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()),
ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo())),
pDSH, pIOH, pSSH, itorPipelineSelect, itorWalker, cmdList, 0llu);
}

View File

@ -183,7 +183,11 @@ HWTEST_F(EnqueueWriteBufferRectTest, WhenWritingBufferThenL3ProgrammingIsCorrect
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueWriteBufferRectTest, When2DEnqueueIsDoneThenStateBaseAddressIsProperlyProgrammed) {
enqueueWriteBufferRect2D<FamilyType>();
auto &ultCsr = this->pDevice->getUltCommandStreamReceiver<FamilyType>();
auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily);
validateStateBaseAddress<FamilyType>(ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, pIOH->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()),
ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo())),
pDSH, pIOH, pSSH, itorPipelineSelect, itorWalker, cmdList, 0llu);
}

View File

@ -171,7 +171,11 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueWriteBufferTypeTest, WhenEnqueueIsDoneThenSta
srcBuffer->forceDisallowCPUCopy = true;
enqueueWriteBuffer<FamilyType>();
auto &ultCsr = this->pDevice->getUltCommandStreamReceiver<FamilyType>();
auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily);
validateStateBaseAddress<FamilyType>(ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, pIOH->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()),
ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo())),
pDSH, pIOH, pSSH, itorPipelineSelect, itorWalker, cmdList, 0llu);
}

View File

@ -108,7 +108,11 @@ HWTEST_F(EnqueueWriteImageTest, WhenWritingImageThenL3ProgrammingIsCorrect) {
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueWriteImageTest, WhenEnqueueIsDoneThenStateBaseAddressIsProperlyProgrammed) {
enqueueWriteImage<FamilyType>();
auto &ultCsr = this->pDevice->getUltCommandStreamReceiver<FamilyType>();
auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily);
validateStateBaseAddress<FamilyType>(ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, pIOH->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()),
ultCsr.getMemoryManager()->getInternalHeapBaseAddress(ultCsr.rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo())),
pDSH, pIOH, pSSH, itorPipelineSelect, itorWalker, cmdList, 0llu);
}

View File

@ -517,8 +517,11 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, stateBaseAddres
ASSERT_NE(nullptr, cmdStateBaseAddress);
auto &cmd = *reinterpret_cast<STATE_BASE_ADDRESS *>(cmdStateBaseAddress);
auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily);
auto instructionHeapBaseAddress = commandStreamReceiver.getMemoryManager()->getInternalHeapBaseAddress(commandStreamReceiver.rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo()));
EXPECT_EQ(dsh.getCpuBase(), reinterpret_cast<void *>(cmd.getDynamicStateBaseAddress()));
EXPECT_EQ(commandStreamReceiver.getMemoryManager()->getInternalHeapBaseAddress(commandStreamReceiver.rootDeviceIndex, ioh.getGraphicsAllocation()->isAllocatedInLocalMemoryPool()), cmd.getInstructionBaseAddress());
EXPECT_EQ(instructionHeapBaseAddress, cmd.getInstructionBaseAddress());
EXPECT_EQ(ioh.getCpuBase(), reinterpret_cast<void *>(cmd.getIndirectObjectBaseAddress()));
EXPECT_EQ(ssh.getCpuBase(), reinterpret_cast<void *>(cmd.getSurfaceStateBaseAddress()));

View File

@ -1134,7 +1134,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenCsrInNonDi
EXPECT_EQ(0u, surfacesForResidency.size());
}
HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrWhenGeneralStateBaseAddressIsProgrammedThenDecanonizedAddressIsWritten) {
HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenCsrWhenGeneralStateBaseAddressIsProgrammedThenDecanonizedAddressIsWritten) {
uint64_t generalStateBaseAddress = 0xffff800400010000ull;
DispatchFlags dispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags();
@ -1147,6 +1147,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrWhenGeneralStateBaseAddres
generalStateBaseAddress,
true,
0,
0,
generalStateBaseAddress,
true,
pDevice->getGmmHelper(),
@ -1167,6 +1168,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenNonZeroGeneralStateBaseAddres
generalStateBaseAddress,
false,
0,
0,
generalStateBaseAddress,
true,
pDevice->getGmmHelper(),
@ -1190,6 +1192,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenNonZeroInternalHeapBaseAddres
true,
0,
internalHeapBaseAddress,
0,
false,
pDevice->getGmmHelper(),
false);
@ -1205,6 +1208,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenSbaProgram
DispatchFlags dispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags();
uint64_t internalHeapBase = 0x10000;
uint64_t instructionHeapBase = 0x10000;
uint64_t generalStateBase = 0x30000;
typename FamilyType::STATE_BASE_ADDRESS sbaCmd;
@ -1216,6 +1220,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenSbaProgram
true,
0,
internalHeapBase,
instructionHeapBase,
true,
pDevice->getGmmHelper(),
false);
@ -1234,7 +1239,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenSbaProgram
EXPECT_EQ(0u, sbaCmd.getSurfaceStateBaseAddress());
EXPECT_TRUE(sbaCmd.getInstructionBaseAddressModifyEnable());
EXPECT_EQ(internalHeapBase, sbaCmd.getInstructionBaseAddress());
EXPECT_EQ(instructionHeapBase, sbaCmd.getInstructionBaseAddress());
EXPECT_TRUE(sbaCmd.getInstructionBufferSizeModifyEnable());
EXPECT_EQ(MemoryConstants::sizeOf4GBinPageEntities, sbaCmd.getInstructionBufferSize());

View File

@ -19,7 +19,9 @@
namespace NEO {
template <typename FamilyType>
void validateStateBaseAddress(uint64_t internalHeapBase, IndirectHeap *pDSH,
void validateStateBaseAddress(uint64_t indirectObjectHeapBase,
uint64_t instructionHeapBaseAddress,
IndirectHeap *pDSH,
IndirectHeap *pIOH,
IndirectHeap *pSSH,
GenCmdList::iterator &startCommand,
@ -45,7 +47,7 @@ void validateStateBaseAddress(uint64_t internalHeapBase, IndirectHeap *pDSH,
EXPECT_EQ(expectedGeneralStateHeapBaseAddress, cmd->getGeneralStateBaseAddress());
EXPECT_EQ(pSSH->getGraphicsAllocation()->getGpuAddress(), cmd->getSurfaceStateBaseAddress());
EXPECT_EQ(pIOH->getGraphicsAllocation()->getGpuBaseAddress(), cmd->getIndirectObjectBaseAddress());
EXPECT_EQ(internalHeapBase, cmd->getInstructionBaseAddress());
EXPECT_EQ(instructionHeapBaseAddress, cmd->getInstructionBaseAddress());
// Verify all sizes are getting programmed
EXPECT_TRUE(cmd->getDynamicStateBufferSizeModifyEnable());

View File

@ -994,10 +994,14 @@ TEST(HwInfoConfigCommonHelperTest, givenBlitterPreferenceWhenEnablingBlitterOper
EXPECT_EQ(expectedBlitterSupport, hardwareInfo.capabilityTable.blitterOperationsSupported);
}
HWTEST_F(HwHelperTest, givenHwHelperWhenAskingForIsaSystemMemoryPlacementThenReturnFalse) {
HWTEST_F(HwHelperTest, givenHwHelperWhenAskingForIsaSystemMemoryPlacementThenReturnFalseIfLocalMemorySupported) {
HwHelper &hwHelper = HwHelper::get(hardwareInfo.platform.eRenderCoreFamily);
hardwareInfo.featureTable.ftrLocalMemory = true;
EXPECT_FALSE(hwHelper.useSystemMemoryPlacementForISA(hardwareInfo));
hardwareInfo.featureTable.ftrLocalMemory = false;
EXPECT_TRUE(hwHelper.useSystemMemoryPlacementForISA(hardwareInfo));
}
TEST(HwInfoConfigCommonHelperTest, givenDebugFlagSetWhenEnablingBlitterOperationsSupportThenHonorTheFlag) {

View File

@ -633,7 +633,7 @@ HWTEST_F(GetAllocationDataTestHw, givenKernelIsaTypeWhenGetAllocationDataIsCalle
MockMemoryManager mockMemoryManager;
AllocationProperties properties{mockRootDeviceIndex, 1, GraphicsAllocation::AllocationType::KERNEL_ISA, mockDeviceBitfield};
mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties));
EXPECT_FALSE(allocData.flags.useSystemMemory);
EXPECT_NE(defaultHwInfo->featureTable.ftrLocalMemory, allocData.flags.useSystemMemory);
}
HWTEST_F(GetAllocationDataTestHw, givenLinearStreamWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequested) {

View File

@ -87,7 +87,11 @@ ErrorCode CommandContainer::initialize(Device *device) {
indirectHeaps[i] = std::make_unique<IndirectHeap>(allocationIndirectHeaps[i], requireInternalHeap);
}
instructionHeapBaseAddress = device->getMemoryManager()->getInternalHeapBaseAddress(device->getRootDeviceIndex(), allocationIndirectHeaps[IndirectHeap::Type::INDIRECT_OBJECT]->isAllocatedInLocalMemoryPool());
auto &hwHelper = HwHelper::get(getDevice()->getHardwareInfo().platform.eRenderCoreFamily);
indirectObjectHeapBaseAddress = device->getMemoryManager()->getInternalHeapBaseAddress(device->getRootDeviceIndex(), allocationIndirectHeaps[IndirectHeap::Type::INDIRECT_OBJECT]->isAllocatedInLocalMemoryPool());
instructionHeapBaseAddress = device->getMemoryManager()->getInternalHeapBaseAddress(device->getRootDeviceIndex(), !hwHelper.useSystemMemoryPlacementForISA(getDevice()->getHardwareInfo()));
reserveBindlessOffsets(*indirectHeaps[IndirectHeap::Type::SURFACE_STATE]);

View File

@ -74,6 +74,8 @@ class CommandContainer : public NonCopyableOrMovableClass {
uint64_t getInstructionHeapBaseAddress() const { return instructionHeapBaseAddress; }
uint64_t getIndirectObjectHeapBaseAddress() const { return indirectObjectHeapBaseAddress; }
void *getHeapSpaceAllowGrow(HeapType heapType, size_t size);
ErrorCode initialize(Device *device);
@ -108,6 +110,7 @@ class CommandContainer : public NonCopyableOrMovableClass {
CmdBufferContainer cmdBufferAllocations;
GraphicsAllocation *allocationIndirectHeaps[HeapType::NUM_TYPES] = {};
uint64_t instructionHeapBaseAddress = 0u;
uint64_t indirectObjectHeapBaseAddress = 0u;
uint32_t dirtyHeaps = std::numeric_limits<uint32_t>::max();
uint32_t numIddsPerBlock = 64;

View File

@ -351,6 +351,7 @@ void EncodeStateBaseAddress<Family>::encode(CommandContainer &container, STATE_B
0,
false,
(gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER) >> 1),
container.getIndirectObjectHeapBaseAddress(),
container.getInstructionHeapBaseAddress(),
false,
gmmHelper,

View File

@ -342,9 +342,9 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
auto isStateBaseAddressDirty = dshDirty || iohDirty || sshDirty || stateBaseAddressDirty;
auto mocsIndex = latestSentStatelessMocsConfig;
auto &hwHelper = HwHelper::get(peekHwInfo().platform.eRenderCoreFamily);
if (dispatchFlags.l3CacheSettings != L3CachingSettings::NotApplicable) {
auto &hwHelper = HwHelper::get(peekHwInfo().platform.eRenderCoreFamily);
auto l3On = dispatchFlags.l3CacheSettings != L3CachingSettings::l3CacheOff;
auto l1On = dispatchFlags.l3CacheSettings == L3CachingSettings::l3AndL1On;
mocsIndex = hwHelper.getMocsIndex(*device.getGmmHelper(), l3On, l1On);
@ -375,6 +375,7 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
auto stateBaseAddressCmdOffset = commandStreamCSR.getUsed();
auto pCmd = static_cast<STATE_BASE_ADDRESS *>(commandStreamCSR.getSpace(sizeof(STATE_BASE_ADDRESS)));
STATE_BASE_ADDRESS cmd;
auto instructionHeapBaseAddress = getMemoryManager()->getInternalHeapBaseAddress(rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(peekHwInfo()));
StateBaseAddressHelper<GfxFamily>::programStateBaseAddress(
&cmd,
&dsh,
@ -384,6 +385,7 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
true,
mocsIndex,
getMemoryManager()->getInternalHeapBaseAddress(rootDeviceIndex, ioh.getGraphicsAllocation()->isAllocatedInLocalMemoryPool()),
instructionHeapBaseAddress,
true,
device.getGmmHelper(),
isMultiOsContextCapable());

View File

@ -494,6 +494,6 @@ bool HwHelperHw<GfxFamily>::useOnlyGlobalTimestamps() const {
template <typename GfxFamily>
bool HwHelperHw<GfxFamily>::useSystemMemoryPlacementForISA(const HardwareInfo &hwInfo) const {
return false;
return !hwInfo.featureTable.ftrLocalMemory;
}
} // namespace NEO

View File

@ -28,7 +28,8 @@ struct StateBaseAddressHelper {
uint64_t generalStateBase,
bool setGeneralStateBaseAddress,
uint32_t statelessMocsIndex,
uint64_t internalHeapBase,
uint64_t indirectObjectHeapBaseAddress,
uint64_t instructionHeapBaseAddress,
bool setInstructionStateBaseAddress,
GmmHelper *gmmHelper,
bool isMultiOsContextCapable);
@ -37,7 +38,7 @@ struct StateBaseAddressHelper {
STATE_BASE_ADDRESS *stateBaseAddress,
const IndirectHeap *ssh,
bool setGeneralStateBaseAddress,
uint64_t internalHeapBase,
uint64_t indirectObjectHeapBaseAddress,
GmmHelper *gmmHelper,
bool isMultiOsContextCapable);

View File

@ -23,7 +23,8 @@ void StateBaseAddressHelper<GfxFamily>::programStateBaseAddress(
uint64_t generalStateBase,
bool setGeneralStateBaseAddress,
uint32_t statelessMocsIndex,
uint64_t internalHeapBase,
uint64_t indirectObjectHeapBaseAddress,
uint64_t instructionHeapBaseAddress,
bool setInstructionStateBaseAddress,
GmmHelper *gmmHelper,
bool isMultiOsContextCapable) {
@ -51,7 +52,7 @@ void StateBaseAddressHelper<GfxFamily>::programStateBaseAddress(
if (setInstructionStateBaseAddress) {
stateBaseAddress->setInstructionBaseAddressModifyEnable(true);
stateBaseAddress->setInstructionBaseAddress(internalHeapBase);
stateBaseAddress->setInstructionBaseAddress(instructionHeapBaseAddress);
stateBaseAddress->setInstructionBufferSizeModifyEnable(true);
stateBaseAddress->setInstructionBufferSize(MemoryConstants::sizeOf4GBinPageEntities);
stateBaseAddress->setInstructionMemoryObjectControlState(gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_STATE_HEAP_BUFFER));
@ -73,7 +74,7 @@ void StateBaseAddressHelper<GfxFamily>::programStateBaseAddress(
stateBaseAddress->setStatelessDataPortAccessMemoryObjectControlState(statelessMocsIndex);
appendStateBaseAddressParameters(stateBaseAddress, ssh, setGeneralStateBaseAddress, internalHeapBase, gmmHelper, isMultiOsContextCapable);
appendStateBaseAddressParameters(stateBaseAddress, ssh, setGeneralStateBaseAddress, indirectObjectHeapBaseAddress, gmmHelper, isMultiOsContextCapable);
}
} // namespace NEO

View File

@ -14,7 +14,7 @@ void StateBaseAddressHelper<GfxFamily>::appendStateBaseAddressParameters(
STATE_BASE_ADDRESS *stateBaseAddress,
const IndirectHeap *ssh,
bool setGeneralStateBaseAddress,
uint64_t internalHeapBase,
uint64_t indirectObjectHeapBaseAddress,
GmmHelper *gmmHelper,
bool isMultiOsContextCapable) {
}

View File

@ -14,7 +14,7 @@ void StateBaseAddressHelper<GfxFamily>::appendStateBaseAddressParameters(
STATE_BASE_ADDRESS *stateBaseAddress,
const IndirectHeap *ssh,
bool setGeneralStateBaseAddress,
uint64_t internalHeapBase,
uint64_t indirectObjectHeapBaseAddress,
GmmHelper *gmmHelper,
bool isMultiOsContextCapable) {

View File

@ -127,8 +127,11 @@ TEST_F(CommandContainerTest, givenCommandContainerWhenInitializeThenEverythingIs
auto heapAllocation = cmdContainer.getIndirectHeapAllocation(static_cast<HeapType>(i));
EXPECT_EQ(indirectHeap->getGraphicsAllocation(), heapAllocation);
}
auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily);
EXPECT_EQ(cmdContainer.getInstructionHeapBaseAddress(),
pDevice->getMemoryManager()->getInternalHeapBaseAddress(0, cmdContainer.getIndirectHeap(HeapType::INDIRECT_OBJECT)->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()));
pDevice->getMemoryManager()->getInternalHeapBaseAddress(0, !hwHelper.useSystemMemoryPlacementForISA(pDevice->getHardwareInfo())));
}
TEST_F(CommandContainerTest, givenCommandContainerWhenInitializeWithoutDeviceThenReturnedFalse) {
@ -497,15 +500,18 @@ TEST_F(CommandContainerHeaps, givenCommandContainerForDifferentRootDevicesThenIn
auto device0 = std::unique_ptr<MockDevice>(Device::create<MockDevice>(executionEnvironment, 0u));
auto device1 = std::unique_ptr<MockDevice>(Device::create<MockDevice>(executionEnvironment, 1u));
auto &hwHelper0 = HwHelper::get(device0->getHardwareInfo().platform.eRenderCoreFamily);
auto &hwHelper1 = HwHelper::get(device1->getHardwareInfo().platform.eRenderCoreFamily);
CommandContainer cmdContainer0;
cmdContainer0.initialize(device0.get());
bool useLocalMemory0 = cmdContainer0.getIndirectHeap(HeapType::INDIRECT_OBJECT)->getGraphicsAllocation()->isAllocatedInLocalMemoryPool();
bool useLocalMemory0 = !hwHelper0.useSystemMemoryPlacementForISA(device0->getHardwareInfo());
uint64_t baseAddressHeapDevice0 = device0.get()->getMemoryManager()->getInternalHeapBaseAddress(device0->getRootDeviceIndex(), useLocalMemory0);
EXPECT_EQ(cmdContainer0.getInstructionHeapBaseAddress(), baseAddressHeapDevice0);
CommandContainer cmdContainer1;
cmdContainer1.initialize(device1.get());
bool useLocalMemory1 = cmdContainer0.getIndirectHeap(HeapType::INDIRECT_OBJECT)->getGraphicsAllocation()->isAllocatedInLocalMemoryPool();
bool useLocalMemory1 = !hwHelper1.useSystemMemoryPlacementForISA(device0->getHardwareInfo());
uint64_t baseAddressHeapDevice1 = device1.get()->getMemoryManager()->getInternalHeapBaseAddress(device1->getRootDeviceIndex(), useLocalMemory1);
EXPECT_EQ(cmdContainer1.getInstructionHeapBaseAddress(), baseAddressHeapDevice1);
}

View File

@ -55,6 +55,7 @@ HWTEST2_F(SBATest, WhenProgramStateBaseAddressParametersIsCalledThenSBACmdHasBin
false,
0,
0,
0,
false,
pDevice->getGmmHelper(),
true);