Insert PC before SBA in cmdlist

Related-To: NEO-4916

Change-Id: I7024ff173ad97d4c42a5fa6d7ea0d0ee665a87d9
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2020-07-31 08:40:52 +02:00
committed by sys_ocldev
parent 8b267fd949
commit 0ed1db0b46
10 changed files with 96 additions and 41 deletions

View File

@@ -1494,6 +1494,11 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::setGlobalWorkSizeIndirect(NEO:
template <GFXCORE_FAMILY gfxCoreFamily>
void CommandListCoreFamily<gfxCoreFamily>::programStateBaseAddress(NEO::CommandContainer &container) {
NEO::PipeControlArgs args(true);
args.hdcPipelineFlush = true;
args.textureCacheInvalidationEnable = true;
NEO::MemorySynchronizationCommands<GfxFamily>::addPipeControl(*commandContainer.getCommandStream(), args);
NEO::EncodeStateBaseAddress<GfxFamily>::encode(commandContainer);
if (device->getL0Debugger()) {
device->getL0Debugger()->captureStateBaseAddress(commandContainer);

View File

@@ -8,7 +8,6 @@
#pragma once
#include "shared/source/command_container/command_encoder.h"
#include "shared/source/command_container/command_encoder_base.inl"
#include "shared/source/command_stream/csr_definitions.h"
#include "shared/source/command_stream/linear_stream.h"
#include "shared/source/device/device.h"

View File

@@ -191,8 +191,9 @@ TEST_F(CommandListCreate, givenInvalidProductFamilyThenReturnsNullPointer) {
EXPECT_EQ(nullptr, commandList);
}
HWTEST_F(CommandListCreate, whenCommandListIsCreatedThenStateBaseAddressCmdIsAddedAndCorrectlyProgrammed) {
HWTEST_F(CommandListCreate, whenCommandListIsCreatedThenPCAndStateBaseAddressCmdsAreAddedAndCorrectlyProgrammed) {
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, false));
auto &commandContainer = commandList->commandContainer;
@@ -210,8 +211,17 @@ HWTEST_F(CommandListCreate, whenCommandListIsCreatedThenStateBaseAddressCmdIsAdd
GenCmdList cmdList;
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
cmdList, ptrOffset(commandContainer.getCommandStream()->getCpuBase(), 0), usedSpaceAfter));
auto itor = find<STATE_BASE_ADDRESS *>(cmdList.begin(), cmdList.end());
auto itorPc = find<PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
ASSERT_NE(cmdList.end(), itorPc);
auto cmdPc = genCmdCast<PIPE_CONTROL *>(*itorPc);
EXPECT_TRUE(cmdPc->getDcFlushEnable());
EXPECT_TRUE(cmdPc->getCommandStreamerStallEnable());
EXPECT_TRUE(cmdPc->getTextureCacheInvalidationEnable());
auto itor = find<STATE_BASE_ADDRESS *>(itorPc, cmdList.end());
ASSERT_NE(cmdList.end(), itor);
auto cmdSba = genCmdCast<STATE_BASE_ADDRESS *>(*itor);
auto dsh = commandContainer.getIndirectHeap(NEO::HeapType::DYNAMIC_STATE);

View File

@@ -31,8 +31,8 @@ HWTEST_F(CommandListAppendBarrier, WhenAppendingBarrierThenPipeControlIsGenerate
GenCmdList cmdList;
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(cmdList,
ptrOffset(commandList->commandContainer.getCommandStream()->getCpuBase(), 0),
usedSpaceAfter));
ptrOffset(commandList->commandContainer.getCommandStream()->getCpuBase(), usedSpaceBefore),
usedSpaceAfter - usedSpaceBefore));
// Find a PC w/ CS stall
auto itorPC = find<PIPE_CONTROL *>(cmdList.begin(), cmdList.end());