Skip to content

Commit 70f508d

Browse files
fix: do not process scratch space when no surface heap pointer provided
Related-To: NEO-8281 Source: 873b3d4 Signed-off-by: Zbigniew Zdanowicz <[email protected]>
1 parent e30970e commit 70f508d

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

shared/source/command_stream/command_stream_receiver_hw_base.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushImmediateTask(
275275
flushData.stateComputeModeFullConfigurationNeeded = getStateComputeModeDirty();
276276
flushData.stateBaseAddressFullConfigurationNeeded = getGSBAStateDirty();
277277

278-
if (this->requiredScratchSize > 0 || this->requiredPrivateScratchSize > 0) {
278+
if (dispatchFlags.sshCpuBase != nullptr && (this->requiredScratchSize > 0 || this->requiredPrivateScratchSize > 0)) {
279279
bool checkFeStateDirty = false;
280280
bool checkSbaStateDirty = false;
281281
scratchSpaceController->setRequiredScratchSpace(dispatchFlags.sshCpuBase,

shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4312,3 +4312,30 @@ HWTEST_F(CommandStreamReceiverHwTest, givenDcFlushRequiredFalseWhenProgramStalli
43124312
ASSERT_NE(nullptr, pipeControl);
43134313
EXPECT_FALSE(pipeControl->getDcFlushEnable());
43144314
}
4315+
4316+
HWTEST2_F(CommandStreamReceiverHwTest,
4317+
givenImmediateFlushTaskWhenNextDispatchRequiresScratchSpaceAndSshPointerIsNullThenFrontEndCommandIsNotDispatched,
4318+
IsAtLeastXeHpCore) {
4319+
using CFE_STATE = typename FamilyType::CFE_STATE;
4320+
4321+
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
4322+
4323+
EXPECT_TRUE(commandStreamReceiver.getMediaVFEStateDirty());
4324+
4325+
commandStreamReceiver.flushImmediateTask(commandStream, commandStream.getUsed(), immediateFlushTaskFlags, *pDevice);
4326+
4327+
commandStreamReceiver.setRequiredScratchSizes(0x100, 0);
4328+
immediateFlushTaskFlags.sshCpuBase = nullptr;
4329+
4330+
size_t usedSize = commandStreamReceiver.commandStream.getUsed();
4331+
commandStreamReceiver.flushImmediateTask(commandStream,
4332+
commandStream.getUsed(),
4333+
immediateFlushTaskFlags,
4334+
*pDevice);
4335+
4336+
HardwareParse hwParserCsr;
4337+
hwParserCsr.parseCommands<FamilyType>(commandStreamReceiver.commandStream, usedSize);
4338+
auto frontEndCmd = hwParserCsr.getCommand<CFE_STATE>();
4339+
EXPECT_EQ(nullptr, frontEndCmd);
4340+
EXPECT_FALSE(commandStreamReceiver.getMediaVFEStateDirty());
4341+
}

0 commit comments

Comments
 (0)