2019-09-19 01:32:33 +08:00
|
|
|
/*
|
2020-01-23 18:57:37 +08:00
|
|
|
* Copyright (C) 2019-2020 Intel Corporation
|
2019-09-19 01:32:33 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/command_stream/csr_definitions.h"
|
2020-06-02 23:04:11 +08:00
|
|
|
#include "shared/source/gen12lp/helpers_gen12lp.h"
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/helpers/engine_node_helper.h"
|
|
|
|
#include "shared/source/helpers/preamble_bdw_plus.inl"
|
2020-02-24 17:22:30 +08:00
|
|
|
|
2020-04-27 03:48:59 +08:00
|
|
|
#include "pipe_control_args.h"
|
2019-09-19 01:32:33 +08:00
|
|
|
#include "reg_configs_common.h"
|
|
|
|
|
|
|
|
namespace NEO {
|
|
|
|
|
|
|
|
template <>
|
|
|
|
uint32_t PreambleHelper<TGLLPFamily>::getL3Config(const HardwareInfo &hwInfo, bool useSLM) {
|
|
|
|
uint32_t l3Config = 0;
|
|
|
|
|
|
|
|
switch (hwInfo.platform.eProductFamily) {
|
|
|
|
case IGFX_TIGERLAKE_LP:
|
|
|
|
l3Config = getL3ConfigHelper<IGFX_TIGERLAKE_LP>(useSLM);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
l3Config = getL3ConfigHelper<IGFX_TIGERLAKE_LP>(true);
|
|
|
|
}
|
|
|
|
return l3Config;
|
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
void PreambleHelper<TGLLPFamily>::programPipelineSelect(LinearStream *pCommandStream,
|
|
|
|
const PipelineSelectArgs &pipelineSelectArgs,
|
|
|
|
const HardwareInfo &hwInfo) {
|
|
|
|
|
|
|
|
using PIPELINE_SELECT = typename TGLLPFamily::PIPELINE_SELECT;
|
|
|
|
|
2020-10-06 00:32:55 +08:00
|
|
|
if (MemorySynchronizationCommands<TGLLPFamily>::isPipeControlPriorToPipelineSelectWArequired(hwInfo)) {
|
2020-04-27 03:48:59 +08:00
|
|
|
PipeControlArgs args;
|
|
|
|
args.renderTargetCacheFlushEnable = true;
|
|
|
|
MemorySynchronizationCommands<TGLLPFamily>::addPipeControl(*pCommandStream, args);
|
2019-09-19 01:32:33 +08:00
|
|
|
}
|
|
|
|
|
2020-04-09 00:33:03 +08:00
|
|
|
auto pCmd = pCommandStream->getSpaceForCmd<PIPELINE_SELECT>();
|
|
|
|
PIPELINE_SELECT cmd = TGLLPFamily::cmdInitPipelineSelect;
|
2019-09-19 01:32:33 +08:00
|
|
|
|
|
|
|
auto mask = pipelineSelectEnablePipelineSelectMaskBits | pipelineSelectMediaSamplerDopClockGateMaskBits;
|
2020-03-19 22:15:51 +08:00
|
|
|
auto pipeline = pipelineSelectArgs.is3DPipelineRequired ? PIPELINE_SELECT::PIPELINE_SELECTION_3D : PIPELINE_SELECT::PIPELINE_SELECTION_GPGPU;
|
2019-09-19 01:32:33 +08:00
|
|
|
|
2020-04-09 00:33:03 +08:00
|
|
|
cmd.setMaskBits(mask);
|
|
|
|
cmd.setPipelineSelection(pipeline);
|
|
|
|
cmd.setMediaSamplerDopClockGateEnable(!pipelineSelectArgs.mediaSamplerRequired);
|
2019-09-19 01:32:33 +08:00
|
|
|
|
2020-04-09 00:33:03 +08:00
|
|
|
Gen12LPHelpers::setAdditionalPipelineSelectFields(&cmd, pipelineSelectArgs, hwInfo);
|
|
|
|
|
|
|
|
*pCmd = cmd;
|
2019-09-19 01:32:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
2020-02-06 23:06:00 +08:00
|
|
|
void PreambleHelper<TGLLPFamily>::addPipeControlBeforeVfeCmd(LinearStream *pCommandStream, const HardwareInfo *hwInfo, aub_stream::EngineType engineType) {
|
2019-09-19 01:32:33 +08:00
|
|
|
auto pipeControl = pCommandStream->getSpaceForCmd<PIPE_CONTROL>();
|
2020-04-09 00:33:03 +08:00
|
|
|
PIPE_CONTROL cmd = TGLLPFamily::cmdInitPipeControl;
|
|
|
|
cmd.setCommandStreamerStallEnable(true);
|
2019-09-19 01:32:33 +08:00
|
|
|
if (hwInfo->workaroundTable.waSendMIFLUSHBeforeVFE) {
|
2020-02-06 23:06:00 +08:00
|
|
|
if (!EngineHelpers::isCcs(engineType)) {
|
2020-04-09 00:33:03 +08:00
|
|
|
cmd.setRenderTargetCacheFlushEnable(true);
|
|
|
|
cmd.setDepthCacheFlushEnable(true);
|
2020-05-26 21:09:50 +08:00
|
|
|
cmd.setDepthStallEnable(true);
|
2019-09-19 01:32:33 +08:00
|
|
|
}
|
2020-04-09 00:33:03 +08:00
|
|
|
cmd.setDcFlushEnable(true);
|
2019-09-19 01:32:33 +08:00
|
|
|
}
|
2020-04-09 00:33:03 +08:00
|
|
|
*pipeControl = cmd;
|
2019-09-19 01:32:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
void PreambleHelper<TGLLPFamily>::programL3(LinearStream *pCommandStream, uint32_t l3Config) {
|
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
uint32_t PreambleHelper<TGLLPFamily>::getUrbEntryAllocationSize() {
|
|
|
|
return 1024u;
|
|
|
|
}
|
|
|
|
|
2019-09-30 22:11:18 +08:00
|
|
|
template <>
|
2019-10-07 19:11:12 +08:00
|
|
|
void PreambleHelper<TGLLPFamily>::programAdditionalFieldsInVfeState(VFE_STATE_TYPE *mediaVfeState, const HardwareInfo &hwInfo) {
|
2020-03-13 20:14:28 +08:00
|
|
|
auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
|
|
|
if (!hwHelper.isFusedEuDispatchEnabled(hwInfo)) {
|
|
|
|
mediaVfeState->setDisableSlice0Subslice2(true);
|
2019-09-30 22:11:18 +08:00
|
|
|
}
|
|
|
|
}
|
2019-09-19 01:32:33 +08:00
|
|
|
|
2020-03-13 20:14:28 +08:00
|
|
|
// Explicitly instantiate PreambleHelper for TGLLP device family
|
2019-09-19 01:32:33 +08:00
|
|
|
template struct PreambleHelper<TGLLPFamily>;
|
|
|
|
} // namespace NEO
|