2019-01-10 22:36:57 +08:00
|
|
|
/*
|
2021-05-17 02:51:16 +08:00
|
|
|
* Copyright (C) 2019-2021 Intel Corporation
|
2019-01-10 22:36:57 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/command_stream/csr_definitions.h"
|
|
|
|
#include "shared/source/helpers/pipeline_select_helper.h"
|
|
|
|
#include "shared/source/helpers/preamble_bdw_plus.inl"
|
2019-01-10 22:36:57 +08:00
|
|
|
|
|
|
|
#include "reg_configs_common.h"
|
|
|
|
|
|
|
|
namespace NEO {
|
|
|
|
|
|
|
|
template <>
|
|
|
|
uint32_t PreambleHelper<ICLFamily>::getL3Config(const HardwareInfo &hwInfo, bool useSLM) {
|
|
|
|
uint32_t l3Config = 0;
|
|
|
|
|
2019-05-08 22:00:24 +08:00
|
|
|
switch (hwInfo.platform.eProductFamily) {
|
2019-01-10 22:36:57 +08:00
|
|
|
case IGFX_ICELAKE_LP:
|
|
|
|
l3Config = getL3ConfigHelper<IGFX_ICELAKE_LP>(useSLM);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
l3Config = getL3ConfigHelper<IGFX_ICELAKE_LP>(true);
|
|
|
|
}
|
|
|
|
return l3Config;
|
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
2019-08-19 21:01:00 +08:00
|
|
|
void PreambleHelper<ICLFamily>::programPipelineSelect(LinearStream *pCommandStream,
|
2019-09-10 22:13:11 +08:00
|
|
|
const PipelineSelectArgs &pipelineSelectArgs,
|
2019-08-19 21:01:00 +08:00
|
|
|
const HardwareInfo &hwInfo) {
|
|
|
|
|
2020-04-09 00:33:03 +08:00
|
|
|
using PIPELINE_SELECT = typename ICLFamily::PIPELINE_SELECT;
|
2019-01-10 22:36:57 +08:00
|
|
|
|
2020-04-09 00:33:03 +08:00
|
|
|
auto pCmd = pCommandStream->getSpaceForCmd<PIPELINE_SELECT>();
|
|
|
|
PIPELINE_SELECT cmd = ICLFamily::cmdInitPipelineSelect;
|
2019-01-10 22:36:57 +08:00
|
|
|
|
2019-08-19 21:01:00 +08:00
|
|
|
auto mask = pipelineSelectEnablePipelineSelectMaskBits |
|
|
|
|
pipelineSelectMediaSamplerDopClockGateMaskBits |
|
|
|
|
pipelineSelectMediaSamplerPowerClockGateMaskBits;
|
|
|
|
|
2020-04-09 00:33:03 +08:00
|
|
|
cmd.setMaskBits(mask);
|
|
|
|
cmd.setPipelineSelection(PIPELINE_SELECT::PIPELINE_SELECTION_GPGPU);
|
|
|
|
cmd.setMediaSamplerDopClockGateEnable(!pipelineSelectArgs.mediaSamplerRequired);
|
|
|
|
cmd.setMediaSamplerPowerClockGateDisable(pipelineSelectArgs.mediaSamplerRequired);
|
|
|
|
|
|
|
|
*pCmd = cmd;
|
2019-01-10 22:36:57 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
2021-03-31 22:11:31 +08:00
|
|
|
void PreambleHelper<ICLFamily>::addPipeControlBeforeVfeCmd(LinearStream *pCommandStream, const HardwareInfo *hwInfo, EngineGroupType engineGroupType) {
|
2019-01-10 22:36:57 +08:00
|
|
|
auto pipeControl = pCommandStream->getSpaceForCmd<PIPE_CONTROL>();
|
2020-04-09 00:33:03 +08:00
|
|
|
PIPE_CONTROL cmd = ICLFamily::cmdInitPipeControl;
|
|
|
|
cmd.setCommandStreamerStallEnable(true);
|
|
|
|
|
2019-05-08 22:00:24 +08:00
|
|
|
if (hwInfo->workaroundTable.waSendMIFLUSHBeforeVFE) {
|
2020-04-09 00:33:03 +08:00
|
|
|
cmd.setRenderTargetCacheFlushEnable(true);
|
|
|
|
cmd.setDepthCacheFlushEnable(true);
|
|
|
|
cmd.setDcFlushEnable(true);
|
2019-01-10 22:36:57 +08:00
|
|
|
}
|
2020-04-09 00:33:03 +08:00
|
|
|
*pipeControl = cmd;
|
2019-01-10 22:36:57 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
void PreambleHelper<ICLFamily>::programThreadArbitration(LinearStream *pCommandStream, uint32_t requiredThreadArbitrationPolicy) {
|
|
|
|
UNRECOVERABLE_IF(requiredThreadArbitrationPolicy == ThreadArbitrationPolicy::NotPresent);
|
|
|
|
|
|
|
|
auto pipeControl = pCommandStream->getSpaceForCmd<PIPE_CONTROL>();
|
2020-04-09 00:33:03 +08:00
|
|
|
PIPE_CONTROL cmd = ICLFamily::cmdInitPipeControl;
|
|
|
|
cmd.setCommandStreamerStallEnable(true);
|
|
|
|
*pipeControl = cmd;
|
2019-01-10 22:36:57 +08:00
|
|
|
|
2020-10-06 16:58:18 +08:00
|
|
|
LriHelper<ICLFamily>::program(pCommandStream,
|
|
|
|
RowChickenReg4::address,
|
|
|
|
RowChickenReg4::regDataForArbitrationPolicy[requiredThreadArbitrationPolicy],
|
|
|
|
false);
|
2019-01-10 22:36:57 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
size_t PreambleHelper<ICLFamily>::getThreadArbitrationCommandsSize() {
|
|
|
|
return sizeof(MI_LOAD_REGISTER_IMM) + sizeof(PIPE_CONTROL);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
size_t PreambleHelper<ICLFamily>::getAdditionalCommandsSize(const Device &device) {
|
|
|
|
size_t totalSize = PreemptionHelper::getRequiredPreambleSize<ICLFamily>(device);
|
2020-10-27 23:00:56 +08:00
|
|
|
bool debuggingEnabled = device.getDebugger() != nullptr || device.isDebuggerActive();
|
|
|
|
totalSize += getKernelDebuggingCommandsSize(debuggingEnabled);
|
2019-01-10 22:36:57 +08:00
|
|
|
return totalSize;
|
|
|
|
}
|
|
|
|
|
|
|
|
template struct PreambleHelper<ICLFamily>;
|
|
|
|
} // namespace NEO
|