mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-27 15:53:13 +08:00
Do not reprogram SBA if CSR is not multi os context capable
Related-To: NEO-5459 Signed-off-by: Igor Venevtsev <igor.venevtsev@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
d9b1601148
commit
cb4db7767e
@@ -600,6 +600,60 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenNotApplicableGrfConfigWhenFlu
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST_F(CommandStreamReceiverFlushTaskTests, givenMultiOsContextCapableSetAndDispatchFlagsWhenFlushingTaskThenReloadSbaProperly) {
|
||||
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
|
||||
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
|
||||
|
||||
// 1. Ignore dispatchFlags.useGlobalAtomics flip if csr is not multi context capable
|
||||
commandStreamReceiver.multiOsContextCapable = false;
|
||||
|
||||
flushTaskFlags.useGlobalAtomics = false;
|
||||
auto offset = commandStreamReceiver.commandStream.getUsed();
|
||||
flushTask(commandStreamReceiver);
|
||||
|
||||
parseCommands<FamilyType>(commandStreamReceiver.commandStream, 0);
|
||||
auto stateBaseAddressItor = find<STATE_BASE_ADDRESS *>(cmdList.begin(), cmdList.end());
|
||||
EXPECT_NE(cmdList.end(), stateBaseAddressItor);
|
||||
|
||||
flushTaskFlags.useGlobalAtomics ^= true;
|
||||
offset = commandStreamReceiver.commandStream.getUsed();
|
||||
flushTask(commandStreamReceiver);
|
||||
|
||||
cmdList.clear();
|
||||
parseCommands<FamilyType>(commandStreamReceiver.commandStream, offset);
|
||||
stateBaseAddressItor = find<STATE_BASE_ADDRESS *>(cmdList.begin(), cmdList.end());
|
||||
EXPECT_EQ(cmdList.end(), stateBaseAddressItor);
|
||||
|
||||
// 2. Reprogram SBA only if dispatchFlags.useGlobalAtomics flips and csr is multi context capable
|
||||
commandStreamReceiver.multiOsContextCapable = true;
|
||||
|
||||
flushTaskFlags.useGlobalAtomics = true;
|
||||
offset = commandStreamReceiver.commandStream.getUsed();
|
||||
flushTask(commandStreamReceiver);
|
||||
|
||||
cmdList.clear();
|
||||
parseCommands<FamilyType>(commandStreamReceiver.commandStream, offset);
|
||||
stateBaseAddressItor = find<STATE_BASE_ADDRESS *>(cmdList.begin(), cmdList.end());
|
||||
EXPECT_NE(cmdList.end(), stateBaseAddressItor);
|
||||
|
||||
flushTaskFlags.useGlobalAtomics ^= true;
|
||||
offset = commandStreamReceiver.commandStream.getUsed();
|
||||
flushTask(commandStreamReceiver);
|
||||
|
||||
cmdList.clear();
|
||||
parseCommands<FamilyType>(commandStreamReceiver.commandStream, offset);
|
||||
stateBaseAddressItor = find<STATE_BASE_ADDRESS *>(cmdList.begin(), cmdList.end());
|
||||
EXPECT_NE(cmdList.end(), stateBaseAddressItor);
|
||||
|
||||
offset = commandStreamReceiver.commandStream.getUsed();
|
||||
flushTask(commandStreamReceiver);
|
||||
|
||||
cmdList.clear();
|
||||
parseCommands<FamilyType>(commandStreamReceiver.commandStream, offset);
|
||||
stateBaseAddressItor = find<STATE_BASE_ADDRESS *>(cmdList.begin(), cmdList.end());
|
||||
EXPECT_EQ(cmdList.end(), stateBaseAddressItor);
|
||||
}
|
||||
|
||||
HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenPreambleNotSentWhenFlushingTaskThenPreambleIsSent) {
|
||||
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
|
||||
commandStreamReceiver.isPreambleSent = false;
|
||||
|
||||
@@ -375,7 +375,7 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
|
||||
latestSentStatelessMocsConfig = mocsIndex;
|
||||
}
|
||||
|
||||
if (dispatchFlags.useGlobalAtomics != lastSentUseGlobalAtomics) {
|
||||
if (isMultiOsContextCapable() && (dispatchFlags.useGlobalAtomics != lastSentUseGlobalAtomics)) {
|
||||
isStateBaseAddressDirty = true;
|
||||
lastSentUseGlobalAtomics = dispatchFlags.useGlobalAtomics;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user