mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 01:04:57 +08:00
refactor: remove not needed code
Related-To: NEO-7527 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
60c30a05e7
commit
09044dfbaa
@@ -172,7 +172,6 @@ struct CommandQueueHw : public CommandQueueImp {
|
||||
inline void collectPrintfContentsFromCommandsList(CommandList *commandList);
|
||||
inline void migrateSharedAllocationsIfRequested(bool isMigrationRequested, CommandList *commandList);
|
||||
inline void prefetchMemoryToDeviceAssociatedWithCmdList(CommandList *commandList);
|
||||
inline void programStateSipEndWA(bool isStateSipRequired, NEO::LinearStream &commandStream);
|
||||
inline void assignCsrTaskCountToFenceIfAvailable(ze_fence_handle_t hFence);
|
||||
inline void dispatchTaskCountPostSyncRegular(bool isDispatchTaskCountPostSyncRequired, NEO::LinearStream &commandStream);
|
||||
inline void dispatchTaskCountPostSyncByMiFlushDw(bool isDispatchTaskCountPostSyncRequired, NEO::LinearStream &commandStream);
|
||||
|
||||
@@ -221,7 +221,6 @@ ze_result_t CommandQueueHw<gfxCoreFamily>::executeCommandListsRegular(
|
||||
this->migrateSharedAllocationsIfRequested(ctx.isMigrationRequested, ctx.firstCommandList);
|
||||
|
||||
this->programLastCommandListReturnBbStart(child, ctx);
|
||||
this->programStateSipEndWA(ctx.stateSipRequired, child);
|
||||
this->assignCsrTaskCountToFenceIfAvailable(hFence);
|
||||
this->dispatchTaskCountPostSyncRegular(ctx.isDispatchTaskCountPostSyncRequired, child);
|
||||
|
||||
@@ -866,15 +865,6 @@ void CommandQueueHw<gfxCoreFamily>::programStateSip(bool isStateSipRequired, NEO
|
||||
this->csr->setSipSentFlag(true);
|
||||
}
|
||||
|
||||
template <GFXCORE_FAMILY gfxCoreFamily>
|
||||
void CommandQueueHw<gfxCoreFamily>::programStateSipEndWA(bool isStateSipRequired, NEO::LinearStream &cmdStream) {
|
||||
if (!isStateSipRequired) {
|
||||
return;
|
||||
}
|
||||
NEO::Device *neoDevice = this->device->getNEODevice();
|
||||
NEO::PreemptionHelper::programStateSipEndWa<GfxFamily>(cmdStream, neoDevice->getRootDeviceEnvironment());
|
||||
}
|
||||
|
||||
template <GFXCORE_FAMILY gfxCoreFamily>
|
||||
void CommandQueueHw<gfxCoreFamily>::updateOneCmdListPreemptionModeAndCtxStatePreemption(
|
||||
NEO::LinearStream &cmdStream,
|
||||
|
||||
@@ -128,17 +128,14 @@ HWTEST_F(L0DebuggerPerContextAddressSpaceTest, givenDebuggingEnabledWhenCommandL
|
||||
EXPECT_EQ(0u, debugModeRegisterCount);
|
||||
EXPECT_EQ(0u, tdDebugControlRegisterCount);
|
||||
|
||||
auto &gfxCoreHelper = device->getGfxCoreHelper();
|
||||
if (!gfxCoreHelper.isSipWANeeded(hwInfo)) {
|
||||
auto stateSipCmds = findAll<STATE_SIP *>(cmdList.begin(), cmdList.end());
|
||||
ASSERT_EQ(1u, stateSipCmds.size());
|
||||
auto stateSipCmds = findAll<STATE_SIP *>(cmdList.begin(), cmdList.end());
|
||||
ASSERT_EQ(1u, stateSipCmds.size());
|
||||
|
||||
STATE_SIP *stateSip = genCmdCast<STATE_SIP *>(*stateSipCmds[0]);
|
||||
STATE_SIP *stateSip = genCmdCast<STATE_SIP *>(*stateSipCmds[0]);
|
||||
|
||||
auto systemRoutine = SipKernel::getSipKernel(*neoDevice, nullptr).getSipAllocation();
|
||||
ASSERT_NE(nullptr, systemRoutine);
|
||||
EXPECT_EQ(systemRoutine->getGpuAddressToPatch(), stateSip->getSystemInstructionPointer());
|
||||
}
|
||||
auto systemRoutine = SipKernel::getSipKernel(*neoDevice, nullptr).getSipAllocation();
|
||||
ASSERT_NE(nullptr, systemRoutine);
|
||||
EXPECT_EQ(systemRoutine->getGpuAddressToPatch(), stateSip->getSystemInstructionPointer());
|
||||
|
||||
for (auto i = 0u; i < numCommandLists; i++) {
|
||||
auto commandList = CommandList::fromHandle(commandLists[i]);
|
||||
|
||||
@@ -196,25 +196,8 @@ HWTEST2_P(L0DebuggerWithBlitterTest, givenImmediateCommandListWhenExecutingWithF
|
||||
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
|
||||
cmdList, commandList->csr->getCS().getCpuBase(), commandList->csr->getCS().getUsed()));
|
||||
|
||||
auto &gfxCoreHelper = device->getGfxCoreHelper();
|
||||
if (gfxCoreHelper.isSipWANeeded(hwInfo)) {
|
||||
|
||||
auto miLoadImm = findAll<MI_LOAD_REGISTER_IMM *>(cmdList.begin(), cmdList.end());
|
||||
|
||||
auto globalSipFound = 0u;
|
||||
for (size_t i = 0; i < miLoadImm.size(); i++) {
|
||||
MI_LOAD_REGISTER_IMM *miLoad = genCmdCast<MI_LOAD_REGISTER_IMM *>(*miLoadImm[i]);
|
||||
ASSERT_NE(nullptr, miLoad);
|
||||
|
||||
if (miLoad->getRegisterOffset() == NEO::GlobalSipRegister<FamilyType>::registerOffset) {
|
||||
globalSipFound++;
|
||||
}
|
||||
}
|
||||
EXPECT_NE(0u, globalSipFound);
|
||||
} else {
|
||||
auto sipItor = find<STATE_SIP *>(cmdList.begin(), cmdList.end());
|
||||
ASSERT_NE(cmdList.end(), sipItor);
|
||||
}
|
||||
auto sipItor = find<STATE_SIP *>(cmdList.begin(), cmdList.end());
|
||||
ASSERT_NE(cmdList.end(), sipItor);
|
||||
commandList->destroy();
|
||||
}
|
||||
|
||||
@@ -258,25 +241,8 @@ HWTEST2_P(L0DebuggerWithBlitterTest, givenImmediateFlushTaskWhenExecutingKernelT
|
||||
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
|
||||
cmdList, commandList->csr->getCS().getCpuBase(), commandList->csr->getCS().getUsed()));
|
||||
|
||||
auto &gfxCoreHelper = device->getGfxCoreHelper();
|
||||
if (gfxCoreHelper.isSipWANeeded(hwInfo)) {
|
||||
|
||||
auto miLoadImm = findAll<MI_LOAD_REGISTER_IMM *>(cmdList.begin(), cmdList.end());
|
||||
|
||||
auto globalSipFound = 0u;
|
||||
for (size_t i = 0; i < miLoadImm.size(); i++) {
|
||||
MI_LOAD_REGISTER_IMM *miLoad = genCmdCast<MI_LOAD_REGISTER_IMM *>(*miLoadImm[i]);
|
||||
ASSERT_NE(nullptr, miLoad);
|
||||
|
||||
if (miLoad->getRegisterOffset() == NEO::GlobalSipRegister<FamilyType>::registerOffset) {
|
||||
globalSipFound++;
|
||||
}
|
||||
}
|
||||
EXPECT_NE(0u, globalSipFound);
|
||||
} else {
|
||||
auto sipItor = find<STATE_SIP *>(cmdList.begin(), cmdList.end());
|
||||
ASSERT_NE(cmdList.end(), sipItor);
|
||||
}
|
||||
auto sipItor = find<STATE_SIP *>(cmdList.begin(), cmdList.end());
|
||||
ASSERT_NE(cmdList.end(), sipItor);
|
||||
commandList->destroy();
|
||||
}
|
||||
|
||||
@@ -607,13 +573,10 @@ HWTEST_P(L0DebuggerWithBlitterTest, givenDebuggingEnabledWhenCommandListIsExecut
|
||||
EXPECT_EQ(0u, tdDebugControlRegisterCount);
|
||||
EXPECT_EQ(0u, globalSipFound);
|
||||
|
||||
auto &gfxCoreHelper = device->getGfxCoreHelper();
|
||||
if (!gfxCoreHelper.isSipWANeeded(hwInfo)) {
|
||||
auto stateSipCmds = findAll<STATE_SIP *>(cmdList.begin(), cmdList.end());
|
||||
auto stateSipCmds = findAll<STATE_SIP *>(cmdList.begin(), cmdList.end());
|
||||
|
||||
if (device->getDevicePreemptionMode() != PreemptionMode::MidThread) {
|
||||
ASSERT_EQ(0u, stateSipCmds.size());
|
||||
}
|
||||
if (device->getDevicePreemptionMode() != PreemptionMode::MidThread) {
|
||||
ASSERT_EQ(0u, stateSipCmds.size());
|
||||
}
|
||||
|
||||
for (auto i = 0u; i < numCommandLists; i++) {
|
||||
|
||||
@@ -710,11 +710,6 @@ XE_HPC_CORETEST_F(LriHelperTestsXeHpcCore, whenProgrammingLriCommandThenExpectMm
|
||||
EXPECT_TRUE(memcmp(lri, &expectedLri, sizeof(MI_LOAD_REGISTER_IMM)) == 0);
|
||||
}
|
||||
|
||||
XE_HPC_CORETEST_F(GfxCoreHelperTestsXeHpcCore, WhenCheckingSipWAThenFalseIsReturned) {
|
||||
auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
|
||||
EXPECT_FALSE(gfxCoreHelper.isSipWANeeded(*defaultHwInfo));
|
||||
}
|
||||
|
||||
XE_HPC_CORETEST_F(GfxCoreHelperTestsXeHpcCore, givenBdA0WhenBcsSubDeviceSupportIsCheckedThenReturnFalse) {
|
||||
DebugManagerStateRestore restore;
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ class CommandStreamReceiverHw : public CommandStreamReceiver {
|
||||
size_t getCmdsSizeForHardwareContext() const override;
|
||||
|
||||
static void addBatchBufferEnd(LinearStream &commandStream, void **patchLocation);
|
||||
void programEndingCmd(LinearStream &commandStream, void **patchLocation, bool directSubmissionEnabled, bool hasRelaxedOrderingDependencies, bool sipWaAllowed);
|
||||
void programEndingCmd(LinearStream &commandStream, void **patchLocation, bool directSubmissionEnabled, bool hasRelaxedOrderingDependencies);
|
||||
void addBatchBufferStart(MI_BATCH_BUFFER_START *commandBufferMemory, uint64_t startAddress, bool secondary);
|
||||
|
||||
size_t getRequiredStateBaseAddressSize(const Device &device) const;
|
||||
|
||||
@@ -106,7 +106,7 @@ inline void CommandStreamReceiverHw<GfxFamily>::addBatchBufferEnd(LinearStream &
|
||||
|
||||
template <typename GfxFamily>
|
||||
inline void CommandStreamReceiverHw<GfxFamily>::programEndingCmd(LinearStream &commandStream, void **patchLocation, bool directSubmissionEnabled,
|
||||
bool hasRelaxedOrderingDependencies, bool sipWaAllowed) {
|
||||
bool hasRelaxedOrderingDependencies) {
|
||||
if (directSubmissionEnabled) {
|
||||
uint64_t startAddress = commandStream.getGraphicsAllocation()->getGpuAddress() + commandStream.getUsed();
|
||||
if (DebugManager.flags.BatchBufferStartPrepatchingWaEnabled.get() == 0) {
|
||||
@@ -133,10 +133,6 @@ inline void CommandStreamReceiverHw<GfxFamily>::programEndingCmd(LinearStream &c
|
||||
NEO::EncodeBatchBufferStartOrEnd<GfxFamily>::programBatchBufferStart(&commandStream, startAddress, false, indirect, false);
|
||||
|
||||
} else {
|
||||
if (sipWaAllowed) {
|
||||
auto &rootDeviceEnvironment = peekRootDeviceEnvironment();
|
||||
PreemptionHelper::programStateSipEndWa<GfxFamily>(commandStream, rootDeviceEnvironment);
|
||||
}
|
||||
this->addBatchBufferEnd(commandStream, patchLocation);
|
||||
}
|
||||
}
|
||||
@@ -220,7 +216,7 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushBcsTask(LinearStream &c
|
||||
bool submitCSR = (commandStreamStartCSR != commandStreamCSR.getUsed());
|
||||
void *bbEndLocation = nullptr;
|
||||
|
||||
programEndingCmd(commandStreamTask, &bbEndLocation, isBlitterDirectSubmissionEnabled(), dispatchBcsFlags.hasRelaxedOrderingDependencies, false);
|
||||
programEndingCmd(commandStreamTask, &bbEndLocation, isBlitterDirectSubmissionEnabled(), dispatchBcsFlags.hasRelaxedOrderingDependencies);
|
||||
EncodeNoop<GfxFamily>::alignToCacheLine(commandStreamTask);
|
||||
|
||||
if (submitCSR) {
|
||||
@@ -605,7 +601,7 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
|
||||
GraphicsAllocation *chainedBatchBuffer = nullptr;
|
||||
bool directSubmissionEnabled = isDirectSubmissionEnabled();
|
||||
if (submitTask) {
|
||||
programEndingCmd(commandStreamTask, &bbEndLocation, directSubmissionEnabled, dispatchFlags.hasRelaxedOrderingDependencies, true);
|
||||
programEndingCmd(commandStreamTask, &bbEndLocation, directSubmissionEnabled, dispatchFlags.hasRelaxedOrderingDependencies);
|
||||
EncodeNoop<GfxFamily>::emitNoop(commandStreamTask, bbEndPaddingSize);
|
||||
EncodeNoop<GfxFamily>::alignToCacheLine(commandStreamTask);
|
||||
|
||||
@@ -636,7 +632,7 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
|
||||
this->programEpilogue(commandStreamCSR, device, &bbEndLocation, dispatchFlags);
|
||||
|
||||
} else if (submitCSR) {
|
||||
programEndingCmd(commandStreamCSR, &bbEndLocation, directSubmissionEnabled, dispatchFlags.hasRelaxedOrderingDependencies, true);
|
||||
programEndingCmd(commandStreamCSR, &bbEndLocation, directSubmissionEnabled, dispatchFlags.hasRelaxedOrderingDependencies);
|
||||
EncodeNoop<GfxFamily>::emitNoop(commandStreamCSR, bbEndPaddingSize);
|
||||
EncodeNoop<GfxFamily>::alignToCacheLine(commandStreamCSR);
|
||||
DEBUG_BREAK_IF(commandStreamCSR.getUsed() > commandStreamCSR.getMaxAvailableSpace());
|
||||
@@ -1234,7 +1230,7 @@ TaskCountType CommandStreamReceiverHw<GfxFamily>::flushBcsTask(const BlitPropert
|
||||
}
|
||||
|
||||
void *endingCmdPtr = nullptr;
|
||||
programEndingCmd(commandStream, &endingCmdPtr, blitterDirectSubmission, isRelaxedOrderingDispatch, false);
|
||||
programEndingCmd(commandStream, &endingCmdPtr, blitterDirectSubmission, isRelaxedOrderingDispatch);
|
||||
|
||||
EncodeNoop<GfxFamily>::alignToCacheLine(commandStream);
|
||||
|
||||
@@ -1353,7 +1349,7 @@ SubmissionStatus CommandStreamReceiverHw<GfxFamily>::flushSmallTask(LinearStream
|
||||
using MI_BATCH_BUFFER_END = typename GfxFamily::MI_BATCH_BUFFER_END;
|
||||
|
||||
void *endingCmdPtr = nullptr;
|
||||
programEndingCmd(commandStreamTask, &endingCmdPtr, isAnyDirectSubmissionEnabled(), false, false);
|
||||
programEndingCmd(commandStreamTask, &endingCmdPtr, isAnyDirectSubmissionEnabled(), false);
|
||||
|
||||
auto bytesToPad = EncodeBatchBufferStartOrEnd<GfxFamily>::getBatchBufferStartSize() -
|
||||
EncodeBatchBufferStartOrEnd<GfxFamily>::getBatchBufferEndSize();
|
||||
@@ -1441,7 +1437,7 @@ inline void CommandStreamReceiverHw<GfxFamily>::programEpilogue(LinearStream &cs
|
||||
|
||||
addBatchBufferStart(reinterpret_cast<typename GfxFamily::MI_BATCH_BUFFER_START *>(*batchBufferEndLocation), gpuAddress, false);
|
||||
this->programEpliogueCommands(csr, dispatchFlags);
|
||||
programEndingCmd(csr, batchBufferEndLocation, isDirectSubmissionEnabled(), false, !EngineHelpers::isBcs(osContext->getEngineType()));
|
||||
programEndingCmd(csr, batchBufferEndLocation, isDirectSubmissionEnabled(), false);
|
||||
EncodeNoop<GfxFamily>::alignToCacheLine(csr);
|
||||
}
|
||||
}
|
||||
@@ -2153,7 +2149,7 @@ void CommandStreamReceiverHw<GfxFamily>::dispatchImmediateFlushClientBufferComma
|
||||
|
||||
makeResident(*immediateCommandStream.getGraphicsAllocation());
|
||||
|
||||
programEndingCmd(immediateCommandStream, &flushData.endPtr, isDirectSubmissionEnabled(), dispatchFlags.hasRelaxedOrderingDependencies, true);
|
||||
programEndingCmd(immediateCommandStream, &flushData.endPtr, isDirectSubmissionEnabled(), dispatchFlags.hasRelaxedOrderingDependencies);
|
||||
EncodeNoop<GfxFamily>::alignToCacheLine(immediateCommandStream);
|
||||
}
|
||||
|
||||
|
||||
@@ -135,7 +135,6 @@ inline void CommandStreamReceiverHw<GfxFamily>::programActivePartitionConfig(Lin
|
||||
template <typename GfxFamily>
|
||||
inline void CommandStreamReceiverHw<GfxFamily>::addPipeControlBeforeStateSip(LinearStream &commandStream, Device &device) {
|
||||
auto &hwInfo = peekHwInfo();
|
||||
auto &gfxCoreHelper = getGfxCoreHelper();
|
||||
auto &productHelper = getProductHelper();
|
||||
auto *releaseHelper = getReleaseHelper();
|
||||
bool debuggingEnabled = device.getDebugger() != nullptr;
|
||||
@@ -144,7 +143,7 @@ inline void CommandStreamReceiverHw<GfxFamily>::addPipeControlBeforeStateSip(Lin
|
||||
const auto &[isBasicWARequired, isExtendedWARequired] = productHelper.isPipeControlPriorToNonPipelinedStateCommandsWARequired(hwInfo, isRcs(), releaseHelper);
|
||||
std::ignore = isExtendedWARequired;
|
||||
|
||||
if (isBasicWARequired && debuggingEnabled && !gfxCoreHelper.isSipWANeeded(hwInfo)) {
|
||||
if (isBasicWARequired && debuggingEnabled) {
|
||||
NEO::EncodeWA<GfxFamily>::addPipeControlPriorToNonPipelinedStateCommand(commandStream, args, this->peekRootDeviceEnvironment(), isRcs());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,9 +60,6 @@ class PreemptionHelper {
|
||||
template <typename GfxFamily>
|
||||
static void programStateSip(LinearStream &preambleCmdStream, Device &device, OsContext *context);
|
||||
|
||||
template <typename GfxFamily>
|
||||
static void programStateSipEndWa(LinearStream &cmdStream, const RootDeviceEnvironment &rootDeviceEnvironment);
|
||||
|
||||
template <typename GfxFamily>
|
||||
static size_t getRequiredCmdStreamSize(PreemptionMode newPreemptionMode, PreemptionMode oldPreemptionMode);
|
||||
|
||||
|
||||
@@ -59,9 +59,6 @@ void PreemptionHelper::programStateSipCmd(LinearStream &preambleCmdStream, Graph
|
||||
*sip = cmd;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
void PreemptionHelper::programStateSipEndWa(LinearStream &cmdStream, const RootDeviceEnvironment &rootDeviceEnvironment) {}
|
||||
|
||||
template <typename GfxFamily>
|
||||
void PreemptionHelper::programCmdStream(LinearStream &cmdStream, PreemptionMode newPreemptionMode,
|
||||
PreemptionMode oldPreemptionMode, GraphicsAllocation *preemptionCsr) {
|
||||
|
||||
@@ -14,54 +14,15 @@ void PreemptionHelper::programStateSip<GfxFamily>(LinearStream &preambleCmdStrea
|
||||
using STATE_SIP = typename GfxFamily::STATE_SIP;
|
||||
using MI_LOAD_REGISTER_IMM = typename GfxFamily::MI_LOAD_REGISTER_IMM;
|
||||
|
||||
auto &hwInfo = device.getHardwareInfo();
|
||||
bool debuggingEnabled = device.getDebugger() != nullptr;
|
||||
|
||||
if (debuggingEnabled) {
|
||||
auto &gfxCoreHelper = device.getGfxCoreHelper();
|
||||
|
||||
GraphicsAllocation *sipAllocation = SipKernel::getSipKernel(device, context).getSipAllocation();
|
||||
|
||||
if (gfxCoreHelper.isSipWANeeded(hwInfo)) {
|
||||
auto mmio = reinterpret_cast<MI_LOAD_REGISTER_IMM *>(preambleCmdStream.getSpace(sizeof(MI_LOAD_REGISTER_IMM)));
|
||||
MI_LOAD_REGISTER_IMM cmd = GfxFamily::cmdInitLoadRegisterImm;
|
||||
|
||||
UNRECOVERABLE_IF((sipAllocation->getGpuAddressToPatch() & uint64_t(0xffffffff00000000)) != 0);
|
||||
|
||||
uint32_t globalSip = static_cast<uint32_t>(sipAllocation->getGpuAddressToPatch() & uint32_t(-1));
|
||||
globalSip &= 0xfffffff8;
|
||||
globalSip |= 1;
|
||||
cmd.setDataDword(globalSip);
|
||||
cmd.setRegisterOffset(GlobalSipRegister<GfxFamily>::registerOffset);
|
||||
*mmio = cmd;
|
||||
} else {
|
||||
auto sip = reinterpret_cast<STATE_SIP *>(preambleCmdStream.getSpace(sizeof(STATE_SIP)));
|
||||
STATE_SIP cmd = GfxFamily::cmdInitStateSip;
|
||||
cmd.setSystemInstructionPointer(sipAllocation->getGpuAddressToPatch());
|
||||
*sip = cmd;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
void PreemptionHelper::programStateSipEndWa<GfxFamily>(LinearStream &cmdStream, const RootDeviceEnvironment &rootDeviceEnvironment) {
|
||||
using MI_LOAD_REGISTER_IMM = typename GfxFamily::MI_LOAD_REGISTER_IMM;
|
||||
|
||||
if (rootDeviceEnvironment.debugger) {
|
||||
auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<GfxCoreHelper>();
|
||||
auto &hwInfo = *rootDeviceEnvironment.getHardwareInfo();
|
||||
if (gfxCoreHelper.isSipWANeeded(hwInfo)) {
|
||||
|
||||
NEO::PipeControlArgs args;
|
||||
NEO::MemorySynchronizationCommands<GfxFamily>::addSingleBarrier(cmdStream, args);
|
||||
|
||||
auto mmio = reinterpret_cast<MI_LOAD_REGISTER_IMM *>(cmdStream.getSpace(sizeof(MI_LOAD_REGISTER_IMM)));
|
||||
MI_LOAD_REGISTER_IMM cmd = GfxFamily::cmdInitLoadRegisterImm;
|
||||
uint32_t globalSip = 0;
|
||||
cmd.setDataDword(globalSip);
|
||||
cmd.setRegisterOffset(GlobalSipRegister<GfxFamily>::registerOffset);
|
||||
*mmio = cmd;
|
||||
}
|
||||
auto sip = reinterpret_cast<STATE_SIP *>(preambleCmdStream.getSpace(sizeof(STATE_SIP)));
|
||||
STATE_SIP cmd = GfxFamily::cmdInitStateSip;
|
||||
cmd.setSystemInstructionPointer(sipAllocation->getGpuAddressToPatch());
|
||||
*sip = cmd;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,22 +38,16 @@ size_t PreemptionHelper::getRequiredStateSipCmdSize<GfxFamily>(Device &device, b
|
||||
auto &hwInfo = device.getHardwareInfo();
|
||||
|
||||
if (debuggingEnabled) {
|
||||
auto &gfxCoreHelper = device.getGfxCoreHelper();
|
||||
|
||||
if (gfxCoreHelper.isSipWANeeded(hwInfo)) {
|
||||
auto &productHelper = device.getProductHelper();
|
||||
auto *releaseHelper = device.getReleaseHelper();
|
||||
const auto &[isBasicWARequired, isExtendedWARequired] = productHelper.isPipeControlPriorToNonPipelinedStateCommandsWARequired(hwInfo, isRcs, releaseHelper);
|
||||
const auto isWARequired = isBasicWARequired || isExtendedWARequired;
|
||||
|
||||
if (isWARequired) {
|
||||
size += MemorySynchronizationCommands<GfxFamily>::getSizeForSingleBarrier(false);
|
||||
size += 2 * sizeof(typename GfxFamily::MI_LOAD_REGISTER_IMM);
|
||||
} else {
|
||||
auto &productHelper = device.getProductHelper();
|
||||
auto *releaseHelper = device.getReleaseHelper();
|
||||
const auto &[isBasicWARequired, isExtendedWARequired] = productHelper.isPipeControlPriorToNonPipelinedStateCommandsWARequired(hwInfo, isRcs, releaseHelper);
|
||||
const auto isWARequired = isBasicWARequired || isExtendedWARequired;
|
||||
|
||||
if (isWARequired) {
|
||||
size += MemorySynchronizationCommands<GfxFamily>::getSizeForSingleBarrier(false);
|
||||
}
|
||||
size += sizeof(typename GfxFamily::STATE_SIP);
|
||||
}
|
||||
size += sizeof(typename GfxFamily::STATE_SIP);
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,5 @@ template size_t PreemptionHelper::getPreemptionWaCsSize<GfxFamily>(const Device
|
||||
template void PreemptionHelper::applyPreemptionWaCmdsBegin<GfxFamily>(LinearStream *pCommandStream, const Device &device);
|
||||
template void PreemptionHelper::applyPreemptionWaCmdsEnd<GfxFamily>(LinearStream *pCommandStream, const Device &device);
|
||||
template void PreemptionHelper::programInterfaceDescriptorDataPreemption<GfxFamily>(INTERFACE_DESCRIPTOR_DATA<GfxFamily> *idd, PreemptionMode preemptionMode);
|
||||
template void PreemptionHelper::programStateSipEndWa<GfxFamily>(LinearStream &cmdStream, const RootDeviceEnvironment &rootDeviceEnvironment);
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -26,5 +26,4 @@ template size_t PreemptionHelper::getPreemptionWaCsSize<GfxFamily>(const Device
|
||||
template void PreemptionHelper::applyPreemptionWaCmdsBegin<GfxFamily>(LinearStream *pCommandStream, const Device &device);
|
||||
template void PreemptionHelper::applyPreemptionWaCmdsEnd<GfxFamily>(LinearStream *pCommandStream, const Device &device);
|
||||
template void PreemptionHelper::programInterfaceDescriptorDataPreemption<GfxFamily>(INTERFACE_DESCRIPTOR_DATA<GfxFamily> *idd, PreemptionMode preemptionMode);
|
||||
template void PreemptionHelper::programStateSipEndWa<GfxFamily>(LinearStream &cmdStream, const RootDeviceEnvironment &rootDeviceEnvironment);
|
||||
} // namespace NEO
|
||||
|
||||
@@ -119,5 +119,4 @@ void PreemptionHelper::programInterfaceDescriptorDataPreemption<GfxFamily>(INTER
|
||||
}
|
||||
|
||||
template size_t PreemptionHelper::getRequiredCmdStreamSize<GfxFamily>(PreemptionMode newPreemptionMode, PreemptionMode oldPreemptionMode);
|
||||
template void PreemptionHelper::programStateSipEndWa<GfxFamily>(LinearStream &cmdStream, const RootDeviceEnvironment &rootDeviceEnvironment);
|
||||
} // namespace NEO
|
||||
|
||||
@@ -77,6 +77,5 @@ template void PreemptionHelper::programStateSip<GfxFamily>(LinearStream &preambl
|
||||
template void PreemptionHelper::programStateSipCmd<GfxFamily>(LinearStream &preambleCmdStream, GraphicsAllocation *sipAllocation);
|
||||
template size_t PreemptionHelper::getRequiredStateSipCmdSize<GfxFamily>(Device &device, bool isRcs);
|
||||
template size_t PreemptionHelper::getRequiredCmdStreamSize<GfxFamily>(PreemptionMode newPreemptionMode, PreemptionMode oldPreemptionMode);
|
||||
template void PreemptionHelper::programStateSipEndWa<GfxFamily>(LinearStream &cmdStream, const RootDeviceEnvironment &rootDeviceEnvironment);
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -123,7 +123,6 @@ class GfxCoreHelper {
|
||||
virtual uint32_t adjustMaxWorkGroupSize(const uint32_t numGrf, const uint32_t simd, bool isHwLocalGeneration, const uint32_t defaultMaxGroupSize) const = 0;
|
||||
virtual size_t getMaxFillPaternSizeForCopyEngine() const = 0;
|
||||
virtual size_t getSipKernelMaxDbgSurfaceSize(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual bool isSipWANeeded(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual bool isCpuImageTransferPreferred(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual aub_stream::MMIOList getExtraMmioList(const HardwareInfo &hwInfo, const GmmHelper &gmmHelper) const = 0;
|
||||
virtual uint32_t getNumCacheRegions() const = 0;
|
||||
@@ -328,8 +327,6 @@ class GfxCoreHelperHw : public GfxCoreHelper {
|
||||
|
||||
size_t getSipKernelMaxDbgSurfaceSize(const HardwareInfo &hwInfo) const override;
|
||||
|
||||
bool isSipWANeeded(const HardwareInfo &hwInfo) const override;
|
||||
|
||||
bool isCpuImageTransferPreferred(const HardwareInfo &hwInfo) const override;
|
||||
|
||||
aub_stream::MMIOList getExtraMmioList(const HardwareInfo &hwInfo, const GmmHelper &gmmHelper) const override;
|
||||
|
||||
@@ -564,11 +564,6 @@ bool MemorySynchronizationCommands<GfxFamily>::isBarrierPriorToPipelineSelectWaR
|
||||
return false;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
bool GfxCoreHelperHw<GfxFamily>::isSipWANeeded(const HardwareInfo &hwInfo) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
bool GfxCoreHelperHw<GfxFamily>::isAdditionalFeatureFlagRequired(const FeatureTable *featureTable) const {
|
||||
return false;
|
||||
|
||||
@@ -742,7 +742,7 @@ HWTEST_F(DirectSubmissionTest, givenDirectSubmissionAvailableWhenProgrammingEndi
|
||||
uint8_t buffer[128];
|
||||
mockCsr->commandStream.replaceBuffer(&buffer[0], 128u);
|
||||
mockCsr->commandStream.replaceGraphicsAllocation(&mockAllocation);
|
||||
mockCsr->programEndingCmd(mockCsr->commandStream, &location, ret, false, true);
|
||||
mockCsr->programEndingCmd(mockCsr->commandStream, &location, ret, false);
|
||||
EXPECT_EQ(sizeof(MI_BATCH_BUFFER_START), mockCsr->commandStream.getUsed());
|
||||
|
||||
DispatchFlags dispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags();
|
||||
@@ -786,7 +786,7 @@ HWTEST_F(DirectSubmissionTest, givenDebugFlagSetWhenProgrammingEndingCommandThen
|
||||
auto currectBbStartCmd = reinterpret_cast<MI_BATCH_BUFFER_START *>(cmdStream.getSpace(0));
|
||||
uint64_t expectedGpuVa = cmdStream.getGraphicsAllocation()->getGpuAddress() + cmdStream.getUsed();
|
||||
|
||||
mockCsr->programEndingCmd(cmdStream, &location, ret, false, true);
|
||||
mockCsr->programEndingCmd(cmdStream, &location, ret, false);
|
||||
EncodeNoop<FamilyType>::alignToCacheLine(cmdStream);
|
||||
|
||||
if (value == 0) {
|
||||
|
||||
@@ -2161,7 +2161,7 @@ HWTEST2_F(DirectSubmissionRelaxedOrderingTests, givenBcsRelaxedOrderingEnabledWh
|
||||
|
||||
auto endingPtr = commandStream.getSpace(0);
|
||||
|
||||
ultCsr->programEndingCmd(commandStream, &endingPtr, true, true, false);
|
||||
ultCsr->programEndingCmd(commandStream, &endingPtr, true, true);
|
||||
|
||||
auto lrrCmd = reinterpret_cast<MI_LOAD_REGISTER_REG *>(commandStream.getCpuBase());
|
||||
EXPECT_EQ(lrrCmd->getSourceRegisterAddress(), CS_GPR_R3);
|
||||
@@ -2194,7 +2194,7 @@ HWTEST2_F(DirectSubmissionRelaxedOrderingTests, givenBcsRelaxedOrderingDisabledW
|
||||
|
||||
auto endingPtr = commandStream.getSpace(0);
|
||||
|
||||
ultCsr->programEndingCmd(commandStream, &endingPtr, true, false, false);
|
||||
ultCsr->programEndingCmd(commandStream, &endingPtr, true, false);
|
||||
|
||||
auto bbStartCmd = genCmdCast<MI_BATCH_BUFFER_START *>(commandStream.getCpuBase());
|
||||
ASSERT_NE(nullptr, bbStartCmd);
|
||||
@@ -2217,7 +2217,7 @@ HWTEST2_F(DirectSubmissionRelaxedOrderingTests, whenProgrammingEndingCmdsThenSet
|
||||
|
||||
auto endingPtr = commandStream.getSpace(0);
|
||||
|
||||
ultCsr->programEndingCmd(commandStream, &endingPtr, true, true, false);
|
||||
ultCsr->programEndingCmd(commandStream, &endingPtr, true, true);
|
||||
|
||||
auto lrrCmd = reinterpret_cast<MI_LOAD_REGISTER_REG *>(commandStream.getCpuBase());
|
||||
EXPECT_EQ(lrrCmd->getSourceRegisterAddress(), CS_GPR_R3);
|
||||
@@ -2246,7 +2246,7 @@ HWTEST2_F(DirectSubmissionRelaxedOrderingTests, givenBbWithoutRelaxedOrderingDep
|
||||
|
||||
auto endingPtr = commandStream.getSpace(0);
|
||||
|
||||
ultCsr->programEndingCmd(commandStream, &endingPtr, true, false, false);
|
||||
ultCsr->programEndingCmd(commandStream, &endingPtr, true, false);
|
||||
|
||||
auto bbStartCmd = genCmdCast<MI_BATCH_BUFFER_START *>(commandStream.getCpuBase());
|
||||
ASSERT_NE(nullptr, bbStartCmd);
|
||||
@@ -2730,4 +2730,4 @@ HWTEST2_F(DirectSubmissionRelaxedOrderingTests, givenNumClientsWhenAskingIfRelax
|
||||
ultCsr->registerClient(&client4);
|
||||
EXPECT_EQ(4u, ultCsr->getNumClients());
|
||||
EXPECT_TRUE(NEO::RelaxedOrderingHelper::isRelaxedOrderingDispatchAllowed(*ultCsr, 1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1153,11 +1153,6 @@ HWTEST_F(GfxCoreHelperTest, GivenZeroSlmSizeWhenComputeSlmSizeIsCalledThenCorrec
|
||||
EXPECT_EQ(SHARED_LOCAL_MEMORY_SIZE::SHARED_LOCAL_MEMORY_SIZE_ENCODES_0K, receivedSlmSize);
|
||||
}
|
||||
|
||||
HWTEST2_F(GfxCoreHelperTest, givenGfxCoreHelperWhenCheckingSipWaThenFalseIsReturned, isTglLpOrBelow) {
|
||||
auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
|
||||
|
||||
EXPECT_FALSE(gfxCoreHelper.isSipWANeeded(*defaultHwInfo));
|
||||
}
|
||||
HWCMDTEST_F(IGFX_GEN8_CORE, GfxCoreHelperTest, givenGfxCoreHelperWhenGettingPlanarYuvHeightThenHelperReturnsCorrectValue) {
|
||||
auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
|
||||
EXPECT_EQ(gfxCoreHelper.getPlanarYuvMaxHeight(), 16352u);
|
||||
@@ -1592,4 +1587,4 @@ HWTEST_F(GfxCoreHelperTest, givenFlagRemoveRestrictionsOnNumberOfThreadsInGpgpuT
|
||||
for (auto &[simtSize, totalWgSize, grfsize, isHwLocalIdGeneration, expectedNumThreadsPerThreadGroup] : values) {
|
||||
EXPECT_EQ(expectedNumThreadsPerThreadGroup, gfxCoreHelper.calculateNumThreadsPerThreadGroup(simtSize, totalWgSize, grfsize, isHwLocalIdGeneration));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,12 +153,6 @@ XE_HPG_CORETEST_F(GfxCoreHelperTestXeHpgCore, givenGfxCoreHelperWhenGettingThrea
|
||||
EXPECT_EQ(8U, configs[1]);
|
||||
}
|
||||
|
||||
XE_HPG_CORETEST_F(GfxCoreHelperTestXeHpgCore, WhenCheckingSipWAThenFalseIsReturned) {
|
||||
auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
|
||||
|
||||
EXPECT_FALSE(gfxCoreHelper.isSipWANeeded(pDevice->getHardwareInfo()));
|
||||
}
|
||||
|
||||
XE_HPG_CORETEST_F(ProductHelperTestXeHpgCore, givenProductHelperWhenCheckDummyBlitWaRequiredThenReturnTrue) {
|
||||
auto &productHelper = getHelper<ProductHelper>();
|
||||
EXPECT_TRUE(productHelper.isDummyBlitWaRequired());
|
||||
@@ -344,4 +338,4 @@ XE_HPG_CORETEST_F(GfxCoreHelperTestXeHpgCore, GivenVariousValuesWhenComputeSlmSi
|
||||
for (auto &testInput : computeSlmValuesXeHpgTestsInput) {
|
||||
EXPECT_EQ(testInput.expected, gfxCoreHelper.computeSlmValues(hardwareInfo, testInput.slmSize));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user