2019-09-19 01:32:33 +08:00
|
|
|
/*
|
2022-02-11 07:33:40 +08:00
|
|
|
* Copyright (C) 2019-2022 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"
|
2022-07-08 07:55:53 +08:00
|
|
|
#include "shared/source/gen12lp/hw_cmds_base.h"
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/helpers/engine_node_helper.h"
|
2021-12-22 22:11:05 +08:00
|
|
|
#include "shared/source/helpers/pipe_control_args.h"
|
2022-07-24 12:21:16 +08:00
|
|
|
#include "shared/source/helpers/pipeline_select_helper.h"
|
2021-08-03 19:48:35 +08:00
|
|
|
#include "shared/source/helpers/preamble_bdw_and_later.inl"
|
2021-08-31 23:48:56 +08:00
|
|
|
#include "shared/source/os_interface/hw_info_config.h"
|
2020-02-24 17:22:30 +08:00
|
|
|
|
2019-09-19 01:32:33 +08:00
|
|
|
namespace NEO {
|
|
|
|
|
2022-07-25 23:30:11 +08:00
|
|
|
using Family = Gen12LpFamily;
|
2022-05-13 08:29:53 +08:00
|
|
|
|
2019-09-19 01:32:33 +08:00
|
|
|
template <>
|
2022-05-13 08:29:53 +08:00
|
|
|
uint32_t PreambleHelper<Family>::getL3Config(const HardwareInfo &hwInfo, bool useSLM) {
|
2019-09-19 01:32:33 +08:00
|
|
|
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 <>
|
2022-05-13 08:29:53 +08:00
|
|
|
void PreambleHelper<Family>::programPipelineSelect(LinearStream *pCommandStream,
|
|
|
|
const PipelineSelectArgs &pipelineSelectArgs,
|
|
|
|
const HardwareInfo &hwInfo) {
|
2019-09-19 01:32:33 +08:00
|
|
|
|
2022-05-13 08:29:53 +08:00
|
|
|
using PIPELINE_SELECT = typename Family::PIPELINE_SELECT;
|
2019-09-19 01:32:33 +08:00
|
|
|
|
2022-07-21 22:28:10 +08:00
|
|
|
if (MemorySynchronizationCommands<Family>::isBarrierlPriorToPipelineSelectWaRequired(hwInfo)) {
|
2020-04-27 03:48:59 +08:00
|
|
|
PipeControlArgs args;
|
|
|
|
args.renderTargetCacheFlushEnable = true;
|
2022-07-21 22:28:10 +08:00
|
|
|
MemorySynchronizationCommands<Family>::addSingleBarrier(*pCommandStream, args);
|
2019-09-19 01:32:33 +08:00
|
|
|
}
|
|
|
|
|
2022-08-11 07:26:05 +08:00
|
|
|
auto cmdSpace = pCommandStream->getSpaceForCmd<PIPELINE_SELECT>();
|
|
|
|
PIPELINE_SELECT pipelineSelectCmd = Family::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
|
|
|
|
2022-08-11 07:26:05 +08:00
|
|
|
pipelineSelectCmd.setMaskBits(mask);
|
|
|
|
pipelineSelectCmd.setPipelineSelection(pipeline);
|
|
|
|
pipelineSelectCmd.setMediaSamplerDopClockGateEnable(!pipelineSelectArgs.mediaSamplerRequired);
|
2019-09-19 01:32:33 +08:00
|
|
|
|
2022-08-11 07:26:05 +08:00
|
|
|
HwInfoConfig::get(hwInfo.platform.eProductFamily)->setAdditionalPipelineSelectFields(&pipelineSelectCmd, pipelineSelectArgs, hwInfo);
|
2020-04-09 00:33:03 +08:00
|
|
|
|
2022-08-11 07:26:05 +08:00
|
|
|
*cmdSpace = pipelineSelectCmd;
|
2019-09-19 01:32:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
2022-05-13 08:29:53 +08:00
|
|
|
void PreambleHelper<Family>::addPipeControlBeforeVfeCmd(LinearStream *pCommandStream, const HardwareInfo *hwInfo, EngineGroupType engineGroupType) {
|
|
|
|
PipeControlArgs args = {};
|
2021-11-25 17:31:14 +08:00
|
|
|
if (hwInfo->workaroundTable.flags.waSendMIFLUSHBeforeVFE) {
|
2021-03-31 22:11:31 +08:00
|
|
|
if (engineGroupType != EngineGroupType::Compute) {
|
2022-05-13 08:29:53 +08:00
|
|
|
args.renderTargetCacheFlushEnable = true;
|
|
|
|
args.depthCacheFlushEnable = true;
|
|
|
|
args.depthStallEnable = true;
|
2019-09-19 01:32:33 +08:00
|
|
|
}
|
2022-05-13 08:29:53 +08:00
|
|
|
args.dcFlushEnable = true;
|
2019-09-19 01:32:33 +08:00
|
|
|
}
|
2022-05-13 08:29:53 +08:00
|
|
|
|
2022-07-21 22:28:10 +08:00
|
|
|
MemorySynchronizationCommands<Family>::addSingleBarrier(*pCommandStream, args);
|
2019-09-19 01:32:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
2022-05-13 08:29:53 +08:00
|
|
|
void PreambleHelper<Family>::programL3(LinearStream *pCommandStream, uint32_t l3Config) {
|
2019-09-19 01:32:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
2022-05-13 08:29:53 +08:00
|
|
|
uint32_t PreambleHelper<Family>::getUrbEntryAllocationSize() {
|
2019-09-19 01:32:33 +08:00
|
|
|
return 1024u;
|
|
|
|
}
|
|
|
|
|
2019-09-30 22:11:18 +08:00
|
|
|
template <>
|
2022-08-11 07:26:05 +08:00
|
|
|
void PreambleHelper<Family>::appendProgramVFEState(const HardwareInfo &hwInfo, const StreamProperties &streamProperties, void *cmd) {
|
|
|
|
VFE_STATE_TYPE *mediaVfeState = static_cast<VFE_STATE_TYPE *>(cmd);
|
|
|
|
bool disableEUFusion = streamProperties.frontEndState.disableEUFusion.value == 1;
|
2022-05-13 08:29:53 +08:00
|
|
|
auto &hwHelper = HwHelperHw<Family>::get();
|
2022-03-17 23:53:21 +08:00
|
|
|
if (!hwHelper.isFusedEuDispatchEnabled(hwInfo, disableEUFusion)) {
|
2020-03-13 20:14:28 +08:00
|
|
|
mediaVfeState->setDisableSlice0Subslice2(true);
|
2019-09-30 22:11:18 +08:00
|
|
|
}
|
2020-10-21 17:57:13 +08:00
|
|
|
if (DebugManager.flags.MediaVfeStateMaxSubSlices.get() != -1) {
|
|
|
|
mediaVfeState->setMaximumNumberOfDualSubslices(DebugManager.flags.MediaVfeStateMaxSubSlices.get());
|
|
|
|
}
|
2019-09-30 22:11:18 +08:00
|
|
|
}
|
2019-09-19 01:32:33 +08:00
|
|
|
|
2022-08-11 07:26:05 +08:00
|
|
|
// Explicitly instantiate PreambleHelper for Gen12Lp device family
|
2022-05-13 08:29:53 +08:00
|
|
|
template struct PreambleHelper<Family>;
|
2019-09-19 01:32:33 +08:00
|
|
|
} // namespace NEO
|