2019-09-19 01:32:33 +08:00
|
|
|
/*
|
2024-04-19 22:20:27 +08:00
|
|
|
* Copyright (C) 2019-2024 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-12-16 01:32:03 +08:00
|
|
|
#include "shared/source/execution_environment/root_device_environment.h"
|
2022-07-08 07:55:53 +08:00
|
|
|
#include "shared/source/gen12lp/hw_cmds_base.h"
|
2023-02-07 20:53:53 +08:00
|
|
|
#include "shared/source/helpers/hw_info.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"
|
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,
|
2023-01-26 11:58:18 +08:00
|
|
|
const RootDeviceEnvironment &rootDeviceEnvironment) {
|
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
|
|
|
|
2023-03-21 23:08:01 +08:00
|
|
|
if (MemorySynchronizationCommands<Family>::isBarrierPriorToPipelineSelectWaRequired(rootDeviceEnvironment)) {
|
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.setPipelineSelection(pipeline);
|
|
|
|
pipelineSelectCmd.setMediaSamplerDopClockGateEnable(!pipelineSelectArgs.mediaSamplerRequired);
|
2019-09-19 01:32:33 +08:00
|
|
|
|
2022-09-15 08:28:41 +08:00
|
|
|
if (pipelineSelectArgs.systolicPipelineSelectSupport) {
|
2022-09-14 21:03:02 +08:00
|
|
|
mask |= pipelineSelectSystolicModeEnableMaskBits;
|
|
|
|
pipelineSelectCmd.setSpecialModeEnable(pipelineSelectArgs.systolicPipelineSelectMode);
|
|
|
|
}
|
|
|
|
|
|
|
|
pipelineSelectCmd.setMaskBits(mask);
|
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
|
|
|
}
|
|
|
|
|
2023-10-20 06:32:43 +08:00
|
|
|
template <>
|
|
|
|
size_t PreambleHelper<Family>::getCmdSizeForPipelineSelect(const RootDeviceEnvironment &rootDeviceEnvironment) {
|
|
|
|
size_t size = 0;
|
|
|
|
using PIPELINE_SELECT = typename Family::PIPELINE_SELECT;
|
|
|
|
size += sizeof(PIPELINE_SELECT);
|
|
|
|
if (MemorySynchronizationCommands<Family>::isBarrierPriorToPipelineSelectWaRequired(rootDeviceEnvironment)) {
|
|
|
|
size += sizeof(PIPE_CONTROL);
|
|
|
|
}
|
|
|
|
return size;
|
|
|
|
}
|
|
|
|
|
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) {
|
2023-12-01 17:12:59 +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 <>
|
2024-04-19 22:20:27 +08:00
|
|
|
void PreambleHelper<Family>::programL3(LinearStream *pCommandStream, uint32_t l3Config, bool isBcs) {
|
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-12-20 23:56:50 +08:00
|
|
|
void PreambleHelper<Family>::appendProgramVFEState(const RootDeviceEnvironment &rootDeviceEnvironment, const StreamProperties &streamProperties, void *cmd) {
|
2023-12-05 20:44:46 +08:00
|
|
|
FrontEndStateCommand *mediaVfeState = static_cast<FrontEndStateCommand *>(cmd);
|
2022-08-11 07:26:05 +08:00
|
|
|
bool disableEUFusion = streamProperties.frontEndState.disableEUFusion.value == 1;
|
2022-12-20 23:56:50 +08:00
|
|
|
auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<GfxCoreHelper>();
|
|
|
|
auto &hwInfo = *rootDeviceEnvironment.getHardwareInfo();
|
2022-12-08 20:22:35 +08:00
|
|
|
if (!gfxCoreHelper.isFusedEuDispatchEnabled(hwInfo, disableEUFusion)) {
|
2020-03-13 20:14:28 +08:00
|
|
|
mediaVfeState->setDisableSlice0Subslice2(true);
|
2019-09-30 22:11:18 +08:00
|
|
|
}
|
2023-11-30 16:32:25 +08:00
|
|
|
if (debugManager.flags.MediaVfeStateMaxSubSlices.get() != -1) {
|
|
|
|
mediaVfeState->setMaximumNumberOfDualSubslices(debugManager.flags.MediaVfeStateMaxSubSlices.get());
|
2020-10-21 17:57:13 +08:00
|
|
|
}
|
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
|