mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Do not call submit on HardwareContext with zero-sized command buffer
Change-Id: I53b9233b30f58e2fcb354142eb1186a20c834d62
This commit is contained in:
committed by
sys_ocldev
parent
d870359434
commit
e88548a251
@@ -175,7 +175,7 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenFlushIsCalledThenI
|
||||
aubCsr->hardwareContext = std::unique_ptr<MockHardwareContext>(mockHardwareContext);
|
||||
|
||||
LinearStream cs(aubExecutionEnvironment->commandBuffer);
|
||||
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
|
||||
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 1, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
|
||||
ResidencyContainer allocationsForResidency;
|
||||
|
||||
aubCsr->flush(batchBuffer, allocationsForResidency);
|
||||
@@ -186,6 +186,23 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenFlushIsCalledThenI
|
||||
EXPECT_TRUE(mockHardwareContext->pollForCompletionCalled);
|
||||
}
|
||||
|
||||
HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenFlushIsCalledWithZeroSizedBufferThenSubmitIsNotCalledOnHwContext) {
|
||||
auto mockManager = std::make_unique<MockAubManager>();
|
||||
auto mockHardwareContext = static_cast<MockHardwareContext *>(mockManager->createHardwareContext(0, EngineType::ENGINE_RCS));
|
||||
|
||||
auto aubExecutionEnvironment = getEnvironment<MockAubCsr<FamilyType>>(true, true, true);
|
||||
auto aubCsr = aubExecutionEnvironment->template getCsr<MockAubCsr<FamilyType>>();
|
||||
aubCsr->hardwareContext = std::unique_ptr<MockHardwareContext>(mockHardwareContext);
|
||||
|
||||
LinearStream cs(aubExecutionEnvironment->commandBuffer);
|
||||
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
|
||||
ResidencyContainer allocationsForResidency;
|
||||
|
||||
aubCsr->flush(batchBuffer, allocationsForResidency);
|
||||
|
||||
EXPECT_FALSE(mockHardwareContext->submitCalled);
|
||||
}
|
||||
|
||||
HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenMakeResidentIsCalledThenItShouldCallTheExpectedHwContextFunctions) {
|
||||
auto mockManager = std::make_unique<MockAubManager>();
|
||||
auto mockHardwareContext = static_cast<MockHardwareContext *>(mockManager->createHardwareContext(0, EngineType::ENGINE_RCS));
|
||||
|
||||
Reference in New Issue
Block a user