2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2021-05-17 02:51:16 +08:00
|
|
|
* Copyright (C) 2018-2021 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/command_stream/csr_definitions.h"
|
2021-08-03 19:48:35 +08:00
|
|
|
#include "shared/source/helpers/preamble_bdw_and_later.inl"
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
template <>
|
|
|
|
uint32_t PreambleHelper<SKLFamily>::getL3Config(const HardwareInfo &hwInfo, bool useSLM) {
|
|
|
|
uint32_t l3Config = 0;
|
|
|
|
|
2019-05-08 22:00:24 +08:00
|
|
|
switch (hwInfo.platform.eProductFamily) {
|
2017-12-21 07:45:38 +08:00
|
|
|
case IGFX_SKYLAKE:
|
|
|
|
l3Config = getL3ConfigHelper<IGFX_SKYLAKE>(useSLM);
|
|
|
|
break;
|
|
|
|
case IGFX_BROXTON:
|
|
|
|
l3Config = getL3ConfigHelper<IGFX_BROXTON>(useSLM);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
l3Config = getL3ConfigHelper<IGFX_SKYLAKE>(true);
|
|
|
|
}
|
|
|
|
return l3Config;
|
|
|
|
}
|
|
|
|
|
2019-08-06 05:57:15 +08:00
|
|
|
template <>
|
|
|
|
bool PreambleHelper<SKLFamily>::isL3Configurable(const HardwareInfo &hwInfo) {
|
|
|
|
return getL3Config(hwInfo, true) != getL3Config(hwInfo, false);
|
|
|
|
}
|
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
template <>
|
2019-08-19 21:01:00 +08:00
|
|
|
void PreambleHelper<SKLFamily>::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) {
|
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
typedef typename SKLFamily::PIPELINE_SELECT PIPELINE_SELECT;
|
|
|
|
|
2020-04-09 00:33:03 +08:00
|
|
|
auto pCmd = pCommandStream->getSpaceForCmd<PIPELINE_SELECT>();
|
|
|
|
PIPELINE_SELECT cmd = SKLFamily::cmdInitPipelineSelect;
|
2018-01-17 15:37:47 +08:00
|
|
|
|
|
|
|
auto mask = pipelineSelectEnablePipelineSelectMaskBits | pipelineSelectMediaSamplerDopClockGateMaskBits;
|
2020-04-09 00:33:03 +08:00
|
|
|
cmd.setMaskBits(mask);
|
|
|
|
cmd.setPipelineSelection(PIPELINE_SELECT::PIPELINE_SELECTION_GPGPU);
|
|
|
|
cmd.setMediaSamplerDopClockGateEnable(!pipelineSelectArgs.mediaSamplerRequired);
|
|
|
|
|
|
|
|
*pCmd = cmd;
|
2017-12-21 07:45:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
2021-03-31 22:11:31 +08:00
|
|
|
void PreambleHelper<SKLFamily>::addPipeControlBeforeVfeCmd(LinearStream *pCommandStream, const HardwareInfo *hwInfo, EngineGroupType engineGroupType) {
|
2018-02-23 21:01:12 +08:00
|
|
|
auto pipeControl = pCommandStream->getSpaceForCmd<PIPE_CONTROL>();
|
2020-04-09 00:33:03 +08:00
|
|
|
PIPE_CONTROL cmd = SKLFamily::cmdInitPipeControl;
|
|
|
|
cmd.setCommandStreamerStallEnable(true);
|
2021-11-25 17:31:14 +08:00
|
|
|
if (hwInfo->workaroundTable.flags.waSendMIFLUSHBeforeVFE) {
|
2020-04-09 00:33:03 +08:00
|
|
|
cmd.setRenderTargetCacheFlushEnable(true);
|
|
|
|
cmd.setDepthCacheFlushEnable(true);
|
|
|
|
cmd.setDcFlushEnable(true);
|
2017-12-21 07:45:38 +08:00
|
|
|
}
|
2020-04-09 00:33:03 +08:00
|
|
|
*pipeControl = cmd;
|
2017-12-21 07:45:38 +08:00
|
|
|
}
|
|
|
|
|
2018-02-20 15:11:24 +08:00
|
|
|
template <>
|
|
|
|
void PreambleHelper<SKLFamily>::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 = SKLFamily::cmdInitPipeControl;
|
|
|
|
cmd.setCommandStreamerStallEnable(true);
|
|
|
|
*pipeControl = cmd;
|
2018-02-20 15:11:24 +08:00
|
|
|
|
2020-10-06 16:58:18 +08:00
|
|
|
LriHelper<SKLFamily>::program(pCommandStream,
|
|
|
|
DebugControlReg2::address,
|
|
|
|
DebugControlReg2::getRegData(requiredThreadArbitrationPolicy),
|
|
|
|
false);
|
2018-02-20 15:11:24 +08:00
|
|
|
}
|
|
|
|
|
2018-04-20 19:55:54 +08:00
|
|
|
template <>
|
|
|
|
size_t PreambleHelper<SKLFamily>::getThreadArbitrationCommandsSize() {
|
|
|
|
return sizeof(MI_LOAD_REGISTER_IMM) + sizeof(PIPE_CONTROL);
|
|
|
|
}
|
|
|
|
|
2021-09-09 16:32:45 +08:00
|
|
|
template <>
|
|
|
|
std::vector<uint32_t> PreambleHelper<SKLFamily>::getSupportedThreadArbitrationPolicies() {
|
|
|
|
std::vector<uint32_t> retVal;
|
|
|
|
for (const uint32_t &p : DebugControlReg2::supportedArbitrationPolicy) {
|
|
|
|
retVal.push_back(p);
|
|
|
|
}
|
|
|
|
return retVal;
|
|
|
|
}
|
2018-02-20 15:11:24 +08:00
|
|
|
template struct PreambleHelper<SKLFamily>;
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|