2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2023-01-09 23:02:00 +08:00
|
|
|
* Copyright (C) 2018-2023 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
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2022-07-08 07:55:53 +08:00
|
|
|
#include "shared/source/gen8/hw_cmds_base.h"
|
2023-02-07 20:53:53 +08:00
|
|
|
#include "shared/source/helpers/hw_info.h"
|
2023-01-09 23:02:00 +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"
|
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
|
|
|
|
2022-07-25 23:30:11 +08:00
|
|
|
using Family = Gen8Family;
|
2022-05-13 08:29:53 +08:00
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
template <>
|
2022-05-13 08:29:53 +08:00
|
|
|
void PreambleHelper<Family>::addPipeControlBeforeVfeCmd(LinearStream *pCommandStream, const HardwareInfo *hwInfo, EngineGroupType engineGroupType) {
|
|
|
|
PipeControlArgs args = {};
|
|
|
|
args.dcFlushEnable = true;
|
2022-07-21 22:28:10 +08:00
|
|
|
MemorySynchronizationCommands<Family>::addSingleBarrier(*pCommandStream, args);
|
2017-12-21 07:45:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
2022-05-13 08:29:53 +08:00
|
|
|
uint32_t PreambleHelper<Family>::getL3Config(const HardwareInfo &hwInfo, bool useSLM) {
|
2017-12-21 07:45:38 +08:00
|
|
|
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_BROADWELL:
|
|
|
|
l3Config = getL3ConfigHelper<IGFX_BROADWELL>(useSLM);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
l3Config = getL3ConfigHelper<IGFX_BROADWELL>(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-08-19 21:01:00 +08:00
|
|
|
|
2022-05-13 08:29:53 +08:00
|
|
|
using PIPELINE_SELECT = typename Family::PIPELINE_SELECT;
|
2020-04-09 00:33:03 +08:00
|
|
|
auto pCmd = pCommandStream->getSpaceForCmd<PIPELINE_SELECT>();
|
2022-05-13 08:29:53 +08:00
|
|
|
PIPELINE_SELECT cmd = Family::cmdInitPipelineSelect;
|
2020-04-09 00:33:03 +08:00
|
|
|
|
|
|
|
cmd.setMaskBits(pipelineSelectEnablePipelineSelectMaskBits);
|
|
|
|
cmd.setPipelineSelection(PIPELINE_SELECT::PIPELINE_SELECTION_GPGPU);
|
|
|
|
|
|
|
|
*pCmd = cmd;
|
2018-01-16 18:30:53 +08:00
|
|
|
}
|
|
|
|
|
2018-11-05 18:52:19 +08:00
|
|
|
template <>
|
2022-05-13 08:29:53 +08:00
|
|
|
size_t PreambleHelper<Family>::getAdditionalCommandsSize(const Device &device) {
|
2023-08-04 17:19:46 +08:00
|
|
|
bool debuggingEnabled = device.getDebugger() != nullptr;
|
2022-04-20 22:12:20 +08:00
|
|
|
return getKernelDebuggingCommandsSize(debuggingEnabled);
|
2018-11-05 18:52:19 +08:00
|
|
|
}
|
|
|
|
|
2022-05-13 08:29:53 +08:00
|
|
|
template struct PreambleHelper<Family>;
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|