Skip to content

Commit d63a044

Browse files
Add infrastructure to request ULLS restart
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
1 parent e9be9b6 commit d63a044

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

shared/source/command_stream/submissions_aggregator.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018-2021 Intel Corporation
2+
* Copyright (C) 2018-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -48,6 +48,7 @@ struct BatchBuffer {
4848
void *endCmdPtr = nullptr;
4949

5050
bool useSingleSubdevice = false;
51+
bool ringBufferRestartRequest = false;
5152
};
5253

5354
struct CommandBuffer : public IDNode<CommandBuffer> {

shared/source/direct_submission/direct_submission_hw.inl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,10 @@ bool DirectSubmissionHw<GfxFamily, Dispatcher>::dispatchCommandBuffer(BatchBuffe
429429
//for now workloads requiring cache coherency are not supported
430430
UNRECOVERABLE_IF(batchBuffer.requiresCoherency);
431431

432+
if (batchBuffer.ringBufferRestartRequest) {
433+
this->stopRingBuffer();
434+
}
435+
432436
this->startRingBuffer();
433437

434438
size_t dispatchSize = getSizeDispatch();

shared/test/unit_test/direct_submission/direct_submission_tests_2.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,23 @@ HWTEST_F(DirectSubmissionDispatchBufferTest,
830830
EXPECT_EQ(expectedValue, directSubmission.reserved);
831831
}
832832

833+
HWTEST_F(DirectSubmissionDispatchBufferTest, givenRingBufferRestartRequestWhenDispatchCommandBuffer) {
834+
FlushStampTracker flushStamp(true);
835+
MockDirectSubmissionHw<FamilyType, BlitterDispatcher<FamilyType>> directSubmission(*pDevice->getDefaultEngine().commandStreamReceiver);
836+
bool ret = directSubmission.initialize(true, true);
837+
EXPECT_TRUE(ret);
838+
EXPECT_EQ(directSubmission.submitCount, 1u);
839+
840+
ret = directSubmission.dispatchCommandBuffer(batchBuffer, flushStamp);
841+
EXPECT_TRUE(ret);
842+
EXPECT_EQ(directSubmission.submitCount, 1u);
843+
844+
batchBuffer.ringBufferRestartRequest = true;
845+
ret = directSubmission.dispatchCommandBuffer(batchBuffer, flushStamp);
846+
EXPECT_TRUE(ret);
847+
EXPECT_EQ(directSubmission.submitCount, 2u);
848+
}
849+
833850
HWTEST_F(DirectSubmissionDispatchBufferTest, givenDebugFlagSetWhenDispatchingWorkloadThenProgramSfenceInstruction) {
834851
DebugManagerStateRestore restorer{};
835852

0 commit comments

Comments
 (0)