Move PIPE_CONTROL related functions to PipeControlHelper

Change-Id: Ie8220b06d2aa35a9fd0083b7db6925b577564d36
Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
This commit is contained in:
Maciej Dziuban
2019-03-28 14:15:51 +01:00
committed by sys_ocldev
parent 404428b103
commit 377aebce06
17 changed files with 75 additions and 76 deletions

View File

@@ -80,8 +80,6 @@ class CommandStreamReceiver {
void makeResidentHostPtrAllocation(GraphicsAllocation *gfxAllocation);
virtual void waitBeforeMakingNonResidentWhenRequired() {}
virtual void addPipeControl(LinearStream &commandStream, bool dcFlush) = 0;
void ensureCommandBufferAllocation(LinearStream &commandStream, size_t minimumRequiredSize, size_t additionalAllocationSize);
MemoryManager *getMemoryManager() const;

View File

@@ -38,10 +38,6 @@ class CommandStreamReceiverHw : public CommandStreamReceiver {
void flushBatchedSubmissions() override;
PIPE_CONTROL *addPipeControlBase(LinearStream &commandStream, bool dcFlush);
void addPipeControl(LinearStream &commandStream, bool dcFlush) override;
int getRequiredPipeControlSize() const;
static void addBatchBufferEnd(LinearStream &commandStream, void **patchLocation);
void addBatchBufferStart(MI_BATCH_BUFFER_START *commandBufferMemory, uint64_t startAddress, bool secondary);
static void alignToCacheLine(LinearStream &commandStream);
@@ -86,7 +82,6 @@ class CommandStreamReceiverHw : public CommandStreamReceiver {
void programVFEState(LinearStream &csr, DispatchFlags &dispatchFlags);
virtual void initPageTableManagerRegisters(LinearStream &csr){};
void addPipeControlWA(LinearStream &commandStream);
void addClearSLMWorkAround(typename GfxFamily::PIPE_CONTROL *pCmd);
PIPE_CONTROL *addPipeControlCmd(LinearStream &commandStream);
size_t getSshHeapSize();

View File

@@ -189,7 +189,7 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
}
//Some architectures (SKL) requires to have pipe control prior to pipe control with tag write, add it here
addPipeControlWA(commandStreamTask);
PipeControlHelper<GfxFamily>::addPipeControlWA(commandStreamTask);
auto address = getTagAllocation()->getGpuAddress();
auto pCmd = PipeControlHelper<GfxFamily>::obtainPipeControlAndProgramPostSyncOperation(&commandStreamTask, PIPE_CONTROL::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA, address, taskCount + 1, dispatchFlags.dcFlush);
@@ -362,7 +362,7 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
// Add a PC if we have a dependency on a previous walker to avoid concurrency issues.
if (taskLevel > this->taskLevel) {
if (!timestampPacketWriteEnabled) {
addPipeControl(commandStreamCSR, false);
PipeControlHelper<GfxFamily>::addPipeControl(commandStreamCSR, false);
}
this->taskLevel = taskLevel;
DBG_LOG(LogTaskCounts, __FUNCTION__, "Line: ", __LINE__, "this->taskCount", this->taskCount);
@@ -507,7 +507,7 @@ inline void CommandStreamReceiverHw<GfxFamily>::flushBatchedSubmissions() {
ResidencyContainer surfacesForSubmit;
ResourcePackage resourcePackage;
auto pipeControlLocationSize = getRequiredPipeControlSize();
auto pipeControlLocationSize = PipeControlHelper<GfxFamily>::getRequiredPipeControlSize();
void *currentPipeControlForNooping = nullptr;
void *epiloguePipeControlLocation = nullptr;
@@ -583,33 +583,6 @@ inline void CommandStreamReceiverHw<GfxFamily>::flushBatchedSubmissions() {
}
}
template <typename GfxFamily>
typename GfxFamily::PIPE_CONTROL *CommandStreamReceiverHw<GfxFamily>::addPipeControlBase(LinearStream &commandStream, bool dcFlush) {
addPipeControlWA(commandStream);
auto pCmd = reinterpret_cast<PIPE_CONTROL *>(commandStream.getSpace(sizeof(PIPE_CONTROL)));
*pCmd = GfxFamily::cmdInitPipeControl;
pCmd->setCommandStreamerStallEnable(true);
pCmd->setDcFlushEnable(dcFlush);
if (DebugManager.flags.FlushAllCaches.get()) {
pCmd->setDcFlushEnable(true);
pCmd->setRenderTargetCacheFlushEnable(true);
pCmd->setInstructionCacheInvalidateEnable(true);
pCmd->setTextureCacheInvalidationEnable(true);
pCmd->setPipeControlFlushEnable(true);
pCmd->setVfCacheInvalidationEnable(true);
pCmd->setConstantCacheInvalidationEnable(true);
pCmd->setStateCacheInvalidationEnable(true);
}
return pCmd;
}
template <typename GfxFamily>
void CommandStreamReceiverHw<GfxFamily>::addPipeControl(LinearStream &commandStream, bool dcFlush) {
CommandStreamReceiverHw<GfxFamily>::addPipeControlBase(commandStream, dcFlush);
}
template <typename GfxFamily>
size_t CommandStreamReceiverHw<GfxFamily>::getRequiredCmdStreamSizeAligned(const DispatchFlags &dispatchFlags, Device &device) {
size_t size = getRequiredCmdStreamSize(dispatchFlags, device);
@@ -628,7 +601,7 @@ size_t CommandStreamReceiverHw<GfxFamily>::getRequiredCmdStreamSize(const Dispat
if (!this->isStateSipSent || device.isSourceLevelDebuggerActive()) {
size += PreemptionHelper::getRequiredStateSipCmdSize<GfxFamily>(device);
}
size += getRequiredPipeControlSize();
size += PipeControlHelper<GfxFamily>::getRequiredPipeControlSize();
size += sizeof(typename GfxFamily::MI_BATCH_BUFFER_START);
size += getCmdSizeForL3Config();
@@ -802,13 +775,4 @@ bool CommandStreamReceiverHw<GfxFamily>::detectInitProgrammingFlagsRequired(cons
return DebugManager.flags.ForceCsrReprogramming.get();
}
template <typename GfxFamily>
void CommandStreamReceiverHw<GfxFamily>::addPipeControlWA(LinearStream &commandStream) {
}
template <typename GfxFamily>
int CommandStreamReceiverHw<GfxFamily>::getRequiredPipeControlSize() const {
const auto pipeControlCount = KernelCommandsHelper<GfxFamily>::isPipeControlWArequired() ? 2u : 1u;
return pipeControlCount * sizeof(typename GfxFamily::PIPE_CONTROL);
}
} // namespace NEO