/* * Copyright (C) 2019-2020 Intel Corporation * * SPDX-License-Identifier: MIT * */ #include "shared/source/command_stream/csr_definitions.h" #include "shared/source/helpers/engine_node_helper.h" #include "shared/source/helpers/preamble_bdw_plus.inl" #include "opencl/source/gen12lp/helpers_gen12lp.h" #include "opencl/source/helpers/hardware_commands_helper.h" #include "reg_configs_common.h" namespace NEO { template <> uint32_t PreambleHelper::getL3Config(const HardwareInfo &hwInfo, bool useSLM) { uint32_t l3Config = 0; switch (hwInfo.platform.eProductFamily) { case IGFX_TIGERLAKE_LP: l3Config = getL3ConfigHelper(useSLM); break; default: l3Config = getL3ConfigHelper(true); } return l3Config; } template <> void PreambleHelper::programPipelineSelect(LinearStream *pCommandStream, const PipelineSelectArgs &pipelineSelectArgs, const HardwareInfo &hwInfo) { using PIPELINE_SELECT = typename TGLLPFamily::PIPELINE_SELECT; if (HardwareCommandsHelper::isPipeControlPriorToPipelineSelectWArequired(hwInfo)) { auto pipeControl = MemorySynchronizationCommands::addPipeControl(*pCommandStream, false); pipeControl->setRenderTargetCacheFlushEnable(true); } auto pCmd = (PIPELINE_SELECT *)pCommandStream->getSpace(sizeof(PIPELINE_SELECT)); *pCmd = TGLLPFamily::cmdInitPipelineSelect; auto mask = pipelineSelectEnablePipelineSelectMaskBits | pipelineSelectMediaSamplerDopClockGateMaskBits; pCmd->setMaskBits(mask); pCmd->setPipelineSelection(PIPELINE_SELECT::PIPELINE_SELECTION_GPGPU); pCmd->setMediaSamplerDopClockGateEnable(!pipelineSelectArgs.mediaSamplerRequired); Gen12LPHelpers::setAdditionalPipelineSelectFields(pCmd, pipelineSelectArgs, hwInfo); } template <> void PreambleHelper::addPipeControlBeforeVfeCmd(LinearStream *pCommandStream, const HardwareInfo *hwInfo, aub_stream::EngineType engineType) { auto pipeControl = pCommandStream->getSpaceForCmd(); *pipeControl = TGLLPFamily::cmdInitPipeControl; pipeControl->setCommandStreamerStallEnable(true); if (hwInfo->workaroundTable.waSendMIFLUSHBeforeVFE) { if (!EngineHelpers::isCcs(engineType)) { pipeControl->setRenderTargetCacheFlushEnable(true); pipeControl->setDepthCacheFlushEnable(true); } pipeControl->setDcFlushEnable(true); } } template <> void PreambleHelper::programL3(LinearStream *pCommandStream, uint32_t l3Config) { } template <> uint32_t PreambleHelper::getUrbEntryAllocationSize() { return 1024u; } template <> void PreambleHelper::programAdditionalFieldsInVfeState(VFE_STATE_TYPE *mediaVfeState, const HardwareInfo &hwInfo) { mediaVfeState->setDisableSlice0Subslice2(hwInfo.workaroundTable.waDisableFusedThreadScheduling); if (DebugManager.flags.CFEFusedEUDispatch.get() != -1) { mediaVfeState->setDisableSlice0Subslice2(DebugManager.flags.CFEFusedEUDispatch.get()); } } // Explicitly instantiate PreambleHelper for TGLLP device family template struct PreambleHelper; } // namespace NEO