From b2b3b55b1961704cda6a3e5937b4e3e8780bbfb3 Mon Sep 17 00:00:00 2001 From: Compute-Runtime-Validation Date: Tue, 11 Mar 2025 02:53:44 +0100 Subject: [PATCH] Revert "feature: enable dispatch primary batch buffer from immediate" This reverts commit fc770cacf2e88ca941a756d48569aed6222dba3e. Signed-off-by: Compute-Runtime-Validation --- level_zero/core/source/cmdlist/cmdlist_hw.inl | 2 +- level_zero/core/source/cmdqueue/cmdqueue.cpp | 2 +- .../sources/cmdlist/test_cmdlist_2.cpp | 46 ++----------------- 3 files changed, 5 insertions(+), 45 deletions(-) diff --git a/level_zero/core/source/cmdlist/cmdlist_hw.inl b/level_zero/core/source/cmdlist/cmdlist_hw.inl index 6ca30a66c8..ea7a24627f 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw.inl @@ -246,7 +246,7 @@ ze_result_t CommandListCoreFamily::initialize(Device *device, NEO this->l1CachePolicyData.init(productHelper); this->cmdListHeapAddressModel = L0GfxCoreHelper::getHeapAddressModel(rootDeviceEnvironment); this->dummyBlitWa.rootDeviceEnvironment = &(neoDevice->getRootDeviceEnvironmentRef()); - this->dispatchCmdListBatchBufferAsPrimary = L0GfxCoreHelper::dispatchCmdListBatchBufferAsPrimary(rootDeviceEnvironment, !(this->internalUsage && isImmediateType())); + this->dispatchCmdListBatchBufferAsPrimary = L0GfxCoreHelper::dispatchCmdListBatchBufferAsPrimary(rootDeviceEnvironment, !isImmediateType()); this->useOnlyGlobalTimestamps = gfxCoreHelper.useOnlyGlobalTimestamps(); this->maxFillPaternSizeForCopyEngine = productHelper.getMaxFillPaternSizeForCopyEngine(); this->heaplessModeEnabled = compilerProductHelper.isHeaplessModeEnabled(); diff --git a/level_zero/core/source/cmdqueue/cmdqueue.cpp b/level_zero/core/source/cmdqueue/cmdqueue.cpp index 6a4cefd258..d1594e83ee 100644 --- a/level_zero/core/source/cmdqueue/cmdqueue.cpp +++ b/level_zero/core/source/cmdqueue/cmdqueue.cpp @@ -98,7 +98,7 @@ ze_result_t CommandQueueImp::initialize(bool copyOnly, bool isInternal, bool imm auto &productHelper = rootDeviceEnvironment.getHelper(); this->doubleSbaWa = productHelper.isAdditionalStateBaseAddressWARequired(hwInfo); this->cmdListHeapAddressModel = L0GfxCoreHelper::getHeapAddressModel(rootDeviceEnvironment); - this->dispatchCmdListBatchBufferAsPrimary = L0GfxCoreHelper::dispatchCmdListBatchBufferAsPrimary(rootDeviceEnvironment, !(internalUsage && immediateCmdListQueue)); + this->dispatchCmdListBatchBufferAsPrimary = L0GfxCoreHelper::dispatchCmdListBatchBufferAsPrimary(rootDeviceEnvironment, !immediateCmdListQueue); auto &compilerProductHelper = rootDeviceEnvironment.getHelper(); this->heaplessModeEnabled = compilerProductHelper.isHeaplessModeEnabled(); this->heaplessStateInitEnabled = compilerProductHelper.isHeaplessStateInitEnabled(this->heaplessModeEnabled); diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp index 856e1a318d..7560d5bf05 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp @@ -1729,14 +1729,14 @@ HWTEST2_F(CommandListCreateTests, givenPlatformNotSupportsSharedHeapsWhenImmedia using PrimaryBatchBufferCmdListTest = Test; -HWTEST_F(PrimaryBatchBufferCmdListTest, givenForcedPrimaryBatchBufferWhenRegularAndImmediateObjectCreatedThenRegularAndImmediateSetPrimaryFlag) { +HWTEST_F(PrimaryBatchBufferCmdListTest, givenForcedPrimaryBatchBufferWhenRegularAndImmediateObjectCreatedThenRegularSetPrimaryFlagAndImmediateNot) { EXPECT_TRUE(commandList->dispatchCmdListBatchBufferAsPrimary); EXPECT_TRUE(commandQueue->dispatchCmdListBatchBufferAsPrimary); - EXPECT_TRUE(commandListImmediate->dispatchCmdListBatchBufferAsPrimary); + EXPECT_FALSE(commandListImmediate->dispatchCmdListBatchBufferAsPrimary); ASSERT_NE(nullptr, commandListImmediate->cmdQImmediate); auto immediateCmdQueue = static_cast(commandListImmediate->cmdQImmediate); - EXPECT_TRUE(immediateCmdQueue->dispatchCmdListBatchBufferAsPrimary); + EXPECT_FALSE(immediateCmdQueue->dispatchCmdListBatchBufferAsPrimary); } HWTEST_F(PrimaryBatchBufferCmdListTest, givenPrimaryBatchBufferWhenAppendingKernelAndClosingCommandListThenExpectAlignedSpaceForBatchBufferStart) { @@ -1851,46 +1851,6 @@ HWTEST_F(PrimaryBatchBufferCmdListTest, givenRegularCmdListWhenFlushingThenPassS EXPECT_TRUE(ultCsr->latestFlushedBatchBuffer.hasStallingCmds); } -HWTEST_F(PrimaryBatchBufferCmdListTest, givenRegularCmdListWhenNoPreambleExpectedAndForceBbStartThenDispatchBbStart) { - using MI_BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START; - - ze_group_count_t groupCount{1, 1, 1}; - CmdListKernelLaunchParams launchParams = {}; - auto result = commandList->appendLaunchKernel(kernel->toHandle(), groupCount, nullptr, 0, nullptr, launchParams, false); - EXPECT_EQ(ZE_RESULT_SUCCESS, result); - result = commandList->close(); - EXPECT_EQ(ZE_RESULT_SUCCESS, result); - auto cmdListHandle = commandList->toHandle(); - - auto regularCmdBufferAllocation = commandList->getCmdContainer().getCommandStream()->getGraphicsAllocation(); - - // 1st dispatch can carry state preamble - result = commandQueue->executeCommandLists(1, &cmdListHandle, nullptr, true, nullptr); - EXPECT_EQ(ZE_RESULT_SUCCESS, result); - - auto &queueStream = commandQueue->commandStream; - - auto offsetBefore = queueStream.getUsed(); - commandQueue->triggerBbStartJump(); - result = commandQueue->executeCommandLists(1, &cmdListHandle, nullptr, true, nullptr); - EXPECT_EQ(ZE_RESULT_SUCCESS, result); - auto offsetAfter = queueStream.getUsed(); - - GenCmdList cmdList; - ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer( - cmdList, - ptrOffset(queueStream.getCpuBase(), offsetBefore), - offsetAfter - offsetBefore)); - ASSERT_NE(0u, cmdList.size()); - - auto firstCmdIt = cmdList.begin(); - auto bbStartCmd = genCmdCast(*firstCmdIt); - ASSERT_NE(nullptr, bbStartCmd); - - EXPECT_EQ(regularCmdBufferAllocation->getGpuAddress(), bbStartCmd->getBatchBufferStartAddress()); - EXPECT_EQ(MI_BATCH_BUFFER_START::SECOND_LEVEL_BATCH_BUFFER::SECOND_LEVEL_BATCH_BUFFER_FIRST_LEVEL_BATCH, bbStartCmd->getSecondLevelBatchBuffer()); -} - HWTEST2_F(PrimaryBatchBufferCmdListTest, givenRelaxedOrderingAndRegularCmdListAndSubmittedToImmediateWhenFlushingThenPassStallingCmdsInfo, IsAtLeastXeHpcCore) { DebugManagerStateRestore restore; debugManager.flags.DirectSubmissionRelaxedOrdering.set(1);