mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 09:14:47 +08:00
Program PIPE CONTROL before SBA
Related-To: NEO-6056 Signed-off-by: Krzysztof Gibala <krzysztof.gibala@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
27bf56ee5a
commit
8482eb6a5f
@@ -1020,7 +1020,17 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenEnoughMemoryOnlyForPreambleAn
|
||||
// This case handles when we have *just* enough space
|
||||
auto expectedUsed = csrCS.getUsed() + sizeNeeded;
|
||||
|
||||
flushTask(commandStreamReceiver, flushTaskFlags.blocking, 0, flushTaskFlags.requiresCoherency, flushTaskFlags.lowPriority);
|
||||
flushTaskFlags.preemptionMode = PreemptionHelper::getDefaultPreemptionMode(mockDevice->getHardwareInfo());
|
||||
|
||||
commandStreamReceiver.flushTask(
|
||||
commandStream,
|
||||
0,
|
||||
dsh,
|
||||
ioh,
|
||||
ssh,
|
||||
taskLevel,
|
||||
flushTaskFlags,
|
||||
*mockDevice);
|
||||
|
||||
// Verify that we didn't grab a new CS buffer
|
||||
EXPECT_EQ(expectedUsed, csrCS.getUsed());
|
||||
|
||||
@@ -94,6 +94,33 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, gi
|
||||
EXPECT_TRUE(pipeControlCmd->getHdcPipelineFlush());
|
||||
}
|
||||
|
||||
HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, givenProgramAdditionalPipeControlBeforeStateComputeModeCommandDebugKeyAndStateBaseAddressWhenItIsRequiredThenThereIsPipeControlPriorToIt) {
|
||||
DebugManagerStateRestore dbgRestorer;
|
||||
DebugManager.flags.ProgramAdditionalPipeControlBeforeStateComputeModeCommand.set(true);
|
||||
|
||||
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
|
||||
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
|
||||
|
||||
configureCSRtoNonDirtyState<FamilyType>(false);
|
||||
ioh.replaceBuffer(ptrOffset(ioh.getCpuBase(), +1u), ioh.getMaxAvailableSpace() + MemoryConstants::pageSize * 3);
|
||||
flushTask(commandStreamReceiver);
|
||||
parseCommands<FamilyType>(commandStreamReceiver.getCS(0));
|
||||
|
||||
auto stateBaseAddressItor = find<STATE_BASE_ADDRESS *>(cmdList.begin(), cmdList.end());
|
||||
auto pipeControlItor = find<typename FamilyType::PIPE_CONTROL *>(cmdList.begin(), stateBaseAddressItor);
|
||||
EXPECT_NE(stateBaseAddressItor, pipeControlItor);
|
||||
auto pipeControlCmd = reinterpret_cast<typename FamilyType::PIPE_CONTROL *>(*pipeControlItor);
|
||||
EXPECT_TRUE(pipeControlCmd->getHdcPipelineFlush());
|
||||
EXPECT_TRUE(pipeControlCmd->getAmfsFlushEnable());
|
||||
EXPECT_TRUE(pipeControlCmd->getCommandStreamerStallEnable());
|
||||
EXPECT_TRUE(pipeControlCmd->getInstructionCacheInvalidateEnable());
|
||||
EXPECT_TRUE(pipeControlCmd->getTextureCacheInvalidationEnable());
|
||||
EXPECT_TRUE(pipeControlCmd->getConstantCacheInvalidationEnable());
|
||||
EXPECT_TRUE(pipeControlCmd->getStateCacheInvalidationEnable());
|
||||
EXPECT_EQ(MemorySynchronizationCommands<FamilyType>::isDcFlushAllowed(), pipeControlCmd->getDcFlushEnable());
|
||||
EXPECT_TRUE(pipeControlCmd->getHdcPipelineFlush());
|
||||
}
|
||||
|
||||
HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, whenNotReprogrammingSshButInitProgrammingFlagsThenBindingTablePoolIsProgrammed) {
|
||||
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
|
||||
|
||||
|
||||
@@ -61,6 +61,19 @@ inline void CommandStreamReceiverHw<Family>::addPipeControlBeforeStateBaseAddres
|
||||
PipeControlArgs args(true);
|
||||
args.textureCacheInvalidationEnable = true;
|
||||
args.hdcPipelineFlush = true;
|
||||
|
||||
auto hwInfo = peekHwInfo();
|
||||
auto hwInfoConfig = HwInfoConfig::get(hwInfo.platform.eProductFamily);
|
||||
|
||||
if (hwInfoConfig->isPipeControlPriorToNonPipelinedStateCommandsWARequired(hwInfo)) {
|
||||
args.hdcPipelineFlush = true;
|
||||
args.amfsFlushEnable = true;
|
||||
args.instructionCacheInvalidateEnable = true;
|
||||
args.dcFlushEnable = true;
|
||||
args.constantCacheInvalidationEnable = true;
|
||||
args.stateCacheInvalidationEnable = true;
|
||||
}
|
||||
|
||||
addPipeControlCmd(commandStream, args);
|
||||
}
|
||||
} // namespace NEO
|
||||
|
||||
@@ -22,6 +22,7 @@ struct PipeControlArgsBase {
|
||||
bool compressionControlSurfaceCcsFlush = false;
|
||||
bool notifyEnable = false;
|
||||
bool workloadPartitionOffset = false;
|
||||
bool amfsFlushEnable = false;
|
||||
|
||||
protected:
|
||||
PipeControlArgsBase() = default;
|
||||
|
||||
@@ -143,6 +143,7 @@ void MemorySynchronizationCommands<Family>::setPipeControlExtraProperties(PIPE_C
|
||||
pipeControl.setHdcPipelineFlush(args.hdcPipelineFlush);
|
||||
pipeControl.setCompressionControlSurfaceCcsFlush(args.compressionControlSurfaceCcsFlush);
|
||||
pipeControl.setWorkloadPartitionIdOffsetEnable(args.workloadPartitionOffset);
|
||||
pipeControl.setAmfsFlushEnable(args.amfsFlushEnable);
|
||||
|
||||
if (DebugManager.flags.FlushAllCaches.get()) {
|
||||
pipeControl.setHdcPipelineFlush(true);
|
||||
|
||||
Reference in New Issue
Block a user