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

@@ -189,6 +189,10 @@ struct PipeControlHelper {
uint64_t gpuAddress,
uint64_t immediateData,
bool dcFlush);
static void addPipeControlWA(LinearStream &commandStream);
static PIPE_CONTROL *addPipeControlBase(LinearStream &commandStream, bool dcFlush);
static void addPipeControl(LinearStream &commandStream, bool dcFlush);
static int getRequiredPipeControlSize();
};
union SURFACE_STATE_BUFFER_LENGTH {

View File

@@ -12,6 +12,7 @@
#include "runtime/helpers/aligned_memory.h"
#include "runtime/helpers/hw_helper.h"
#include "runtime/helpers/hw_info.h"
#include "runtime/helpers/kernel_commands.h"
#include "runtime/memory_manager/graphics_allocation.h"
#include "runtime/memory_manager/memory_constants.h"
#include "runtime/os_interface/os_interface.h"
@@ -209,4 +210,41 @@ typename Family::PIPE_CONTROL *PipeControlHelper<Family>::obtainPipeControlAndPr
return pipeControl;
}
template <typename GfxFamily>
typename GfxFamily::PIPE_CONTROL *PipeControlHelper<GfxFamily>::addPipeControlBase(LinearStream &commandStream, bool dcFlush) {
PipeControlHelper<GfxFamily>::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 PipeControlHelper<GfxFamily>::addPipeControlWA(LinearStream &commandStream) {
}
template <typename GfxFamily>
void PipeControlHelper<GfxFamily>::addPipeControl(LinearStream &commandStream, bool dcFlush) {
PipeControlHelper<GfxFamily>::addPipeControlBase(commandStream, dcFlush);
}
template <typename GfxFamily>
int PipeControlHelper<GfxFamily>::getRequiredPipeControlSize() {
const auto pipeControlCount = KernelCommandsHelper<GfxFamily>::isPipeControlWArequired() ? 2u : 1u;
return pipeControlCount * sizeof(typename GfxFamily::PIPE_CONTROL);
}
} // namespace NEO