Dont inject commands between blits

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2020-11-09 13:16:24 +01:00
committed by Compute-Runtime-Automation
parent a068a618e4
commit f7905128ca
5 changed files with 32 additions and 53 deletions

View File

@@ -42,30 +42,23 @@ uint64_t BlitCommandsHelper<GfxFamily>::getMaxBlitHeight(const RootDeviceEnviron
template <typename GfxFamily>
void BlitCommandsHelper<GfxFamily>::dispatchPostBlitCommand(LinearStream &linearStream) {
switch (DebugManager.flags.PostBlitCommand.get()) {
case 1:
EncodeMiFlushDW<GfxFamily>::programMiFlushDw(linearStream, 0, 0, false, false);
break;
case 2:
break;
default: {
if (DebugManager.flags.PostBlitCommand.get() == 0) {
auto miArbCheckStream = linearStream.getSpaceForCmd<typename GfxFamily::MI_ARB_CHECK>();
*miArbCheckStream = GfxFamily::cmdInitArbCheck;
break;
}
} else if (DebugManager.flags.PostBlitCommand.get() == 1) {
EncodeMiFlushDW<GfxFamily>::programMiFlushDw(linearStream, 0, 0, false, false);
}
}
template <typename GfxFamily>
size_t BlitCommandsHelper<GfxFamily>::estimatePostBlitCommandSize() {
switch (DebugManager.flags.PostBlitCommand.get()) {
case 1:
return sizeof(typename GfxFamily::MI_FLUSH_DW);
case 2:
return 0;
default:
if (DebugManager.flags.PostBlitCommand.get() == 0) {
return sizeof(typename GfxFamily::MI_ARB_CHECK);
} else if (DebugManager.flags.PostBlitCommand.get() == 1) {
return sizeof(typename GfxFamily::MI_FLUSH_DW);
}
return 0;
}
template <typename GfxFamily>

View File

@@ -96,7 +96,8 @@ HWTEST_F(BlitTests, givenDebugVariableWhenEstimatingPostBlitsCommandSizeThenRetu
DebugManagerStateRestore restore{};
EXPECT_EQ(arbCheckSize, BlitCommandsHelper<FamilyType>::estimatePostBlitCommandSize());
EXPECT_EQ(0u, BlitCommandsHelper<FamilyType>::estimatePostBlitCommandSize());
DebugManager.flags.PostBlitCommand.set(0);
EXPECT_EQ(arbCheckSize, BlitCommandsHelper<FamilyType>::estimatePostBlitCommandSize());
@@ -117,9 +118,7 @@ HWTEST_F(BlitTests, givenDebugVariableWhenDispatchingPostBlitsCommandThenUseCorr
// -1: default
BlitCommandsHelper<FamilyType>::dispatchPostBlitCommand(linearStream);
CmdParse<FamilyType>::parseCommandBuffer(commands, linearStream.getCpuBase(), linearStream.getUsed());
auto arbCheck = find<MI_ARB_CHECK *>(commands.begin(), commands.end());
EXPECT_NE(commands.end(), arbCheck);
EXPECT_EQ(0u, linearStream.getUsed());
// 0: MI_ARB_CHECK
memset(streamBuffer, 0, sizeof(streamBuffer));
@@ -128,7 +127,7 @@ HWTEST_F(BlitTests, givenDebugVariableWhenDispatchingPostBlitsCommandThenUseCorr
DebugManager.flags.PostBlitCommand.set(0);
BlitCommandsHelper<FamilyType>::dispatchPostBlitCommand(linearStream);
CmdParse<FamilyType>::parseCommandBuffer(commands, linearStream.getCpuBase(), linearStream.getUsed());
arbCheck = find<MI_ARB_CHECK *>(commands.begin(), commands.end());
auto arbCheck = find<MI_ARB_CHECK *>(commands.begin(), commands.end());
EXPECT_NE(commands.end(), arbCheck);
// 1: MI_FLUSH_DW