mirror of
https://github.com/intel/compute-runtime.git
synced 2025-11-15 10:14:56 +08:00
Unify programming of pipe control command
Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
7eafb1e877
commit
52a3bfcfde
@@ -13,8 +13,10 @@
|
||||
|
||||
namespace NEO {
|
||||
|
||||
using Family = TGLLPFamily;
|
||||
|
||||
template <>
|
||||
uint32_t PreambleHelper<TGLLPFamily>::getL3Config(const HardwareInfo &hwInfo, bool useSLM) {
|
||||
uint32_t PreambleHelper<Family>::getL3Config(const HardwareInfo &hwInfo, bool useSLM) {
|
||||
uint32_t l3Config = 0;
|
||||
|
||||
switch (hwInfo.platform.eProductFamily) {
|
||||
@@ -28,20 +30,20 @@ uint32_t PreambleHelper<TGLLPFamily>::getL3Config(const HardwareInfo &hwInfo, bo
|
||||
}
|
||||
|
||||
template <>
|
||||
void PreambleHelper<TGLLPFamily>::programPipelineSelect(LinearStream *pCommandStream,
|
||||
const PipelineSelectArgs &pipelineSelectArgs,
|
||||
const HardwareInfo &hwInfo) {
|
||||
void PreambleHelper<Family>::programPipelineSelect(LinearStream *pCommandStream,
|
||||
const PipelineSelectArgs &pipelineSelectArgs,
|
||||
const HardwareInfo &hwInfo) {
|
||||
|
||||
using PIPELINE_SELECT = typename TGLLPFamily::PIPELINE_SELECT;
|
||||
using PIPELINE_SELECT = typename Family::PIPELINE_SELECT;
|
||||
|
||||
if (MemorySynchronizationCommands<TGLLPFamily>::isPipeControlPriorToPipelineSelectWArequired(hwInfo)) {
|
||||
if (MemorySynchronizationCommands<Family>::isPipeControlPriorToPipelineSelectWArequired(hwInfo)) {
|
||||
PipeControlArgs args;
|
||||
args.renderTargetCacheFlushEnable = true;
|
||||
MemorySynchronizationCommands<TGLLPFamily>::addPipeControl(*pCommandStream, args);
|
||||
MemorySynchronizationCommands<Family>::addPipeControl(*pCommandStream, args);
|
||||
}
|
||||
|
||||
auto pCmd = pCommandStream->getSpaceForCmd<PIPELINE_SELECT>();
|
||||
PIPELINE_SELECT cmd = TGLLPFamily::cmdInitPipelineSelect;
|
||||
PIPELINE_SELECT cmd = Family::cmdInitPipelineSelect;
|
||||
|
||||
auto mask = pipelineSelectEnablePipelineSelectMaskBits | pipelineSelectMediaSamplerDopClockGateMaskBits;
|
||||
auto pipeline = pipelineSelectArgs.is3DPipelineRequired ? PIPELINE_SELECT::PIPELINE_SELECTION_3D : PIPELINE_SELECT::PIPELINE_SELECTION_GPGPU;
|
||||
@@ -56,33 +58,32 @@ void PreambleHelper<TGLLPFamily>::programPipelineSelect(LinearStream *pCommandSt
|
||||
}
|
||||
|
||||
template <>
|
||||
void PreambleHelper<TGLLPFamily>::addPipeControlBeforeVfeCmd(LinearStream *pCommandStream, const HardwareInfo *hwInfo, EngineGroupType engineGroupType) {
|
||||
auto pipeControl = pCommandStream->getSpaceForCmd<PIPE_CONTROL>();
|
||||
PIPE_CONTROL cmd = TGLLPFamily::cmdInitPipeControl;
|
||||
cmd.setCommandStreamerStallEnable(true);
|
||||
void PreambleHelper<Family>::addPipeControlBeforeVfeCmd(LinearStream *pCommandStream, const HardwareInfo *hwInfo, EngineGroupType engineGroupType) {
|
||||
PipeControlArgs args = {};
|
||||
if (hwInfo->workaroundTable.flags.waSendMIFLUSHBeforeVFE) {
|
||||
if (engineGroupType != EngineGroupType::Compute) {
|
||||
cmd.setRenderTargetCacheFlushEnable(true);
|
||||
cmd.setDepthCacheFlushEnable(true);
|
||||
cmd.setDepthStallEnable(true);
|
||||
args.renderTargetCacheFlushEnable = true;
|
||||
args.depthCacheFlushEnable = true;
|
||||
args.depthStallEnable = true;
|
||||
}
|
||||
cmd.setDcFlushEnable(true);
|
||||
args.dcFlushEnable = true;
|
||||
}
|
||||
*pipeControl = cmd;
|
||||
|
||||
MemorySynchronizationCommands<Family>::addPipeControl(*pCommandStream, args);
|
||||
}
|
||||
|
||||
template <>
|
||||
void PreambleHelper<TGLLPFamily>::programL3(LinearStream *pCommandStream, uint32_t l3Config) {
|
||||
void PreambleHelper<Family>::programL3(LinearStream *pCommandStream, uint32_t l3Config) {
|
||||
}
|
||||
|
||||
template <>
|
||||
uint32_t PreambleHelper<TGLLPFamily>::getUrbEntryAllocationSize() {
|
||||
uint32_t PreambleHelper<Family>::getUrbEntryAllocationSize() {
|
||||
return 1024u;
|
||||
}
|
||||
|
||||
template <>
|
||||
void PreambleHelper<TGLLPFamily>::programAdditionalFieldsInVfeState(VFE_STATE_TYPE *mediaVfeState, const HardwareInfo &hwInfo, bool disableEUFusion) {
|
||||
auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
||||
void PreambleHelper<Family>::programAdditionalFieldsInVfeState(VFE_STATE_TYPE *mediaVfeState, const HardwareInfo &hwInfo, bool disableEUFusion) {
|
||||
auto &hwHelper = HwHelperHw<Family>::get();
|
||||
if (!hwHelper.isFusedEuDispatchEnabled(hwInfo, disableEUFusion)) {
|
||||
mediaVfeState->setDisableSlice0Subslice2(true);
|
||||
}
|
||||
@@ -92,5 +93,5 @@ void PreambleHelper<TGLLPFamily>::programAdditionalFieldsInVfeState(VFE_STATE_TY
|
||||
}
|
||||
|
||||
// Explicitly instantiate PreambleHelper for TGLLP device family
|
||||
template struct PreambleHelper<TGLLPFamily>;
|
||||
template struct PreambleHelper<Family>;
|
||||
} // namespace NEO
|
||||
|
||||
Reference in New Issue
Block a user