diff --git a/level_zero/core/source/cmdlist/cmdlist_hw.h b/level_zero/core/source/cmdlist/cmdlist_hw.h index 7e13ded1fa..57261beb05 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw.h +++ b/level_zero/core/source/cmdlist/cmdlist_hw.h @@ -32,6 +32,7 @@ struct CommandListCoreFamily : CommandListImp { using BaseClass = CommandListImp; using GfxFamily = typename NEO::GfxFamilyMapper::GfxFamily; using INTERFACE_DESCRIPTOR_DATA = typename GfxFamily::INTERFACE_DESCRIPTOR_DATA; + using STATE_BASE_ADDRESS = typename GfxFamily::STATE_BASE_ADDRESS; using CommandListImp::CommandListImp; diff --git a/level_zero/core/source/cmdlist/cmdlist_hw.inl b/level_zero/core/source/cmdlist/cmdlist_hw.inl index 43d7374a9e..ec25689c43 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw.inl @@ -1499,7 +1499,8 @@ void CommandListCoreFamily::programStateBaseAddress(NEO::CommandC args.textureCacheInvalidationEnable = true; NEO::MemorySynchronizationCommands::addPipeControl(*commandContainer.getCommandStream(), args); - NEO::EncodeStateBaseAddress::encode(commandContainer); + STATE_BASE_ADDRESS sba; + NEO::EncodeStateBaseAddress::encode(commandContainer, sba); if (device->getL0Debugger()) { device->getL0Debugger()->captureStateBaseAddress(commandContainer); } diff --git a/level_zero/core/source/cmdqueue/cmdqueue_hw_base.inl b/level_zero/core/source/cmdqueue/cmdqueue_hw_base.inl index 09d095665e..43cbb04983 100644 --- a/level_zero/core/source/cmdqueue/cmdqueue_hw_base.inl +++ b/level_zero/core/source/cmdqueue/cmdqueue_hw_base.inl @@ -45,7 +45,10 @@ void CommandQueueHw::programGeneralStateBaseAddress(uint64_t gsba NEO::Device *neoDevice = device->getNEODevice(); NEO::EncodeWA::encodeAdditionalPipelineSelect(*neoDevice, commandStream, true); - NEO::StateBaseAddressHelper::programStateBaseAddress(commandStream, + auto pSbaCmd = static_cast(commandStream.getSpace(sizeof(STATE_BASE_ADDRESS))); + STATE_BASE_ADDRESS sbaCmd; + + NEO::StateBaseAddressHelper::programStateBaseAddress(&sbaCmd, nullptr, nullptr, nullptr, @@ -56,7 +59,7 @@ void CommandQueueHw::programGeneralStateBaseAddress(uint64_t gsba true, neoDevice->getGmmHelper(), false); - + *pSbaCmd = sbaCmd; gsbaInit = true; if (device->getL0Debugger()) { diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp index 4b117b2645..9e8ae88f01 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp @@ -1139,7 +1139,8 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrWhenGeneralStateBaseAddres DispatchFlags dispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags(); - StateBaseAddressHelper::programStateBaseAddress(commandStream, + typename FamilyType::STATE_BASE_ADDRESS sbaCmd; + StateBaseAddressHelper::programStateBaseAddress(&sbaCmd, &dsh, &ioh, &ssh, @@ -1151,18 +1152,15 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrWhenGeneralStateBaseAddres pDevice->getGmmHelper(), false); - HardwareParse hwParser; - hwParser.parseCommands(commandStream); - auto cmd = hwParser.getCommand(); - - EXPECT_NE(generalStateBaseAddress, cmd->getGeneralStateBaseAddress()); - EXPECT_EQ(GmmHelper::decanonize(generalStateBaseAddress), cmd->getGeneralStateBaseAddress()); + EXPECT_NE(generalStateBaseAddress, sbaCmd.getGeneralStateBaseAddress()); + EXPECT_EQ(GmmHelper::decanonize(generalStateBaseAddress), sbaCmd.getGeneralStateBaseAddress()); } HWTEST_F(CommandStreamReceiverFlushTaskTests, givenNonZeroGeneralStateBaseAddressWhenProgrammingIsDisabledThenExpectCommandValueZero) { uint64_t generalStateBaseAddress = 0x80010000ull; - StateBaseAddressHelper::programStateBaseAddress(commandStream, + typename FamilyType::STATE_BASE_ADDRESS sbaCmd; + StateBaseAddressHelper::programStateBaseAddress(&sbaCmd, &dsh, &ioh, &ssh, @@ -1174,20 +1172,17 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenNonZeroGeneralStateBaseAddres pDevice->getGmmHelper(), false); - HardwareParse hwParser; - hwParser.parseCommands(commandStream); - auto cmd = hwParser.getCommand(); - - EXPECT_EQ(0ull, cmd->getGeneralStateBaseAddress()); - EXPECT_EQ(0u, cmd->getGeneralStateBufferSize()); - EXPECT_FALSE(cmd->getGeneralStateBaseAddressModifyEnable()); - EXPECT_FALSE(cmd->getGeneralStateBufferSizeModifyEnable()); + EXPECT_EQ(0ull, sbaCmd.getGeneralStateBaseAddress()); + EXPECT_EQ(0u, sbaCmd.getGeneralStateBufferSize()); + EXPECT_FALSE(sbaCmd.getGeneralStateBaseAddressModifyEnable()); + EXPECT_FALSE(sbaCmd.getGeneralStateBufferSizeModifyEnable()); } HWTEST_F(CommandStreamReceiverFlushTaskTests, givenNonZeroInternalHeapBaseAddressWhenProgrammingIsDisabledThenExpectCommandValueZero) { uint64_t internalHeapBaseAddress = 0x80010000ull; - StateBaseAddressHelper::programStateBaseAddress(commandStream, + typename FamilyType::STATE_BASE_ADDRESS sbaCmd; + StateBaseAddressHelper::programStateBaseAddress(&sbaCmd, &dsh, &ioh, &ssh, @@ -1199,15 +1194,11 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenNonZeroInternalHeapBaseAddres pDevice->getGmmHelper(), false); - HardwareParse hwParser; - hwParser.parseCommands(commandStream); - auto cmd = hwParser.getCommand(); - - EXPECT_FALSE(cmd->getInstructionBaseAddressModifyEnable()); - EXPECT_EQ(0ull, cmd->getInstructionBaseAddress()); - EXPECT_FALSE(cmd->getInstructionBufferSizeModifyEnable()); - EXPECT_EQ(0u, cmd->getInstructionBufferSize()); - EXPECT_EQ(0u, cmd->getInstructionMemoryObjectControlState()); + EXPECT_FALSE(sbaCmd.getInstructionBaseAddressModifyEnable()); + EXPECT_EQ(0ull, sbaCmd.getInstructionBaseAddress()); + EXPECT_FALSE(sbaCmd.getInstructionBufferSizeModifyEnable()); + EXPECT_EQ(0u, sbaCmd.getInstructionBufferSize()); + EXPECT_EQ(0u, sbaCmd.getInstructionMemoryObjectControlState()); } HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenSbaProgrammingWhenHeapsAreNotProvidedThenDontProgram) { @@ -1215,8 +1206,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenSbaProgram uint64_t internalHeapBase = 0x10000; uint64_t generalStateBase = 0x30000; + typename FamilyType::STATE_BASE_ADDRESS sbaCmd; - StateBaseAddressHelper::programStateBaseAddress(commandStream, + StateBaseAddressHelper::programStateBaseAddress(&sbaCmd, nullptr, nullptr, nullptr, @@ -1228,30 +1220,26 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenSbaProgram pDevice->getGmmHelper(), false); - HardwareParse hwParser; - hwParser.parseCommands(commandStream); - auto cmd = hwParser.getCommand(); + EXPECT_FALSE(sbaCmd.getDynamicStateBaseAddressModifyEnable()); + EXPECT_FALSE(sbaCmd.getDynamicStateBufferSizeModifyEnable()); + EXPECT_EQ(0u, sbaCmd.getDynamicStateBaseAddress()); + EXPECT_EQ(0u, sbaCmd.getDynamicStateBufferSize()); - EXPECT_FALSE(cmd->getDynamicStateBaseAddressModifyEnable()); - EXPECT_FALSE(cmd->getDynamicStateBufferSizeModifyEnable()); - EXPECT_EQ(0u, cmd->getDynamicStateBaseAddress()); - EXPECT_EQ(0u, cmd->getDynamicStateBufferSize()); + EXPECT_FALSE(sbaCmd.getIndirectObjectBaseAddressModifyEnable()); + EXPECT_FALSE(sbaCmd.getIndirectObjectBufferSizeModifyEnable()); + EXPECT_EQ(0u, sbaCmd.getIndirectObjectBaseAddress()); + EXPECT_EQ(0u, sbaCmd.getIndirectObjectBufferSize()); - EXPECT_FALSE(cmd->getIndirectObjectBaseAddressModifyEnable()); - EXPECT_FALSE(cmd->getIndirectObjectBufferSizeModifyEnable()); - EXPECT_EQ(0u, cmd->getIndirectObjectBaseAddress()); - EXPECT_EQ(0u, cmd->getIndirectObjectBufferSize()); + EXPECT_FALSE(sbaCmd.getSurfaceStateBaseAddressModifyEnable()); + EXPECT_EQ(0u, sbaCmd.getSurfaceStateBaseAddress()); - EXPECT_FALSE(cmd->getSurfaceStateBaseAddressModifyEnable()); - EXPECT_EQ(0u, cmd->getSurfaceStateBaseAddress()); + EXPECT_TRUE(sbaCmd.getInstructionBaseAddressModifyEnable()); + EXPECT_EQ(internalHeapBase, sbaCmd.getInstructionBaseAddress()); + EXPECT_TRUE(sbaCmd.getInstructionBufferSizeModifyEnable()); + EXPECT_EQ(MemoryConstants::sizeOf4GBinPageEntities, sbaCmd.getInstructionBufferSize()); - EXPECT_TRUE(cmd->getInstructionBaseAddressModifyEnable()); - EXPECT_EQ(internalHeapBase, cmd->getInstructionBaseAddress()); - EXPECT_TRUE(cmd->getInstructionBufferSizeModifyEnable()); - EXPECT_EQ(MemoryConstants::sizeOf4GBinPageEntities, cmd->getInstructionBufferSize()); - - EXPECT_TRUE(cmd->getGeneralStateBaseAddressModifyEnable()); - EXPECT_TRUE(cmd->getGeneralStateBufferSizeModifyEnable()); - EXPECT_EQ(GmmHelper::decanonize(generalStateBase), cmd->getGeneralStateBaseAddress()); - EXPECT_EQ(0xfffffu, cmd->getGeneralStateBufferSize()); + EXPECT_TRUE(sbaCmd.getGeneralStateBaseAddressModifyEnable()); + EXPECT_TRUE(sbaCmd.getGeneralStateBufferSizeModifyEnable()); + EXPECT_EQ(GmmHelper::decanonize(generalStateBase), sbaCmd.getGeneralStateBaseAddress()); + EXPECT_EQ(0xfffffu, sbaCmd.getGeneralStateBufferSize()); } diff --git a/shared/source/command_container/command_encoder.h b/shared/source/command_container/command_encoder.h index 5fffd01992..0f59d735ba 100644 --- a/shared/source/command_container/command_encoder.h +++ b/shared/source/command_container/command_encoder.h @@ -169,7 +169,8 @@ struct EncodeMediaInterfaceDescriptorLoad { template struct EncodeStateBaseAddress { - static void encode(CommandContainer &container); + using STATE_BASE_ADDRESS = typename GfxFamily::STATE_BASE_ADDRESS; + static void encode(CommandContainer &container, STATE_BASE_ADDRESS &sbaCmd); }; template diff --git a/shared/source/command_container/command_encoder_base.inl b/shared/source/command_container/command_encoder_base.inl index 46e89ccac0..18d39d1d9c 100644 --- a/shared/source/command_container/command_encoder_base.inl +++ b/shared/source/command_container/command_encoder_base.inl @@ -31,6 +31,7 @@ void EncodeDispatchKernel::encode(CommandContainer &container, using MEDIA_STATE_FLUSH = typename Family::MEDIA_STATE_FLUSH; using MEDIA_INTERFACE_DESCRIPTOR_LOAD = typename Family::MEDIA_INTERFACE_DESCRIPTOR_LOAD; using MI_BATCH_BUFFER_END = typename Family::MI_BATCH_BUFFER_END; + using STATE_BASE_ADDRESS = typename Family::STATE_BASE_ADDRESS; auto &kernelDescriptor = dispatchInterface->getKernelDescriptor(); auto sizeCrossThreadData = dispatchInterface->getCrossThreadDataSize(); @@ -170,7 +171,8 @@ void EncodeDispatchKernel::encode(CommandContainer &container, MemorySynchronizationCommands::addPipeControl(*container.getCommandStream(), args); if (dirtyHeaps) { - EncodeStateBaseAddress::encode(container); + STATE_BASE_ADDRESS sba; + EncodeStateBaseAddress::encode(container, sba); container.setDirtyStateForAllHeaps(false); } @@ -337,13 +339,13 @@ size_t EncodeDispatchKernel::estimateEncodeDispatchKernelCmdsSize(Device } template -void EncodeStateBaseAddress::encode(CommandContainer &container) { +void EncodeStateBaseAddress::encode(CommandContainer &container, STATE_BASE_ADDRESS &sbaCmd) { EncodeWA::encodeAdditionalPipelineSelect(*container.getDevice(), *container.getCommandStream(), true); auto gmmHelper = container.getDevice()->getGmmHelper(); StateBaseAddressHelper::programStateBaseAddress( - *container.getCommandStream(), + &sbaCmd, container.isHeapDirty(HeapType::DYNAMIC_STATE) ? container.getIndirectHeap(HeapType::DYNAMIC_STATE) : nullptr, container.isHeapDirty(HeapType::INDIRECT_OBJECT) ? container.getIndirectHeap(HeapType::INDIRECT_OBJECT) : nullptr, container.isHeapDirty(HeapType::SURFACE_STATE) ? container.getIndirectHeap(HeapType::SURFACE_STATE) : nullptr, @@ -355,6 +357,9 @@ void EncodeStateBaseAddress::encode(CommandContainer &container) { gmmHelper, false); + auto pCmd = reinterpret_cast(container.getCommandStream()->getSpace(sizeof(STATE_BASE_ADDRESS))); + *pCmd = sbaCmd; + EncodeWA::encodeAdditionalPipelineSelect(*container.getDevice(), *container.getCommandStream(), false); } diff --git a/shared/source/command_stream/command_stream_receiver_hw_base.inl b/shared/source/command_stream/command_stream_receiver_hw_base.inl index 87b9386f71..fc858689a4 100644 --- a/shared/source/command_stream/command_stream_receiver_hw_base.inl +++ b/shared/source/command_stream/command_stream_receiver_hw_base.inl @@ -356,9 +356,10 @@ CompletionStamp CommandStreamReceiverHw::flushTask( } auto stateBaseAddressCmdOffset = commandStreamCSR.getUsed(); - + auto pCmd = static_cast(commandStreamCSR.getSpace(sizeof(STATE_BASE_ADDRESS))); + STATE_BASE_ADDRESS cmd; StateBaseAddressHelper::programStateBaseAddress( - commandStreamCSR, + &cmd, &dsh, &ioh, &ssh, @@ -369,6 +370,7 @@ CompletionStamp CommandStreamReceiverHw::flushTask( true, device.getGmmHelper(), isMultiOsContextCapable()); + *pCmd = cmd; if (sshDirty) { bindingTableBaseAddressRequired = true; diff --git a/shared/source/helpers/state_base_address.h b/shared/source/helpers/state_base_address.h index f967d439f2..624e2025f1 100644 --- a/shared/source/helpers/state_base_address.h +++ b/shared/source/helpers/state_base_address.h @@ -21,7 +21,7 @@ struct StateBaseAddressHelper { using STATE_BASE_ADDRESS = typename GfxFamily::STATE_BASE_ADDRESS; static void programStateBaseAddress( - LinearStream &commandStream, + STATE_BASE_ADDRESS *stateBaseAddress, const IndirectHeap *dsh, const IndirectHeap *ioh, const IndirectHeap *ssh, diff --git a/shared/source/helpers/state_base_address_base.inl b/shared/source/helpers/state_base_address_base.inl index b7a8dea376..ecf4041864 100644 --- a/shared/source/helpers/state_base_address_base.inl +++ b/shared/source/helpers/state_base_address_base.inl @@ -15,7 +15,7 @@ namespace NEO { template void StateBaseAddressHelper::programStateBaseAddress( - LinearStream &commandStream, + STATE_BASE_ADDRESS *stateBaseAddress, const IndirectHeap *dsh, const IndirectHeap *ioh, const IndirectHeap *ssh, @@ -27,42 +27,41 @@ void StateBaseAddressHelper::programStateBaseAddress( GmmHelper *gmmHelper, bool isMultiOsContextCapable) { - auto pCmd = static_cast(commandStream.getSpace(sizeof(STATE_BASE_ADDRESS))); - STATE_BASE_ADDRESS cmd = GfxFamily::cmdInitStateBaseAddress; + *stateBaseAddress = GfxFamily::cmdInitStateBaseAddress; if (dsh) { - cmd.setDynamicStateBaseAddressModifyEnable(true); - cmd.setDynamicStateBufferSizeModifyEnable(true); - cmd.setDynamicStateBaseAddress(dsh->getHeapGpuBase()); - cmd.setDynamicStateBufferSize(dsh->getHeapSizeInPages()); + stateBaseAddress->setDynamicStateBaseAddressModifyEnable(true); + stateBaseAddress->setDynamicStateBufferSizeModifyEnable(true); + stateBaseAddress->setDynamicStateBaseAddress(dsh->getHeapGpuBase()); + stateBaseAddress->setDynamicStateBufferSize(dsh->getHeapSizeInPages()); } if (ioh) { - cmd.setIndirectObjectBaseAddressModifyEnable(true); - cmd.setIndirectObjectBufferSizeModifyEnable(true); - cmd.setIndirectObjectBaseAddress(ioh->getHeapGpuBase()); - cmd.setIndirectObjectBufferSize(ioh->getHeapSizeInPages()); + stateBaseAddress->setIndirectObjectBaseAddressModifyEnable(true); + stateBaseAddress->setIndirectObjectBufferSizeModifyEnable(true); + stateBaseAddress->setIndirectObjectBaseAddress(ioh->getHeapGpuBase()); + stateBaseAddress->setIndirectObjectBufferSize(ioh->getHeapSizeInPages()); } if (ssh) { - cmd.setSurfaceStateBaseAddressModifyEnable(true); - cmd.setSurfaceStateBaseAddress(ssh->getHeapGpuBase()); + stateBaseAddress->setSurfaceStateBaseAddressModifyEnable(true); + stateBaseAddress->setSurfaceStateBaseAddress(ssh->getHeapGpuBase()); } if (setInstructionStateBaseAddress) { - cmd.setInstructionBaseAddressModifyEnable(true); - cmd.setInstructionBaseAddress(internalHeapBase); - cmd.setInstructionBufferSizeModifyEnable(true); - cmd.setInstructionBufferSize(MemoryConstants::sizeOf4GBinPageEntities); - cmd.setInstructionMemoryObjectControlState(gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_STATE_HEAP_BUFFER)); + stateBaseAddress->setInstructionBaseAddressModifyEnable(true); + stateBaseAddress->setInstructionBaseAddress(internalHeapBase); + stateBaseAddress->setInstructionBufferSizeModifyEnable(true); + stateBaseAddress->setInstructionBufferSize(MemoryConstants::sizeOf4GBinPageEntities); + stateBaseAddress->setInstructionMemoryObjectControlState(gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_STATE_HEAP_BUFFER)); } if (setGeneralStateBaseAddress) { - cmd.setGeneralStateBaseAddressModifyEnable(true); - cmd.setGeneralStateBufferSizeModifyEnable(true); + stateBaseAddress->setGeneralStateBaseAddressModifyEnable(true); + stateBaseAddress->setGeneralStateBufferSizeModifyEnable(true); // GSH must be set to 0 for stateless - cmd.setGeneralStateBaseAddress(GmmHelper::decanonize(generalStateBase)); - cmd.setGeneralStateBufferSize(0xfffff); + stateBaseAddress->setGeneralStateBaseAddress(GmmHelper::decanonize(generalStateBase)); + stateBaseAddress->setGeneralStateBufferSize(0xfffff); } if (DebugManager.flags.OverrideStatelessMocsIndex.get() != -1) { @@ -71,11 +70,9 @@ void StateBaseAddressHelper::programStateBaseAddress( statelessMocsIndex = statelessMocsIndex << 1; - cmd.setStatelessDataPortAccessMemoryObjectControlState(statelessMocsIndex); + stateBaseAddress->setStatelessDataPortAccessMemoryObjectControlState(statelessMocsIndex); - appendStateBaseAddressParameters(&cmd, ssh, setGeneralStateBaseAddress, internalHeapBase, gmmHelper, isMultiOsContextCapable); - - *pCmd = cmd; + appendStateBaseAddressParameters(stateBaseAddress, ssh, setGeneralStateBaseAddress, internalHeapBase, gmmHelper, isMultiOsContextCapable); } } // namespace NEO diff --git a/shared/test/unit_test/encoders/test_encode_states.cpp b/shared/test/unit_test/encoders/test_encode_states.cpp index 88b560d89c..b8010749be 100644 --- a/shared/test/unit_test/encoders/test_encode_states.cpp +++ b/shared/test/unit_test/encoders/test_encode_states.cpp @@ -112,7 +112,8 @@ HWTEST_F(CommandEncodeStatesTest, givenCommandContainerWithDirtyHeapsWhenSetStat cmdContainer->setHeapDirty(NEO::HeapType::INDIRECT_OBJECT); cmdContainer->setHeapDirty(NEO::HeapType::SURFACE_STATE); - EncodeStateBaseAddress::encode(*cmdContainer.get()); + STATE_BASE_ADDRESS sba; + EncodeStateBaseAddress::encode(*cmdContainer.get(), sba); auto dsh = cmdContainer->getIndirectHeap(NEO::HeapType::DYNAMIC_STATE); auto ioh = cmdContainer->getIndirectHeap(NEO::HeapType::INDIRECT_OBJECT); @@ -127,13 +128,18 @@ HWTEST_F(CommandEncodeStatesTest, givenCommandContainerWithDirtyHeapsWhenSetStat EXPECT_EQ(dsh->getHeapGpuBase(), pCmd->getDynamicStateBaseAddress()); EXPECT_EQ(ioh->getHeapGpuBase(), pCmd->getIndirectObjectBaseAddress()); EXPECT_EQ(ssh->getHeapGpuBase(), pCmd->getSurfaceStateBaseAddress()); + + EXPECT_EQ(sba.getDynamicStateBaseAddress(), pCmd->getDynamicStateBaseAddress()); + EXPECT_EQ(sba.getIndirectObjectBaseAddress(), pCmd->getIndirectObjectBaseAddress()); + EXPECT_EQ(sba.getSurfaceStateBaseAddress(), pCmd->getSurfaceStateBaseAddress()); } HWTEST_F(CommandEncodeStatesTest, givenCommandContainerWhenSetStateBaseAddressCalledThenStateBaseAddressIsSetCorrectly) { using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS; cmdContainer->dirtyHeaps = 0; - EncodeStateBaseAddress::encode(*cmdContainer.get()); + STATE_BASE_ADDRESS sba; + EncodeStateBaseAddress::encode(*cmdContainer.get(), sba); auto dsh = cmdContainer->getIndirectHeap(NEO::HeapType::DYNAMIC_STATE); auto ssh = cmdContainer->getIndirectHeap(NEO::HeapType::SURFACE_STATE); diff --git a/shared/test/unit_test/gen12lp/test_command_encoder_gen12lp.cpp b/shared/test/unit_test/gen12lp/test_command_encoder_gen12lp.cpp index 73a3e14587..2c4129400b 100644 --- a/shared/test/unit_test/gen12lp/test_command_encoder_gen12lp.cpp +++ b/shared/test/unit_test/gen12lp/test_command_encoder_gen12lp.cpp @@ -72,6 +72,7 @@ struct MockOsContext : public OsContext { GEN12LPTEST_F(CommandEncoderTest, givenVariousEngineTypesWhenEncodeSBAThenAdditionalPipelineSelectWAIsAppliedOnlyToRcs) { using PIPELINE_SELECT = typename FamilyType::PIPELINE_SELECT; using STATE_COMPUTE_MODE = typename FamilyType::STATE_COMPUTE_MODE; + using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS; CommandContainer cmdContainer; @@ -79,7 +80,8 @@ GEN12LPTEST_F(CommandEncoderTest, givenVariousEngineTypesWhenEncodeSBAThenAdditi ASSERT_TRUE(ret); { - EncodeStateBaseAddress::encode(cmdContainer); + STATE_BASE_ADDRESS sba; + EncodeStateBaseAddress::encode(cmdContainer, sba); GenCmdList commands; CmdParse::parseCommandBuffer(commands, ptrOffset(cmdContainer.getCommandStream()->getCpuBase(), 0), cmdContainer.getCommandStream()->getUsed()); @@ -92,7 +94,8 @@ GEN12LPTEST_F(CommandEncoderTest, givenVariousEngineTypesWhenEncodeSBAThenAdditi { static_cast(pDevice->getDefaultEngine().osContext)->engineType = aub_stream::ENGINE_CCS; - EncodeStateBaseAddress::encode(cmdContainer); + STATE_BASE_ADDRESS sba; + EncodeStateBaseAddress::encode(cmdContainer, sba); GenCmdList commands; CmdParse::parseCommandBuffer(commands, ptrOffset(cmdContainer.getCommandStream()->getCpuBase(), 0), cmdContainer.getCommandStream()->getUsed()); diff --git a/shared/test/unit_test/helpers/state_base_address_tests.cpp b/shared/test/unit_test/helpers/state_base_address_tests.cpp index 568f2d550d..a7ea12a7cc 100644 --- a/shared/test/unit_test/helpers/state_base_address_tests.cpp +++ b/shared/test/unit_test/helpers/state_base_address_tests.cpp @@ -47,7 +47,7 @@ HWTEST2_F(SBATest, WhenProgramStateBaseAddressParametersIsCalledThenSBACmdHasBin *cmd = stateBaseAddress; StateBaseAddressHelper::programStateBaseAddress( - commandStream, + cmd, nullptr, nullptr, &ssh,