2019-01-10 15:36:57 +01:00
|
|
|
/*
|
2023-01-09 15:02:00 +00:00
|
|
|
* Copyright (C) 2019-2023 Intel Corporation
|
2019-01-10 15:36:57 +01:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/command_stream/csr_definitions.h"
|
2022-07-07 23:55:53 +00:00
|
|
|
#include "shared/source/gen11/hw_cmds_base.h"
|
2023-02-07 12:53:53 +00:00
|
|
|
#include "shared/source/helpers/hw_info.h"
|
2023-01-09 15:02:00 +00:00
|
|
|
#include "shared/source/helpers/pipe_control_args.h"
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/helpers/pipeline_select_helper.h"
|
2021-08-03 11:48:35 +00:00
|
|
|
#include "shared/source/helpers/preamble_bdw_and_later.inl"
|
2019-01-10 15:36:57 +01:00
|
|
|
|
|
|
|
|
#include "reg_configs_common.h"
|
|
|
|
|
|
|
|
|
|
namespace NEO {
|
|
|
|
|
|
2022-07-25 15:30:11 +00:00
|
|
|
using Family = Gen11Family;
|
2022-05-13 00:29:53 +00:00
|
|
|
|
2019-01-10 15:36:57 +01:00
|
|
|
template <>
|
2022-05-13 00:29:53 +00:00
|
|
|
uint32_t PreambleHelper<Family>::getL3Config(const HardwareInfo &hwInfo, bool useSLM) {
|
2019-01-10 15:36:57 +01:00
|
|
|
uint32_t l3Config = 0;
|
|
|
|
|
|
2019-05-08 16:00:24 +02:00
|
|
|
switch (hwInfo.platform.eProductFamily) {
|
2019-01-10 15:36:57 +01:00
|
|
|
case IGFX_ICELAKE_LP:
|
|
|
|
|
l3Config = getL3ConfigHelper<IGFX_ICELAKE_LP>(useSLM);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
l3Config = getL3ConfigHelper<IGFX_ICELAKE_LP>(true);
|
|
|
|
|
}
|
|
|
|
|
return l3Config;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <>
|
2022-05-13 00:29:53 +00:00
|
|
|
void PreambleHelper<Family>::programPipelineSelect(LinearStream *pCommandStream,
|
|
|
|
|
const PipelineSelectArgs &pipelineSelectArgs,
|
2023-01-26 03:58:18 +00:00
|
|
|
const RootDeviceEnvironment &rootDeviceEnvironment) {
|
2019-08-19 15:01:00 +02:00
|
|
|
|
2022-05-13 00:29:53 +00:00
|
|
|
using PIPELINE_SELECT = typename Family::PIPELINE_SELECT;
|
2019-01-10 15:36:57 +01:00
|
|
|
|
2020-04-08 18:33:03 +02:00
|
|
|
auto pCmd = pCommandStream->getSpaceForCmd<PIPELINE_SELECT>();
|
2022-05-13 00:29:53 +00:00
|
|
|
PIPELINE_SELECT cmd = Family::cmdInitPipelineSelect;
|
2019-01-10 15:36:57 +01:00
|
|
|
|
2019-08-19 15:01:00 +02:00
|
|
|
auto mask = pipelineSelectEnablePipelineSelectMaskBits |
|
|
|
|
|
pipelineSelectMediaSamplerDopClockGateMaskBits |
|
|
|
|
|
pipelineSelectMediaSamplerPowerClockGateMaskBits;
|
|
|
|
|
|
2020-04-08 18:33:03 +02:00
|
|
|
cmd.setMaskBits(mask);
|
|
|
|
|
cmd.setPipelineSelection(PIPELINE_SELECT::PIPELINE_SELECTION_GPGPU);
|
|
|
|
|
cmd.setMediaSamplerDopClockGateEnable(!pipelineSelectArgs.mediaSamplerRequired);
|
|
|
|
|
cmd.setMediaSamplerPowerClockGateDisable(pipelineSelectArgs.mediaSamplerRequired);
|
|
|
|
|
|
|
|
|
|
*pCmd = cmd;
|
2019-01-10 15:36:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <>
|
2022-05-13 00:29:53 +00:00
|
|
|
void PreambleHelper<Family>::addPipeControlBeforeVfeCmd(LinearStream *pCommandStream, const HardwareInfo *hwInfo, EngineGroupType engineGroupType) {
|
|
|
|
|
PipeControlArgs args = {};
|
2021-11-25 09:31:14 +00:00
|
|
|
if (hwInfo->workaroundTable.flags.waSendMIFLUSHBeforeVFE) {
|
2022-05-13 00:29:53 +00:00
|
|
|
args.renderTargetCacheFlushEnable = true;
|
|
|
|
|
args.depthCacheFlushEnable = true;
|
|
|
|
|
args.dcFlushEnable = true;
|
2019-01-10 15:36:57 +01:00
|
|
|
}
|
2022-07-21 14:28:10 +00:00
|
|
|
MemorySynchronizationCommands<Family>::addSingleBarrier(*pCommandStream, args);
|
2019-01-10 15:36:57 +01:00
|
|
|
}
|
|
|
|
|
|
2021-09-09 08:32:45 +00:00
|
|
|
template <>
|
2022-05-13 00:29:53 +00:00
|
|
|
std::vector<int32_t> PreambleHelper<Family>::getSupportedThreadArbitrationPolicies() {
|
2022-03-07 17:00:26 +00:00
|
|
|
std::vector<int32_t> retVal;
|
|
|
|
|
int32_t policySize = sizeof(RowChickenReg4::regDataForArbitrationPolicy) /
|
|
|
|
|
sizeof(RowChickenReg4::regDataForArbitrationPolicy[0]);
|
|
|
|
|
for (int32_t i = 0; i < policySize; i++) {
|
2021-09-09 08:32:45 +00:00
|
|
|
retVal.push_back(i);
|
|
|
|
|
}
|
|
|
|
|
return retVal;
|
|
|
|
|
}
|
2019-01-10 15:36:57 +01:00
|
|
|
template <>
|
2022-05-13 00:29:53 +00:00
|
|
|
size_t PreambleHelper<Family>::getAdditionalCommandsSize(const Device &device) {
|
|
|
|
|
size_t totalSize = PreemptionHelper::getRequiredPreambleSize<Family>(device);
|
2020-10-27 16:00:56 +01:00
|
|
|
bool debuggingEnabled = device.getDebugger() != nullptr || device.isDebuggerActive();
|
|
|
|
|
totalSize += getKernelDebuggingCommandsSize(debuggingEnabled);
|
2019-01-10 15:36:57 +01:00
|
|
|
return totalSize;
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-13 00:29:53 +00:00
|
|
|
template struct PreambleHelper<Family>;
|
2019-01-10 15:36:57 +01:00
|
|
|
} // namespace NEO
|