fix: program RenderTargetCacheFlush in PC prior to PIPELINE_SELECT

- fix code by removing csStallOnly that skipped seeting RTCF flag

Related-To: NEO-9194

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2024-10-09 15:15:32 +00:00
committed by Compute-Runtime-Automation
parent e690217227
commit 31265edfee
3 changed files with 25 additions and 6 deletions

View File

@@ -432,6 +432,7 @@ using PipelineSelectTest = ::testing::Test;
HWTEST2_F(PipelineSelectTest, WhenProgramPipelineSelectThenProperMaskIsSet, IsWithinXeGfxFamily) {
using PIPELINE_SELECT = typename FamilyType::PIPELINE_SELECT;
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
MockExecutionEnvironment mockExecutionEnvironment{};
auto &rootDeviceEnvironment = *mockExecutionEnvironment.rootDeviceEnvironments[0];
@@ -439,10 +440,7 @@ HWTEST2_F(PipelineSelectTest, WhenProgramPipelineSelectThenProperMaskIsSet, IsWi
std::vector<uint8_t> linearStreamBackingMemory;
size_t sizeNeededForCommandSream = 0;
if (MemorySynchronizationCommands<FamilyType>::isBarrierPriorToPipelineSelectWaRequired(rootDeviceEnvironment)) {
PipeControlArgs args;
args.csStallOnly = true;
args.renderTargetCacheFlushEnable = true;
sizeNeededForCommandSream += MemorySynchronizationCommands<FamilyType>::getSizeForSingleBarrier(args.tlbInvalidation);
sizeNeededForCommandSream += MemorySynchronizationCommands<FamilyType>::getSizeForSingleBarrier(false);
}
sizeNeededForCommandSream += sizeof(PIPELINE_SELECT);
@@ -468,4 +466,23 @@ HWTEST2_F(PipelineSelectTest, WhenProgramPipelineSelectThenProperMaskIsSet, IsWi
}
EXPECT_EQ(expectedMask, cmd->getMaskBits());
HardwareParse hwParser;
hwParser.parsePipeControl = true;
hwParser.parseCommands<FamilyType>(pipelineSelectStream, 0);
hwParser.findHardwareCommands<FamilyType>();
if (MemorySynchronizationCommands<FamilyType>::isBarrierPriorToPipelineSelectWaRequired(rootDeviceEnvironment)) {
bool pcWithRenderFlushFound = false;
auto itorPipeControl = hwParser.pipeControlList.begin();
if (itorPipeControl != hwParser.pipeControlList.end()) {
auto pipeControl = reinterpret_cast<PIPE_CONTROL *>(*itorPipeControl);
if (pipeControl->getRenderTargetCacheFlushEnable()) {
pcWithRenderFlushFound = true;
}
}
EXPECT_TRUE(pcWithRenderFlushFound);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2023 Intel Corporation
* Copyright (C) 2023-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -27,7 +27,6 @@ void PreambleHelper<Family>::programPipelineSelect(LinearStream *pCommandStream,
if (MemorySynchronizationCommands<Family>::isBarrierPriorToPipelineSelectWaRequired(rootDeviceEnvironment)) {
PipeControlArgs args;
args.csStallOnly = true;
args.renderTargetCacheFlushEnable = true;
MemorySynchronizationCommands<Family>::addSingleBarrier(*pCommandStream, args);
}

View File

@@ -66,6 +66,9 @@ HWTEST2_F(PreambleTest, givenSpecificDeviceWhenProgramPipelineSelectIsCalledThen
auto numPipeControl = hwParser.getCommandsList<PIPE_CONTROL>().size();
EXPECT_EQ(1u, numPipeControl);
auto pipeControl = hwParser.getCommand<PIPE_CONTROL>();
EXPECT_TRUE(pipeControl->getRenderTargetCacheFlushEnable());
auto numPipelineSelect = hwParser.getCommandsList<PIPELINE_SELECT>().size();
EXPECT_EQ(1u, numPipelineSelect);
}