From ddc0b0d03b0eae6484cb3eb3299a005b7ef14bf8 Mon Sep 17 00:00:00 2001 From: Zbigniew Zdanowicz Date: Tue, 11 Mar 2025 22:35:08 +0000 Subject: [PATCH] feature: disable flat ring buffer for command list append operation Related-To: NEO-10356 Signed-off-by: Zbigniew Zdanowicz --- .../command_stream_receiver_hw_base.inl | 4 +++- .../command_stream_receiver_tests.cpp | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) 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 a9433e9042..7d7fe167e3 100644 --- a/shared/source/command_stream/command_stream_receiver_hw_base.inl +++ b/shared/source/command_stream/command_stream_receiver_hw_base.inl @@ -275,7 +275,7 @@ CompletionStamp CommandStreamReceiverHw::flushBcsTask(LinearStream &c false, getThrottleFromPowerSavingUint(this->getUmdPowerHintValue()), NEO::QueueSliceCount::defaultSliceCount, streamToSubmit.getUsed(), &streamToSubmit, bbEndLocation, this->getNumClients(), (submitCSR || dispatchBcsFlags.hasStallingCmds || dispatchBcsFlags.flushTaskCount), dispatchBcsFlags.hasRelaxedOrderingDependencies, dispatchBcsFlags.flushTaskCount, false}; - + batchBuffer.disableFlatRingBuffer = dispatchBcsFlags.dispatchOperation == AppendOperations::cmdList; updateStreamTaskCount(streamToSubmit, taskCount + 1); this->latestSentTaskCount = taskCount + 1; @@ -2247,6 +2247,8 @@ CompletionStamp CommandStreamReceiverHw::handleImmediateFlushSendBatc immediateLowPriority, immediateThrottle, immediateSliceCount, streamToSubmit.getUsed(), &streamToSubmit, flushData.endPtr, this->getNumClients(), hasStallingCmds, dispatchFlags.hasRelaxedOrderingDependencies, dispatchMonitorFence, false}; + batchBuffer.disableFlatRingBuffer = dispatchFlags.dispatchOperation == AppendOperations::cmdList; + updateStreamTaskCount(streamToSubmit, taskCount + 1); auto submissionStatus = flushHandler(batchBuffer, this->getResidencyAllocations()); diff --git a/shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp b/shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp index ebff4e343e..033e1fab95 100644 --- a/shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp +++ b/shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp @@ -6398,10 +6398,26 @@ HWTEST_F(CommandStreamReceiverHwTest, givenFlushBcsTaskCmdListDispatchWhenCalled size_t usedSize = commandStreamReceiver.commandStream.getUsed(); + commandStreamReceiver.recordFlushedBatchBuffer = true; commandStreamReceiver.flushBcsTask(commandStream, commandStream.getUsed(), dispatchBcsFlags, pDevice->getHardwareInfo()); EXPECT_EQ(usedSize, commandStreamReceiver.commandStream.getUsed()); + EXPECT_TRUE(commandStreamReceiver.latestFlushedBatchBuffer.disableFlatRingBuffer); +} + +HWTEST_F(CommandStreamReceiverHwTest, givenImmediateFlushTaskCmdListDispatchWhenFlushingBufferThenDisableFlatRingBuffer) { + auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver(); + + commandStreamReceiver.recordFlushedBatchBuffer = true; + + immediateFlushTaskFlags.dispatchOperation = NEO::AppendOperations::cmdList; + commandStreamReceiver.flushImmediateTask(commandStream, + commandStream.getUsed(), + immediateFlushTaskFlags, + *pDevice); + + EXPECT_TRUE(commandStreamReceiver.latestFlushedBatchBuffer.disableFlatRingBuffer); }