diff --git a/level_zero/core/source/cmdlist/cmdlist_hw.inl b/level_zero/core/source/cmdlist/cmdlist_hw.inl index 8f738eac68..af59ec8c2e 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw.inl @@ -2236,7 +2236,7 @@ void CommandListCoreFamily::programStateBaseAddress(NEO::CommandC sbaAddresses.BindlessSurfaceStateBaseAddress = sba.getBindlessSurfaceStateBaseAddress(); sbaAddresses.DynamicStateBaseAddress = sba.getDynamicStateBaseAddress(); sbaAddresses.GeneralStateBaseAddress = sba.getGeneralStateBaseAddress(); - sbaAddresses.IndirectObjectBaseAddress = sba.getIndirectObjectBaseAddress(); + NEO::EncodeStateBaseAddress::setIohAddressForDebugger(sbaAddresses, sba); sbaAddresses.InstructionBaseAddress = sba.getInstructionBaseAddress(); sbaAddresses.SurfaceStateBaseAddress = sba.getSurfaceStateBaseAddress(); diff --git a/level_zero/core/source/cmdqueue/cmdqueue_xe_hp_core_and_later.inl b/level_zero/core/source/cmdqueue/cmdqueue_xe_hp_core_and_later.inl index 464642a525..e263c72cab 100644 --- a/level_zero/core/source/cmdqueue/cmdqueue_xe_hp_core_and_later.inl +++ b/level_zero/core/source/cmdqueue/cmdqueue_xe_hp_core_and_later.inl @@ -64,7 +64,6 @@ void CommandQueueHw::programStateBaseAddress(uint64_t gsba, bool sbaAddresses.BindlessSurfaceStateBaseAddress = sbaCmd.getBindlessSurfaceStateBaseAddress(); sbaAddresses.DynamicStateBaseAddress = sbaCmd.getDynamicStateBaseAddress(); sbaAddresses.GeneralStateBaseAddress = sbaCmd.getGeneralStateBaseAddress(); - sbaAddresses.IndirectObjectBaseAddress = sbaCmd.getIndirectObjectBaseAddress(); sbaAddresses.InstructionBaseAddress = sbaCmd.getInstructionBaseAddress(); sbaAddresses.SurfaceStateBaseAddress = sbaCmd.getSurfaceStateBaseAddress(); diff --git a/opencl/test/unit_test/command_queue/enqueue_handler_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_handler_tests.cpp index 338f4dd470..d8e362a3d7 100644 --- a/opencl/test/unit_test/command_queue/enqueue_handler_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_handler_tests.cpp @@ -32,6 +32,8 @@ #include "opencl/test/unit_test/test_macros/test_checks_ocl.h" #include "test.h" +#include "test_traits_common.h" + using namespace NEO; HWTEST_F(EnqueueHandlerTest, WhenEnqueingHandlerWithKernelThenProcessEvictionOnCsrIsCalled) { @@ -447,7 +449,7 @@ HWTEST_F(EnqueueHandlerTest, givenEnqueueHandlerWhenAddPatchInfoCommentsForAUBDu mockCmdQ->enqueueKernel(mockKernel.mockKernel, 1, nullptr, gws, nullptr, 0, nullptr, nullptr); } -HWTEST_F(EnqueueHandlerTest, givenEnqueueHandlerWhenAddPatchInfoCommentsForAUBDumpIsSetThenPatchInfoDataIsTransferredToCSR) { +HWTEST2_F(EnqueueHandlerTest, givenEnqueueHandlerWhenAddPatchInfoCommentsForAUBDumpIsSetThenPatchInfoDataIsTransferredToCSR, MatchAny) { DebugManagerStateRestore dbgRestore; DebugManager.flags.AddPatchInfoCommentsForAUBDump.set(true); DebugManager.flags.FlattenBatchBufferForAUBDump.set(true); @@ -465,7 +467,9 @@ HWTEST_F(EnqueueHandlerTest, givenEnqueueHandlerWhenAddPatchInfoCommentsForAUBDu PatchInfoData patchInfoData = {0xaaaaaaaa, 0, PatchInfoAllocationType::KernelArg, 0xbbbbbbbb, 0, PatchInfoAllocationType::IndirectObjectHeap}; mockKernel.mockKernel->getPatchInfoDataList().push_back(patchInfoData); - EXPECT_CALL(*mockHelper, setPatchInfoData(::testing::_)).Times(8); + constexpr uint32_t expectedCallsCount = TestTraits::iohInSbaSupported ? 8 : 7; + + EXPECT_CALL(*mockHelper, setPatchInfoData(::testing::_)).Times(expectedCallsCount); EXPECT_CALL(*mockHelper, registerCommandChunk(::testing::_)).Times(1); EXPECT_CALL(*mockHelper, registerBatchBufferStartAddress(::testing::_, ::testing::_)).Times(1); mockCmdQ->enqueueKernel(mockKernel.mockKernel, 1, nullptr, gws, nullptr, 0, nullptr, nullptr); diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_gmock_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_gmock_tests.cpp index f1edc09ecd..f305a2c4c9 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_gmock_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_gmock_tests.cpp @@ -44,6 +44,7 @@ #include "gtest/gtest.h" #include "reg_configs_common.h" +#include "test_traits_common.h" using namespace NEO; @@ -52,7 +53,8 @@ using ::testing::Invoke; using CommandStreamReceiverFlushTaskGmockTests = UltCommandStreamReceiverTest; -HWTEST_F(CommandStreamReceiverFlushTaskGmockTests, givenCsrInBatchingModeThreeRecordedCommandBufferEnabledBatchBufferFlatteningAndPatchInfoCollectionWhenFlushBatchedSubmissionsIsCalledThenBatchBuffersAndPatchInfoAreCollected) { +HWTEST2_F(CommandStreamReceiverFlushTaskGmockTests, + givenCsrInBatchingModeThreeRecordedCommandBufferEnabledBatchBufferFlatteningAndPatchInfoCollectionWhenFlushBatchedSubmissionsIsCalledThenBatchBuffersAndPatchInfoAreCollected, MatchAny) { DebugManagerStateRestore stateRestore; DebugManager.flags.CsrDispatchMode.set(static_cast(DispatchMode::BatchedDispatch)); DebugManager.flags.AddPatchInfoCommentsForAUBDump.set(true); @@ -80,7 +82,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskGmockTests, givenCsrInBatchingModeThreeRe dispatchFlags.guardCommandBufferWithPipeControl = true; dispatchFlags.outOfOrderExecutionAllowed = true; - EXPECT_CALL(*mockHelper, setPatchInfoData(::testing::_)).Times(10); + constexpr uint32_t expectedCallsCount = TestTraits::iohInSbaSupported ? 10 : 9; + + EXPECT_CALL(*mockHelper, setPatchInfoData(::testing::_)).Times(expectedCallsCount); size_t removePatchInfoDataCount = 4 * UltMemorySynchronizationCommands::getExpectedPipeControlCount(pDevice->getHardwareInfo()); EXPECT_CALL(*mockHelper, removePatchInfoData(::testing::_)).Times(static_cast(removePatchInfoDataCount)); EXPECT_CALL(*mockHelper, registerCommandChunk(::testing::_)).Times(4); @@ -153,7 +157,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskGmockTests, givenMockCommandStreamerWhenA *pDevice); } -HWTEST_F(CommandStreamReceiverFlushTaskGmockTests, givenMockCommandStreamerWhenAddPatchInfoCommentsForAUBDumpIsSetThenAddPatchInfoDataIsCollected) { +HWTEST2_F(CommandStreamReceiverFlushTaskGmockTests, givenMockCommandStreamerWhenAddPatchInfoCommentsForAUBDumpIsSetThenAddPatchInfoDataIsCollected, MatchAny) { DebugManagerStateRestore dbgRestore; DebugManager.flags.AddPatchInfoCommentsForAUBDump.set(true); @@ -168,9 +172,11 @@ HWTEST_F(CommandStreamReceiverFlushTaskGmockTests, givenMockCommandStreamerWhenA DispatchFlags dispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags(); + constexpr uint32_t expectedCallsCount = TestTraits::iohInSbaSupported ? 4 : 3; + std::vector patchInfoDataVector; EXPECT_CALL(*mockHelper, setPatchInfoData(_)) - .Times(4) + .Times(expectedCallsCount) .WillRepeatedly(Invoke([&](const PatchInfoData &data) { patchInfoDataVector.push_back(data); return true; @@ -185,7 +191,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskGmockTests, givenMockCommandStreamerWhenA dispatchFlags, *pDevice); - EXPECT_EQ(4u, patchInfoDataVector.size()); + EXPECT_EQ(expectedCallsCount, patchInfoDataVector.size()); for (auto &patchInfoData : patchInfoDataVector) { uint64_t expectedAddress = 0u; @@ -208,16 +214,18 @@ HWTEST_F(CommandStreamReceiverFlushTaskGmockTests, givenMockCommandStreamerWhenA } } -HWTEST_F(CommandStreamReceiverFlushTaskGmockTests, givenMockCsrWhenCollectStateBaseAddresPatchInfoIsCalledThenAppropriateAddressesAreTaken) { +HWTEST2_F(CommandStreamReceiverFlushTaskGmockTests, givenMockCsrWhenCollectStateBaseAddresPatchInfoIsCalledThenAppropriateAddressesAreTaken, MatchAny) { typedef typename FamilyType::STATE_BASE_ADDRESS STATE_BASE_ADDRESS; std::unique_ptr> mockCsr(new MockCsrHw2(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); auto mockHelper = new MockFlatBatchBufferHelper(*pDevice->executionEnvironment); mockCsr->overwriteFlatBatchBufferHelper(mockHelper); + constexpr uint32_t expectedCallsCount = TestTraits::iohInSbaSupported ? 4 : 3; + std::vector patchInfoDataVector; EXPECT_CALL(*mockHelper, setPatchInfoData(_)) - .Times(4) + .Times(expectedCallsCount) .WillRepeatedly(Invoke([&](const PatchInfoData &data) { patchInfoDataVector.push_back(data); return true; @@ -231,11 +239,10 @@ HWTEST_F(CommandStreamReceiverFlushTaskGmockTests, givenMockCsrWhenCollectStateB mockCsr->collectStateBaseAddresPatchInfo(baseAddress, commandOffset, dsh, ioh, ssh, generalStateBase); - ASSERT_EQ(patchInfoDataVector.size(), 4u); + ASSERT_EQ(patchInfoDataVector.size(), expectedCallsCount); PatchInfoData dshPatch = patchInfoDataVector[0]; PatchInfoData gshPatch = patchInfoDataVector[1]; PatchInfoData sshPatch = patchInfoDataVector[2]; - PatchInfoData iohPatch = patchInfoDataVector[3]; for (auto &patch : patchInfoDataVector) { EXPECT_EQ(patch.targetAllocation, baseAddress); @@ -246,9 +253,13 @@ HWTEST_F(CommandStreamReceiverFlushTaskGmockTests, givenMockCsrWhenCollectStateB EXPECT_EQ(dshPatch.sourceAllocation, dsh.getGraphicsAllocation()->getGpuAddress()); EXPECT_EQ(dshPatch.targetAllocationOffset, commandOffset + STATE_BASE_ADDRESS::PATCH_CONSTANTS::DYNAMICSTATEBASEADDRESS_BYTEOFFSET); - //IOH - EXPECT_EQ(iohPatch.sourceAllocation, ioh.getGraphicsAllocation()->getGpuAddress()); - EXPECT_EQ(iohPatch.targetAllocationOffset, commandOffset + STATE_BASE_ADDRESS::PATCH_CONSTANTS::INDIRECTOBJECTBASEADDRESS_BYTEOFFSET); + if constexpr (TestTraits::iohInSbaSupported) { + //IOH + PatchInfoData iohPatch = patchInfoDataVector[3]; + + EXPECT_EQ(iohPatch.sourceAllocation, ioh.getGraphicsAllocation()->getGpuAddress()); + EXPECT_EQ(iohPatch.targetAllocationOffset, commandOffset + STATE_BASE_ADDRESS::PATCH_CONSTANTS::INDIRECTOBJECTBASEADDRESS_BYTEOFFSET); + } //SSH EXPECT_EQ(sshPatch.sourceAllocation, ssh.getGraphicsAllocation()->getGpuAddress()); diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_tests_xehp_and_later.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_tests_xehp_and_later.cpp index 95f353f339..70b59fa6e0 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_tests_xehp_and_later.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_tests_xehp_and_later.cpp @@ -151,11 +151,6 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, gi EXPECT_EQ(0u, sbaCmd.getDynamicStateBaseAddress()); EXPECT_EQ(0u, sbaCmd.getDynamicStateBufferSize()); - EXPECT_FALSE(sbaCmd.getIndirectObjectBaseAddressModifyEnable()); - EXPECT_FALSE(sbaCmd.getIndirectObjectBufferSizeModifyEnable()); - EXPECT_EQ(0u, sbaCmd.getIndirectObjectBaseAddress()); - EXPECT_EQ(0u, sbaCmd.getIndirectObjectBufferSize()); - EXPECT_FALSE(sbaCmd.getSurfaceStateBaseAddressModifyEnable()); EXPECT_EQ(0u, sbaCmd.getSurfaceStateBaseAddress()); @@ -434,7 +429,6 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, Wh EXPECT_EQ(dsh.getCpuBase(), reinterpret_cast(cmd.getDynamicStateBaseAddress())); EXPECT_EQ(commandStreamReceiver.getMemoryManager()->getInternalHeapBaseAddress(commandStreamReceiver.rootDeviceIndex, ioh.getGraphicsAllocation()->isAllocatedInLocalMemoryPool()), cmd.getInstructionBaseAddress()); - EXPECT_EQ(ioh.getCpuBase(), reinterpret_cast(cmd.getIndirectObjectBaseAddress())); EXPECT_EQ(ssh.getCpuBase(), reinterpret_cast(cmd.getSurfaceStateBaseAddress())); EXPECT_EQ(l1CacheOnMocs, cmd.getStatelessDataPortAccessMemoryObjectControlState()); diff --git a/opencl/test/unit_test/helpers/test_preamble_xehp_and_later.cpp b/opencl/test/unit_test/helpers/test_preamble_xehp_and_later.cpp index 1a18412fa4..2ee79b996b 100644 --- a/opencl/test/unit_test/helpers/test_preamble_xehp_and_later.cpp +++ b/opencl/test/unit_test/helpers/test_preamble_xehp_and_later.cpp @@ -244,7 +244,6 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHpCommandStreamReceiverFlushTaskTests, whenFlushC ASSERT_NE(nullptr, hwParserCsr.cmdStateBaseAddress); auto stateBaseAddress = static_cast(hwParserCsr.cmdStateBaseAddress); auto expectedMocsIndexForStateless = gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CONST); - auto expectedMocsIndexForL1EnabledResource = gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_INLINE_CONST_HDC); auto expectedMocsIndexForHeap = gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_STATE_HEAP_BUFFER); EXPECT_EQ(expectedMocsIndexForHeap, stateBaseAddress->getSurfaceStateMemoryObjectControlStateIndexToMocsTables()); @@ -254,7 +253,6 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHpCommandStreamReceiverFlushTaskTests, whenFlushC EXPECT_EQ(expectedMocsIndexForHeap, stateBaseAddress->getBindlessSurfaceStateMemoryObjectControlStateIndexToMocsTables()); EXPECT_EQ(expectedMocsIndexForHeap, stateBaseAddress->getBindlessSamplerStateMemoryObjectControlStateIndexToMocsTables()); EXPECT_EQ(expectedMocsIndexForStateless, stateBaseAddress->getStatelessDataPortAccessMemoryObjectControlStateIndexToMocsTables()); - EXPECT_EQ(expectedMocsIndexForL1EnabledResource, stateBaseAddress->getIndirectObjectMemoryObjectControlStateIndexToMocsTables()); } HWCMDTEST_F(IGFX_XE_HP_CORE, XeHpCommandStreamReceiverFlushTaskTests, whenFlushCalledThenStateBaseAddressHasAllCachesOffWhenDebugFlagIsPresent) { @@ -278,7 +276,6 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHpCommandStreamReceiverFlushTaskTests, whenFlushC EXPECT_EQ(expectedMocsIndexForHeap, stateBaseAddress->getInstructionMemoryObjectControlStateIndexToMocsTables()); EXPECT_EQ(expectedMocsIndexForHeap, stateBaseAddress->getBindlessSurfaceStateMemoryObjectControlStateIndexToMocsTables()); EXPECT_EQ(expectedMocsIndexForHeap, stateBaseAddress->getBindlessSamplerStateMemoryObjectControlStateIndexToMocsTables()); - EXPECT_EQ(expectedMocsIndexForHeap, stateBaseAddress->getIndirectObjectMemoryObjectControlStateIndexToMocsTables()); } HWCMDTEST_F(IGFX_XE_HP_CORE, XeHpCommandStreamReceiverFlushTaskTests, givenL3ToL1DebugFlagWhenStatelessMocsIsProgrammedThenItHasL1CachingOn) { @@ -437,78 +434,6 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHpCommandStreamReceiverFlushTaskTests, givenMultE EXPECT_FALSE(stateBaseAddress->getDisableSupportForMultiGpuPartialWritesForStatelessMessages()); } -HWCMDTEST_F(IGFX_XE_HP_CORE, XeHpCommandStreamReceiverFlushTaskTests, givenDefaultIndirectHeapCachingSettingWhenFlushingCsrThenExpectL1CachingPolicySelected) { - using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS; - - int32_t defaultRegValue = DebugManager.flags.UseCachingPolicyForIndirectObjectHeap.get(); - EXPECT_EQ(-1, defaultRegValue); - - auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver(); - flushTask(commandStreamReceiver); - HardwareParse hwParserCsr; - hwParserCsr.parseCommands(commandStreamReceiver.commandStream, 0); - hwParserCsr.findHardwareCommands(); - ASSERT_NE(nullptr, hwParserCsr.cmdStateBaseAddress); - auto stateBaseAddress = static_cast(hwParserCsr.cmdStateBaseAddress); - auto actualMocs = stateBaseAddress->getIndirectObjectMemoryObjectControlStateIndexToMocsTables(); - auto expectedMocs = pDevice->getRootDeviceEnvironment().getGmmHelper()->getMOCS(GMM_RESOURCE_USAGE_OCL_INLINE_CONST_HDC); - EXPECT_EQ(expectedMocs, actualMocs); -} - -HWCMDTEST_F(IGFX_XE_HP_CORE, XeHpCommandStreamReceiverFlushTaskTests, givenUncachedIndirectHeapCachingSettingWhenFlushingCsrThenExpectUncachedCachingPolicySelected) { - using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS; - - DebugManagerStateRestore dbgRestore; - DebugManager.flags.UseCachingPolicyForIndirectObjectHeap.set(0); - - auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver(); - flushTask(commandStreamReceiver); - HardwareParse hwParserCsr; - hwParserCsr.parseCommands(commandStreamReceiver.commandStream, 0); - hwParserCsr.findHardwareCommands(); - ASSERT_NE(nullptr, hwParserCsr.cmdStateBaseAddress); - auto stateBaseAddress = static_cast(hwParserCsr.cmdStateBaseAddress); - auto actualMocs = stateBaseAddress->getIndirectObjectMemoryObjectControlStateIndexToMocsTables(); - auto expectedMocs = pDevice->getRootDeviceEnvironment().getGmmHelper()->getMOCS(GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER_CACHELINE_MISALIGNED); - EXPECT_EQ(expectedMocs, actualMocs); -} - -HWCMDTEST_F(IGFX_XE_HP_CORE, XeHpCommandStreamReceiverFlushTaskTests, givenL3IndirectHeapCachingSettingWhenFlushingCsrThenExpectL3CachingPolicySelected) { - using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS; - - DebugManagerStateRestore dbgRestore; - DebugManager.flags.UseCachingPolicyForIndirectObjectHeap.set(1); - - auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver(); - flushTask(commandStreamReceiver); - HardwareParse hwParserCsr; - hwParserCsr.parseCommands(commandStreamReceiver.commandStream, 0); - hwParserCsr.findHardwareCommands(); - ASSERT_NE(nullptr, hwParserCsr.cmdStateBaseAddress); - auto stateBaseAddress = static_cast(hwParserCsr.cmdStateBaseAddress); - auto actualMocs = stateBaseAddress->getIndirectObjectMemoryObjectControlStateIndexToMocsTables(); - auto expectedMocs = pDevice->getRootDeviceEnvironment().getGmmHelper()->getMOCS(GMM_RESOURCE_USAGE_OCL_STATE_HEAP_BUFFER); - EXPECT_EQ(expectedMocs, actualMocs); -} - -HWCMDTEST_F(IGFX_XE_HP_CORE, XeHpCommandStreamReceiverFlushTaskTests, givenL1IndirectHeapCachingSettingWhenFlushingCsrThenExpectL1CachingPolicySelected) { - using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS; - - DebugManagerStateRestore dbgRestore; - DebugManager.flags.UseCachingPolicyForIndirectObjectHeap.set(2); - - auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver(); - flushTask(commandStreamReceiver); - HardwareParse hwParserCsr; - hwParserCsr.parseCommands(commandStreamReceiver.commandStream, 0); - hwParserCsr.findHardwareCommands(); - ASSERT_NE(nullptr, hwParserCsr.cmdStateBaseAddress); - auto stateBaseAddress = static_cast(hwParserCsr.cmdStateBaseAddress); - auto actualMocs = stateBaseAddress->getIndirectObjectMemoryObjectControlStateIndexToMocsTables(); - auto expectedMocs = pDevice->getRootDeviceEnvironment().getGmmHelper()->getMOCS(GMM_RESOURCE_USAGE_OCL_INLINE_CONST_HDC); - EXPECT_EQ(expectedMocs, actualMocs); -} - using StateBaseAddressXeHPAndLaterTests = XeHpCommandStreamReceiverFlushTaskTests; struct CompressionParamsSupportedMatcher { diff --git a/opencl/test/unit_test/test_files/igdrcl.config b/opencl/test/unit_test/test_files/igdrcl.config index 115906f1c5..7b6d257204 100644 --- a/opencl/test/unit_test/test_files/igdrcl.config +++ b/opencl/test/unit_test/test_files/igdrcl.config @@ -273,7 +273,6 @@ EnableMultiTileCompression = -1 EnablePrivateScratchSlot1 = -1 DisablePipeControlPrecedingPostSyncCommand = -1 UseClearColorAllocationForBlitter = false -UseCachingPolicyForIndirectObjectHeap = -1 OverrideMultiStoragePlacement = -1 MultiTileIsaPlacement = -1 FormatForStatelessCompressionWithUnifiedMemory = 0xF diff --git a/shared/source/command_container/command_encoder.h b/shared/source/command_container/command_encoder.h index 8adaa8bcf2..6fadbfc99b 100644 --- a/shared/source/command_container/command_encoder.h +++ b/shared/source/command_container/command_encoder.h @@ -8,6 +8,7 @@ #pragma once #include "shared/source/command_container/cmdcontainer.h" #include "shared/source/command_stream/linear_stream.h" +#include "shared/source/debugger/debugger.h" #include "shared/source/execution_environment/execution_environment.h" #include "shared/source/helpers/definitions/mi_flush_args.h" #include "shared/source/helpers/register_offsets.h" @@ -221,6 +222,7 @@ struct EncodeStateBaseAddress { using STATE_BASE_ADDRESS = typename GfxFamily::STATE_BASE_ADDRESS; static void encode(CommandContainer &container, STATE_BASE_ADDRESS &sbaCmd); static void encode(CommandContainer &container, STATE_BASE_ADDRESS &sbaCmd, uint32_t statelessMocsIndex, bool useGlobalAtomics); + static void setIohAddressForDebugger(NEO::Debugger::SbaAddresses &sbaAddress, const STATE_BASE_ADDRESS &sbaCmd); static size_t getRequiredSizeForStateBaseAddress(Device &device, CommandContainer &container); }; diff --git a/shared/source/command_container/command_encoder_bdw_and_later.inl b/shared/source/command_container/command_encoder_bdw_and_later.inl index e1512cb7eb..7dec24063a 100644 --- a/shared/source/command_container/command_encoder_bdw_and_later.inl +++ b/shared/source/command_container/command_encoder_bdw_and_later.inl @@ -361,6 +361,11 @@ template inline void EncodeComputeMode::adjustPipelineSelect(CommandContainer &container, const NEO::KernelDescriptor &kernelDescriptor) { } +template +void EncodeStateBaseAddress::setIohAddressForDebugger(NEO::Debugger::SbaAddresses &sbaAddress, const STATE_BASE_ADDRESS &sbaCmd) { + sbaAddress.IndirectObjectBaseAddress = sbaCmd.getIndirectObjectBaseAddress(); +} + template void EncodeStateBaseAddress::encode(CommandContainer &container, STATE_BASE_ADDRESS &sbaCmd) { auto gmmHelper = container.getDevice()->getRootDeviceEnvironment().getGmmHelper(); diff --git a/shared/source/command_container/command_encoder_xehp_and_later.inl b/shared/source/command_container/command_encoder_xehp_and_later.inl index 4053336648..0090ade507 100644 --- a/shared/source/command_container/command_encoder_xehp_and_later.inl +++ b/shared/source/command_container/command_encoder_xehp_and_later.inl @@ -450,6 +450,10 @@ size_t EncodeDispatchKernel::estimateEncodeDispatchKernelCmdsSize(Device return totalSize; } +template +void EncodeStateBaseAddress::setIohAddressForDebugger(NEO::Debugger::SbaAddresses &sbaAddress, const STATE_BASE_ADDRESS &sbaCmd) { +} + template void EncodeStateBaseAddress::encode(CommandContainer &container, STATE_BASE_ADDRESS &sbaCmd) { auto gmmHelper = container.getDevice()->getRootDeviceEnvironment().getGmmHelper(); diff --git a/shared/source/command_stream/command_stream_receiver_hw.h b/shared/source/command_stream/command_stream_receiver_hw.h index 24a63c8ca3..eeb30ff54f 100644 --- a/shared/source/command_stream/command_stream_receiver_hw.h +++ b/shared/source/command_stream/command_stream_receiver_hw.h @@ -87,6 +87,8 @@ class CommandStreamReceiverHw : public CommandStreamReceiver { const LinearStream &ssh, uint64_t generalStateBase); + void collectStateBaseAddresIohPatchInfo(uint64_t commandBufferAddress, uint64_t commandOffset, const LinearStream &ioh); + void resetKmdNotifyHelper(KmdNotifyHelper *newHelper); CommandStreamReceiverType getType() override { 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 8ac5fea7cf..d4847a3b37 100644 --- a/shared/source/command_stream/command_stream_receiver_hw_base.inl +++ b/shared/source/command_stream/command_stream_receiver_hw_base.inl @@ -986,12 +986,11 @@ void CommandStreamReceiverHw::collectStateBaseAddresPatchInfo( PatchInfoData dynamicStatePatchInfo = {dsh.getGraphicsAllocation()->getGpuAddress(), 0u, PatchInfoAllocationType::DynamicStateHeap, baseAddress, commandOffset + STATE_BASE_ADDRESS::PATCH_CONSTANTS::DYNAMICSTATEBASEADDRESS_BYTEOFFSET, PatchInfoAllocationType::Default}; PatchInfoData generalStatePatchInfo = {generalStateBase, 0u, PatchInfoAllocationType::GeneralStateHeap, baseAddress, commandOffset + STATE_BASE_ADDRESS::PATCH_CONSTANTS::GENERALSTATEBASEADDRESS_BYTEOFFSET, PatchInfoAllocationType::Default}; PatchInfoData surfaceStatePatchInfo = {ssh.getGraphicsAllocation()->getGpuAddress(), 0u, PatchInfoAllocationType::SurfaceStateHeap, baseAddress, commandOffset + STATE_BASE_ADDRESS::PATCH_CONSTANTS::SURFACESTATEBASEADDRESS_BYTEOFFSET, PatchInfoAllocationType::Default}; - PatchInfoData indirectObjectPatchInfo = {ioh.getGraphicsAllocation()->getGpuAddress(), 0u, PatchInfoAllocationType::IndirectObjectHeap, baseAddress, commandOffset + STATE_BASE_ADDRESS::PATCH_CONSTANTS::INDIRECTOBJECTBASEADDRESS_BYTEOFFSET, PatchInfoAllocationType::Default}; flatBatchBufferHelper->setPatchInfoData(dynamicStatePatchInfo); flatBatchBufferHelper->setPatchInfoData(generalStatePatchInfo); flatBatchBufferHelper->setPatchInfoData(surfaceStatePatchInfo); - flatBatchBufferHelper->setPatchInfoData(indirectObjectPatchInfo); + collectStateBaseAddresIohPatchInfo(baseAddress, commandOffset, ioh); } template diff --git a/shared/source/command_stream/command_stream_receiver_hw_bdw_and_later.inl b/shared/source/command_stream/command_stream_receiver_hw_bdw_and_later.inl index e9c3dafb94..08a6749c3f 100644 --- a/shared/source/command_stream/command_stream_receiver_hw_bdw_and_later.inl +++ b/shared/source/command_stream/command_stream_receiver_hw_bdw_and_later.inl @@ -6,6 +6,9 @@ */ #include "shared/source/command_stream/command_stream_receiver_hw_base.inl" +#include "shared/source/helpers/address_patch.h" + +#include "hw_cmds.h" namespace NEO { @@ -118,6 +121,15 @@ size_t CommandStreamReceiverHw::getCmdSizeForPerDssBackedBuffer(const return 0; } +template +void CommandStreamReceiverHw::collectStateBaseAddresIohPatchInfo(uint64_t commandBufferAddress, uint64_t commandOffset, const LinearStream &ioh) { + using STATE_BASE_ADDRESS = typename GfxFamily::STATE_BASE_ADDRESS; + + PatchInfoData indirectObjectPatchInfo = {ioh.getGraphicsAllocation()->getGpuAddress(), 0u, PatchInfoAllocationType::IndirectObjectHeap, commandBufferAddress, + commandOffset + STATE_BASE_ADDRESS::PATCH_CONSTANTS::INDIRECTOBJECTBASEADDRESS_BYTEOFFSET, PatchInfoAllocationType::Default}; + flatBatchBufferHelper->setPatchInfoData(indirectObjectPatchInfo); +} + template size_t CommandStreamReceiverHw::getCmdSizeForActivePartitionConfig() const { return 0; diff --git a/shared/source/command_stream/command_stream_receiver_hw_xehp_and_later.inl b/shared/source/command_stream/command_stream_receiver_hw_xehp_and_later.inl index 769dee21b6..8c65a9800a 100644 --- a/shared/source/command_stream/command_stream_receiver_hw_xehp_and_later.inl +++ b/shared/source/command_stream/command_stream_receiver_hw_xehp_and_later.inl @@ -139,6 +139,10 @@ GraphicsAllocation *CommandStreamReceiverHw::getClearColorAllocation( return nullptr; } +template +void CommandStreamReceiverHw::collectStateBaseAddresIohPatchInfo(uint64_t commandBufferAddress, uint64_t commandOffset, const LinearStream &ioh) { +} + template size_t CommandStreamReceiverHw::getCmdSizeForActivePartitionConfig() const { if (this->staticWorkPartitioningEnabled && csrSizeRequestFlags.activePartitionsChanged) { diff --git a/shared/source/debug_settings/debug_variables_base.inl b/shared/source/debug_settings/debug_variables_base.inl index a26622f030..03a66d2d57 100644 --- a/shared/source/debug_settings/debug_variables_base.inl +++ b/shared/source/debug_settings/debug_variables_base.inl @@ -131,7 +131,6 @@ DECLARE_DEBUG_VARIABLE(int32_t, ForceStatelessL1CachingPolicy, -1, "-1: default, DECLARE_DEBUG_VARIABLE(int32_t, ForceMemoryBankIndexOverride, -1, "-1: default, 0: disable, 1:enable, Force index=1 of memory bank for XEHP") DECLARE_DEBUG_VARIABLE(int32_t, EnablePrivateScratchSlot1, -1, "-1: default, 0: disable, 1: enable Allows using private scratch space") DECLARE_DEBUG_VARIABLE(int32_t, DisablePipeControlPrecedingPostSyncCommand, -1, "-1 default - disabled adding PIPE_CONTROL, 0 - disabled adding PIPE_CONTROL, 1 - enabled adding PIPE_CONTROL") -DECLARE_DEBUG_VARIABLE(int32_t, UseCachingPolicyForIndirectObjectHeap, -1, "Use selected caching policy for IOH, -1 - default, 0 - Uncached, 1 - L3 Caching, 2 - L1 Caching") DECLARE_DEBUG_VARIABLE(int32_t, MultiTileIsaPlacement, -1, "Place ISA allocation on multi tiles, -1 - default, 0 - disabled, 1 - enabled") DECLARE_DEBUG_VARIABLE(int32_t, FormatForStatelessCompressionWithUnifiedMemory, 0xF, "Format for stateless compression with unified memory") DECLARE_DEBUG_VARIABLE(int32_t, ForceMultiGpuPartialWritesInComputeMode, -1, "-1: default - 0 for multiOsContext capable, 0: program value 0 in MultiGpuPartialWrites bit in STATE_COMPUTE_MODE, 1: program value 1 in MultiGpuPartialWrites bit in STATE_COMPUTE_MODE,") diff --git a/shared/source/generated/xe_hp_core/hw_cmds_generated_xe_hp_core.inl b/shared/source/generated/xe_hp_core/hw_cmds_generated_xe_hp_core.inl index ee5b245fae..ddd5c9854f 100644 --- a/shared/source/generated/xe_hp_core/hw_cmds_generated_xe_hp_core.inl +++ b/shared/source/generated/xe_hp_core/hw_cmds_generated_xe_hp_core.inl @@ -2898,12 +2898,7 @@ typedef struct tagSTATE_BASE_ADDRESS { uint64_t Reserved_203 : BITFIELD_RANGE(11, 11); uint64_t DynamicStateBaseAddress : BITFIELD_RANGE(12, 63); // DWORD 8-9 - uint64_t IndirectObjectBaseAddressModifyEnable : BITFIELD_RANGE(0, 0); - uint64_t Reserved_257 : BITFIELD_RANGE(1, 3); - uint64_t IndirectObjectMemoryObjectControlState_Reserved : BITFIELD_RANGE(4, 4); - uint64_t IndirectObjectMemoryObjectControlState_IndexToMocsTables : BITFIELD_RANGE(5, 10); - uint64_t Reserved_267 : BITFIELD_RANGE(11, 11); - uint64_t IndirectObjectBaseAddress : BITFIELD_RANGE(12, 63); + uint64_t Reserved8 : BITFIELD_RANGE(0, 63); // DWORD 10-11 uint64_t InstructionBaseAddressModifyEnable : BITFIELD_RANGE(0, 0); uint64_t Reserved_321 : BITFIELD_RANGE(1, 3); @@ -2982,8 +2977,6 @@ typedef struct tagSTATE_BASE_ADDRESS { SURFACESTATEBASEADDRESS_INDEX = 0x4, DYNAMICSTATEBASEADDRESS_BYTEOFFSET = 0x18, DYNAMICSTATEBASEADDRESS_INDEX = 0x6, - INDIRECTOBJECTBASEADDRESS_BYTEOFFSET = 0x20, - INDIRECTOBJECTBASEADDRESS_INDEX = 0x8, INSTRUCTIONBASEADDRESS_BYTEOFFSET = 0x28, INSTRUCTIONBASEADDRESS_INDEX = 0xa, BINDLESSSURFACESTATEBASEADDRESS_BYTEOFFSET = 0x40, @@ -3141,34 +3134,6 @@ typedef struct tagSTATE_BASE_ADDRESS { inline uint64_t getDynamicStateBaseAddress(void) const { return (TheStructure.Common.DynamicStateBaseAddress << DYNAMICSTATEBASEADDRESS_BIT_SHIFT); } - inline void setIndirectObjectBaseAddressModifyEnable(const bool value) { - TheStructure.Common.IndirectObjectBaseAddressModifyEnable = value; - } - inline bool getIndirectObjectBaseAddressModifyEnable(void) const { - return (TheStructure.Common.IndirectObjectBaseAddressModifyEnable); - } - inline void setIndirectObjectMemoryObjectControlStateReserved(const uint64_t value) { - TheStructure.Common.IndirectObjectMemoryObjectControlState_Reserved = value; - } - inline uint64_t getIndirectObjectMemoryObjectControlStateReserved(void) const { - return (TheStructure.Common.IndirectObjectMemoryObjectControlState_Reserved); - } - inline void setIndirectObjectMemoryObjectControlStateIndexToMocsTables(const uint64_t value) { - TheStructure.Common.IndirectObjectMemoryObjectControlState_IndexToMocsTables = value >> 1; - } - inline uint64_t getIndirectObjectMemoryObjectControlStateIndexToMocsTables(void) const { - return (TheStructure.Common.IndirectObjectMemoryObjectControlState_IndexToMocsTables << 1); - } - typedef enum tagINDIRECTOBJECTBASEADDRESS { - INDIRECTOBJECTBASEADDRESS_BIT_SHIFT = 0xc, - INDIRECTOBJECTBASEADDRESS_ALIGN_SIZE = 0x1000, - } INDIRECTOBJECTBASEADDRESS; - inline void setIndirectObjectBaseAddress(const uint64_t value) { - TheStructure.Common.IndirectObjectBaseAddress = value >> INDIRECTOBJECTBASEADDRESS_BIT_SHIFT; - } - inline uint64_t getIndirectObjectBaseAddress(void) const { - return (TheStructure.Common.IndirectObjectBaseAddress << INDIRECTOBJECTBASEADDRESS_BIT_SHIFT); - } inline void setInstructionBaseAddressModifyEnable(const bool value) { TheStructure.Common.InstructionBaseAddressModifyEnable = value; } diff --git a/shared/source/helpers/state_base_address.h b/shared/source/helpers/state_base_address.h index 3d6f57cf1b..73e9feba23 100644 --- a/shared/source/helpers/state_base_address.h +++ b/shared/source/helpers/state_base_address.h @@ -40,6 +40,8 @@ struct StateBaseAddressHelper { bool useGlobalAtomics, bool areMultipleSubDevicesInContext); + static void appendIohParameters(STATE_BASE_ADDRESS *stateBaseAddress, const IndirectHeap *ioh, bool useGlobalHeapsBaseAddress, uint64_t indirectObjectHeapBaseAddress); + static void appendStateBaseAddressParameters( STATE_BASE_ADDRESS *stateBaseAddress, const IndirectHeap *ssh, diff --git a/shared/source/helpers/state_base_address_base.inl b/shared/source/helpers/state_base_address_base.inl index 548c9bc5ac..c005a4da97 100644 --- a/shared/source/helpers/state_base_address_base.inl +++ b/shared/source/helpers/state_base_address_base.inl @@ -43,11 +43,6 @@ void StateBaseAddressHelper::programStateBaseAddress( stateBaseAddress->setDynamicStateBaseAddress(globalHeapsBaseAddress); stateBaseAddress->setDynamicStateBufferSize(MemoryConstants::pageSize64k); - stateBaseAddress->setIndirectObjectBaseAddressModifyEnable(true); - stateBaseAddress->setIndirectObjectBufferSizeModifyEnable(true); - stateBaseAddress->setIndirectObjectBaseAddress(indirectObjectHeapBaseAddress); - stateBaseAddress->setIndirectObjectBufferSize(MemoryConstants::sizeOf4GBinPageEntities); - stateBaseAddress->setSurfaceStateBaseAddressModifyEnable(true); stateBaseAddress->setSurfaceStateBaseAddress(globalHeapsBaseAddress); @@ -64,19 +59,14 @@ void StateBaseAddressHelper::programStateBaseAddress( stateBaseAddress->setDynamicStateBufferSize(dsh->getHeapSizeInPages()); } - if (ioh) { - stateBaseAddress->setIndirectObjectBaseAddressModifyEnable(true); - stateBaseAddress->setIndirectObjectBufferSizeModifyEnable(true); - stateBaseAddress->setIndirectObjectBaseAddress(ioh->getHeapGpuBase()); - stateBaseAddress->setIndirectObjectBufferSize(ioh->getHeapSizeInPages()); - } - if (ssh) { stateBaseAddress->setSurfaceStateBaseAddressModifyEnable(true); stateBaseAddress->setSurfaceStateBaseAddress(ssh->getHeapGpuBase()); } } + appendIohParameters(stateBaseAddress, ioh, useGlobalHeapsBaseAddress, indirectObjectHeapBaseAddress); + if (setInstructionStateBaseAddress) { stateBaseAddress->setInstructionBaseAddressModifyEnable(true); stateBaseAddress->setInstructionBaseAddress(instructionHeapBaseAddress); diff --git a/shared/source/helpers/state_base_address_bdw_and_later.inl b/shared/source/helpers/state_base_address_bdw_and_later.inl index 3d498a379f..e5ab2069ce 100644 --- a/shared/source/helpers/state_base_address_bdw_and_later.inl +++ b/shared/source/helpers/state_base_address_bdw_and_later.inl @@ -13,4 +13,19 @@ template void StateBaseAddressHelper::programBindingTableBaseAddress(LinearStream &commandStream, const IndirectHeap &ssh, GmmHelper *gmmHelper) { } +template +void StateBaseAddressHelper::appendIohParameters(typename GfxFamily::STATE_BASE_ADDRESS *stateBaseAddress, const IndirectHeap *ioh, bool useGlobalHeapsBaseAddress, uint64_t indirectObjectHeapBaseAddress) { + if (useGlobalHeapsBaseAddress) { + stateBaseAddress->setIndirectObjectBaseAddressModifyEnable(true); + stateBaseAddress->setIndirectObjectBufferSizeModifyEnable(true); + stateBaseAddress->setIndirectObjectBaseAddress(indirectObjectHeapBaseAddress); + stateBaseAddress->setIndirectObjectBufferSize(MemoryConstants::sizeOf4GBinPageEntities); + } else if (ioh) { + stateBaseAddress->setIndirectObjectBaseAddressModifyEnable(true); + stateBaseAddress->setIndirectObjectBufferSizeModifyEnable(true); + stateBaseAddress->setIndirectObjectBaseAddress(ioh->getHeapGpuBase()); + stateBaseAddress->setIndirectObjectBufferSize(ioh->getHeapSizeInPages()); + } +} + } // namespace NEO diff --git a/shared/source/helpers/state_base_address_xehp_and_later.inl b/shared/source/helpers/state_base_address_xehp_and_later.inl index a78f0e59de..09db0be2a9 100644 --- a/shared/source/helpers/state_base_address_xehp_and_later.inl +++ b/shared/source/helpers/state_base_address_xehp_and_later.inl @@ -61,7 +61,6 @@ void StateBaseAddressHelper::appendStateBaseAddressParameters( stateBaseAddress->setInstructionMemoryObjectControlState(gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER_CACHELINE_MISALIGNED)); } - stateBaseAddress->setIndirectObjectMemoryObjectControlStateIndexToMocsTables(gmmHelper->getMOCS(l1L3CacheOnPolicy)); stateBaseAddress->setSurfaceStateMemoryObjectControlStateIndexToMocsTables(gmmHelper->getMOCS(l3CacheOnPolicy)); stateBaseAddress->setDynamicStateMemoryObjectControlStateIndexToMocsTables(gmmHelper->getMOCS(l3CacheOnPolicy)); stateBaseAddress->setGeneralStateMemoryObjectControlStateIndexToMocsTables(gmmHelper->getMOCS(l3CacheOnPolicy)); @@ -88,18 +87,6 @@ void StateBaseAddressHelper::appendStateBaseAddressParameters( setSbaStatelessCompressionParams(stateBaseAddress, memoryCompressionState); } - int32_t cachingPolicySetting = DebugManager.flags.UseCachingPolicyForIndirectObjectHeap.get(); - uint32_t indirectObjectHeapCachingPolicy = l1L3CacheOnPolicy; - - if (cachingPolicySetting != -1) { - if (cachingPolicySetting == 0) { - indirectObjectHeapCachingPolicy = GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER_CACHELINE_MISALIGNED; - } else if (cachingPolicySetting == 1) { - indirectObjectHeapCachingPolicy = GMM_RESOURCE_USAGE_OCL_STATE_HEAP_BUFFER; - } - } - stateBaseAddress->setIndirectObjectMemoryObjectControlStateIndexToMocsTables(gmmHelper->getMOCS(indirectObjectHeapCachingPolicy)); - if (stateBaseAddress->getStatelessDataPortAccessMemoryObjectControlState() == gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER) && DebugManager.flags.ForceL1Caching.get() != 0) { stateBaseAddress->setStatelessDataPortAccessMemoryObjectControlState(gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CONST)); } @@ -123,4 +110,8 @@ void StateBaseAddressHelper::programBindingTableBaseAddress(LinearStr *bindingTablePoolAlloc = cmd; } +template +void StateBaseAddressHelper::appendIohParameters(STATE_BASE_ADDRESS *stateBaseAddress, const IndirectHeap *ioh, bool useGlobalHeapsBaseAddress, uint64_t indirectObjectHeapBaseAddress) { +} + } // namespace NEO diff --git a/shared/test/common/cmd_parse/cmd_parse_xehp_and_later.inl b/shared/test/common/cmd_parse/cmd_parse_xehp_and_later.inl index 24242a5101..61e1dc2c1c 100644 --- a/shared/test/common/cmd_parse/cmd_parse_xehp_and_later.inl +++ b/shared/test/common/cmd_parse/cmd_parse_xehp_and_later.inl @@ -218,9 +218,6 @@ const void *HardwareParse::getStatelessArgumentPointer(const Kerne auto inlineDataSize = 32u; auto offsetCrossThreadData = cmdWalker->getIndirectDataStartAddress(); - auto baseAddress = is64bit ? 0u : cmdSBA->getIndirectObjectBaseAddress(); - EXPECT_LT(offsetCrossThreadData, baseAddress + cmdSBA->getIndirectObjectBufferSize() * MemoryConstants::pageSize); - offsetCrossThreadData -= static_cast(ioh.getGraphicsAllocation()->getGpuAddressToPatch()); // Get the base of cross thread diff --git a/shared/test/common/gen11/test_traits_gen11.h b/shared/test/common/gen11/test_traits_gen11.h index 71178d17df..ce4ffd569d 100644 --- a/shared/test/common/gen11/test_traits_gen11.h +++ b/shared/test/common/gen11/test_traits_gen11.h @@ -12,4 +12,5 @@ template <> struct TestTraits { static constexpr bool auxBuiltinsSupported = true; static constexpr bool programOnlyChangedFieldsInComputeStateMode = true; + static constexpr bool iohInSbaSupported = true; }; diff --git a/shared/test/common/gen12lp/test_traits_gen12lp.h b/shared/test/common/gen12lp/test_traits_gen12lp.h index c754f19f62..436e38c5c7 100644 --- a/shared/test/common/gen12lp/test_traits_gen12lp.h +++ b/shared/test/common/gen12lp/test_traits_gen12lp.h @@ -12,4 +12,5 @@ template <> struct TestTraits { static constexpr bool auxBuiltinsSupported = true; static constexpr bool programOnlyChangedFieldsInComputeStateMode = true; + static constexpr bool iohInSbaSupported = true; }; diff --git a/shared/test/common/gen8/test_traits_gen8.h b/shared/test/common/gen8/test_traits_gen8.h index ab820f8c8c..f642650d90 100644 --- a/shared/test/common/gen8/test_traits_gen8.h +++ b/shared/test/common/gen8/test_traits_gen8.h @@ -12,4 +12,5 @@ template <> struct TestTraits { static constexpr bool auxBuiltinsSupported = true; static constexpr bool programOnlyChangedFieldsInComputeStateMode = true; + static constexpr bool iohInSbaSupported = true; }; diff --git a/shared/test/common/gen9/test_traits_gen9.h b/shared/test/common/gen9/test_traits_gen9.h index 6d1e5bc28d..c9e69fe2a7 100644 --- a/shared/test/common/gen9/test_traits_gen9.h +++ b/shared/test/common/gen9/test_traits_gen9.h @@ -12,4 +12,5 @@ template <> struct TestTraits { static constexpr bool auxBuiltinsSupported = true; static constexpr bool programOnlyChangedFieldsInComputeStateMode = true; + static constexpr bool iohInSbaSupported = true; }; diff --git a/shared/test/common/helpers/state_base_address_tests.cpp b/shared/test/common/helpers/state_base_address_tests.cpp index d8345b81c2..5ec863c379 100644 --- a/shared/test/common/helpers/state_base_address_tests.cpp +++ b/shared/test/common/helpers/state_base_address_tests.cpp @@ -109,7 +109,10 @@ HWTEST2_F(SbaForBindlessTests, givenGlobalBindlessBaseAddressWhenProgramStateBas EXPECT_EQ(cmd->getBindlessSurfaceStateBaseAddress(), globalBindlessHeapsBaseAddress); EXPECT_EQ(cmd->getBindlessSurfaceStateSize(), MemoryConstants::sizeOf4GBinPageEntities); } -HWTEST2_F(SbaForBindlessTests, givenGlobalBindlessBaseAddressWhenPassingIndirectBaseAddressThenIndirectBaseAddressIsSet, IsSklOrAbove) { + +using IohSupported = IsWithinGfxCore; + +HWTEST2_F(SbaForBindlessTests, givenGlobalBindlessBaseAddressWhenPassingIndirectBaseAddressThenIndirectBaseAddressIsSet, IohSupported) { using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS; EXPECT_NE(IGFX_BROADWELL, ::productFamily); diff --git a/shared/test/common/xe_hp_core/test_traits_xe_hp_core.h b/shared/test/common/xe_hp_core/test_traits_xe_hp_core.h index af3908e18d..1a6e22be11 100644 --- a/shared/test/common/xe_hp_core/test_traits_xe_hp_core.h +++ b/shared/test/common/xe_hp_core/test_traits_xe_hp_core.h @@ -18,4 +18,5 @@ struct TestTraits { static constexpr bool forceNonCoherentSupported = true; static constexpr bool threadPreemptionDisableBitMatcher = true; static constexpr bool programOnlyChangedFieldsInComputeStateMode = false; + static constexpr bool iohInSbaSupported = false; }; diff --git a/shared/test/unit_test/encoders/test_encode_states.cpp b/shared/test/unit_test/encoders/test_encode_states.cpp index 82d56d62ee..6327a90cab 100644 --- a/shared/test/unit_test/encoders/test_encode_states.cpp +++ b/shared/test/unit_test/encoders/test_encode_states.cpp @@ -15,6 +15,8 @@ #include "shared/test/common/helpers/unit_test_helper.h" #include "shared/test/common/mocks/mock_device.h" +#include "test_traits_common.h" + using namespace NEO; using CommandEncodeStatesTest = Test; @@ -249,7 +251,7 @@ HWTEST_F(CommandEncodeStatesTest, givenCreatedSurfaceStateBufferWhenGpuCoherency alignedFree(stateBuffer); } -HWTEST_F(CommandEncodeStatesTest, givenCommandContainerWithDirtyHeapsWhenSetStateBaseAddressCalledThenStateBaseAddressAreNotSet) { +HWTEST2_F(CommandEncodeStatesTest, givenCommandContainerWithDirtyHeapsWhenSetStateBaseAddressCalledThenStateBaseAddressAreNotSet, MatchAny) { using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS; cmdContainer->dirtyHeaps = 0; @@ -261,7 +263,6 @@ HWTEST_F(CommandEncodeStatesTest, givenCommandContainerWithDirtyHeapsWhenSetStat EncodeStateBaseAddress::encode(*cmdContainer.get(), sba); auto dsh = cmdContainer->getIndirectHeap(NEO::HeapType::DYNAMIC_STATE); - auto ioh = cmdContainer->getIndirectHeap(NEO::HeapType::INDIRECT_OBJECT); auto ssh = cmdContainer->getIndirectHeap(NEO::HeapType::SURFACE_STATE); GenCmdList commands; @@ -271,12 +272,17 @@ HWTEST_F(CommandEncodeStatesTest, givenCommandContainerWithDirtyHeapsWhenSetStat auto pCmd = genCmdCast(*itorCmd); 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()); + + if constexpr (TestTraits::iohInSbaSupported) { + auto ioh = cmdContainer->getIndirectHeap(NEO::HeapType::INDIRECT_OBJECT); + + EXPECT_EQ(ioh->getHeapGpuBase(), pCmd->getIndirectObjectBaseAddress()); + EXPECT_EQ(sba.getIndirectObjectBaseAddress(), pCmd->getIndirectObjectBaseAddress()); + } } HWTEST_F(CommandEncodeStatesTest, givenCommandContainerWhenSetStateBaseAddressCalledThenStateBaseAddressIsSetCorrectly) {