refactor: move empty sba programming in heapless prolog to base class

Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2025-07-07 15:25:38 +00:00
committed by Compute-Runtime-Automation
parent 2661fd9522
commit 2edd953026
5 changed files with 57 additions and 33 deletions

View File

@@ -5980,7 +5980,6 @@ HWTEST_F(CommandStreamReceiverHwHeaplessTest, whenHeaplessCommandStreamReceiverF
EXPECT_ANY_THROW(csr->flushTaskHeapless(commandStream, 0, nullptr, nullptr, nullptr, 0, csr->recordedDispatchFlags, *pDevice));
EXPECT_ANY_THROW(csr->programHeaplessProlog(*pDevice));
EXPECT_ANY_THROW(csr->programStateBaseAddressHeapless(*pDevice, commandStream));
EXPECT_ANY_THROW(csr->programComputeModeHeapless(*pDevice, commandStream));
EXPECT_ANY_THROW(csr->getCmdSizeForHeaplessPrologue(*pDevice));
EXPECT_ANY_THROW(csr->handleAllocationsResidencyForHeaplessProlog(commandStream, *pDevice));
@@ -6387,12 +6386,21 @@ HWTEST_F(CommandStreamReceiverHwTest, givenEpilogueStreamAvailableWhenFlushBcsTa
HWTEST_F(CommandStreamReceiverHwTest, givenEpilogueStreamAvailableWhenFlushImmediateTaskCalledThenDispachEpilogueCommandsIntoEpilogueStream) {
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
auto heaplessStateInit = commandStreamReceiver.heaplessStateInitialized;
// first flush can carry preamble, no interest in flags here
commandStreamReceiver.flushImmediateTask(commandStream,
commandStream.getUsed(),
immediateFlushTaskFlags,
*pDevice);
if (heaplessStateInit) {
commandStreamReceiver.flushImmediateTaskStateless(commandStream,
commandStream.getUsed(),
immediateFlushTaskFlags,
*pDevice);
} else {
commandStreamReceiver.flushImmediateTask(commandStream,
commandStream.getUsed(),
immediateFlushTaskFlags,
*pDevice);
}
// regular dispatch here
GraphicsAllocation *commandBuffer = commandStreamReceiver.getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties{commandStreamReceiver.getRootDeviceIndex(), MemoryConstants::pageSize});
@@ -6405,10 +6413,17 @@ HWTEST_F(CommandStreamReceiverHwTest, givenEpilogueStreamAvailableWhenFlushImmed
immediateFlushTaskFlags.requireTaskCountUpdate = true;
immediateFlushTaskFlags.optionalEpilogueCmdStream = &epilogueStream;
commandStreamReceiver.flushImmediateTask(commandStream,
commandStream.getUsed(),
immediateFlushTaskFlags,
*pDevice);
if (heaplessStateInit) {
commandStreamReceiver.flushImmediateTaskStateless(commandStream,
commandStream.getUsed(),
immediateFlushTaskFlags,
*pDevice);
} else {
commandStreamReceiver.flushImmediateTask(commandStream,
commandStream.getUsed(),
immediateFlushTaskFlags,
*pDevice);
}
EXPECT_TRUE(commandStreamReceiver.isMadeResident(commandBuffer));
EXPECT_TRUE(commandStreamReceiver.latestFlushedBatchBuffer.dispatchMonitorFence);
@@ -6442,14 +6457,22 @@ HWTEST_F(CommandStreamReceiverHwTest, givenFlushBcsTaskCmdListDispatchWhenCalled
HWTEST_F(CommandStreamReceiverHwTest, givenImmediateFlushTaskCmdListDispatchWhenFlushingBufferThenDisableFlatRingBuffer) {
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
auto heaplessStateInit = commandStreamReceiver.heaplessStateInitialized;
commandStreamReceiver.recordFlushedBatchBuffer = true;
immediateFlushTaskFlags.dispatchOperation = NEO::AppendOperations::cmdList;
commandStreamReceiver.flushImmediateTask(commandStream,
commandStream.getUsed(),
immediateFlushTaskFlags,
*pDevice);
if (heaplessStateInit) {
commandStreamReceiver.flushImmediateTaskStateless(commandStream,
commandStream.getUsed(),
immediateFlushTaskFlags,
*pDevice);
} else {
commandStreamReceiver.flushImmediateTask(commandStream,
commandStream.getUsed(),
immediateFlushTaskFlags,
*pDevice);
}
EXPECT_TRUE(commandStreamReceiver.latestFlushedBatchBuffer.disableFlatRingBuffer);
}