| 1 | /* |
| 2 | * Copyright (C) 2021-2024 Intel Corporation |
| 3 | * |
| 4 | * SPDX-License-Identifier: MIT |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #include "shared/source/command_stream/csr_definitions.h"cxx . . $ `<file>/shared/source/command_stream/csr_definitions.h`/ |
| 9 | #include "shared/source/command_stream/stream_properties.h"cxx . . $ `<file>/shared/source/command_stream/stream_properties.h`/ |
| 10 | #include "shared/source/debug_settings/debug_settings_manager.h"cxx . . $ `<file>/shared/source/debug_settings/debug_settings_manager.h`/ |
| 11 | #include "shared/source/gen_common/reg_configs_common.h"cxx . . $ `<file>/shared/source/gen_common/reg_configs_common.h`/ |
| 12 | #include "shared/source/helpers/gfx_core_helper.h"cxx . . $ `<file>/shared/source/helpers/gfx_core_helper.h`/ |
| 13 | #include "shared/source/helpers/pipe_control_args.h"cxx . . $ `<file>/shared/source/helpers/pipe_control_args.h`/ |
| 14 | #include "shared/source/helpers/pipeline_select_helper.h"cxx . . $ `<file>/shared/source/helpers/pipeline_select_helper.h`/ |
| 15 | #include "shared/source/helpers/preamble_base.inl"cxx . . $ `<file>/shared/source/helpers/preamble_base.inl`/ |
| 16 | |
| 17 | namespace NEOcxx . . $ NEO/ { |
| 18 | |
| 19 | template <typename GfxFamily> |
| 20 | void PreambleHelpercxx . . $ NEO/PreambleHelper#<GfxFamily>::addPipeControlBeforeVfeCmdcxx . . $ NEO/PreambleHelper#addPipeControlBeforeVfeCmd(ed79ba35384cd874).(LinearStreamcxx . . $ NEO/LinearStream# *pCommandStream, const HardwareInfocxx . . $ NEO/HardwareInfo# *hwInfo, EngineGroupTypecxx . . $ NEO/EngineGroupType# engineGroupType) { |
| 21 | } |
| 22 | |
| 23 | template <typename GfxFamily> |
| 24 | void PreambleHelpercxx . . $ NEO/PreambleHelper#<GfxFamily>::programL3cxx . . $ NEO/PreambleHelper#programL3(e3886b8e4ed24bce).(LinearStreamcxx . . $ NEO/LinearStream# *pCommandStream, uint32_tcxx . . $ uint32_t# l3Config, bool isBcs) { |
| 25 | } |
| 26 | |
| 27 | template <typename GfxFamily> |
| 28 | uint32_tcxx . . $ uint32_t# PreambleHelpercxx . . $ NEO/PreambleHelper#<GfxFamily>::getUrbEntryAllocationSizecxx . . $ NEO/PreambleHelper#getUrbEntryAllocationSize(db52760e79bf9054).() { |
| 29 | return 0u; |
| 30 | } |
| 31 | |
| 32 | template <typename GfxFamily> |
| 33 | void *PreambleHelpercxx . . $ NEO/PreambleHelper#<GfxFamily>::getSpaceForVfeStatecxx . . $ NEO/PreambleHelper#getSpaceForVfeState(3e38e2ae01f43905).(LinearStreamcxx . . $ NEO/LinearStream# *pCommandStream, |
| 34 | const HardwareInfocxx . . $ NEO/HardwareInfo# &hwInfo, |
| 35 | EngineGroupTypecxx . . $ NEO/EngineGroupType# engineGroupType) { |
| 36 | using CFE_STATEcxx . . $ NEO/PreambleHelper#getSpaceForVfeState(3e38e2ae01f43905).CFE_STATE# = typename Familycxx . . $ NEO/Family#::CFE_STATEcxx . . $ NEO/XeHpgCore#CFE_STATE#; |
| 37 | return pCommandStream->getSpacecxx . . $ NEO/LinearStream#getSpace(bfcfa4d6b7f7ef64).(sizeof(CFE_STATEcxx . . $ NEO/PreambleHelper#getSpaceForVfeState(3e38e2ae01f43905).CFE_STATE#)); |
| 38 | } |
| 39 | |
| 40 | template <typename GfxFamily> |
| 41 | void PreambleHelpercxx . . $ NEO/PreambleHelper#<GfxFamily>::programVfeStatecxx . . $ NEO/PreambleHelper#programVfeState(3b006670d29f4154).(void *pVfeState, |
| 42 | const RootDeviceEnvironmentcxx . . $ NEO/RootDeviceEnvironment# &rootDeviceEnvironment, |
| 43 | uint32_tcxx . . $ uint32_t# scratchSize, |
| 44 | uint64_tcxx . . $ uint64_t# scratchAddress, |
| 45 | uint32_tcxx . . $ uint32_t# maxFrontEndThreads, |
| 46 | const StreamPropertiescxx . . $ NEO/StreamProperties# &streamProperties) { |
| 47 | using CFE_STATEcxx . . $ NEO/PreambleHelper#programVfeState(3b006670d29f4154).CFE_STATE# = typename Familycxx . . $ NEO/Family#::CFE_STATEcxx . . $ NEO/XeHpgCore#CFE_STATE#; |
| 48 | |
| 49 | auto cfeState = reinterpret_cast<CFE_STATEcxx . . $ NEO/PreambleHelper#programVfeState(3b006670d29f4154).CFE_STATE# *>(pVfeState); |
| 50 | CFE_STATEcxx . . $ NEO/PreambleHelper#programVfeState(3b006670d29f4154).CFE_STATE# cmd = Familycxx . . $ NEO/Family#::cmdInitCfeStatecxx . . $ NEO/XeHpgCoreFamily#cmdInitCfeState.; |
| 51 | |
| 52 | uint32_tcxx . . $ uint32_t# lowAddress = uint32_tcxx . . $ uint32_t#(0xFFFFFFFF & scratchAddress); |
| 53 | cmd.setScratchSpaceBuffercxx . . $ NEO/XeHpcCore#tagCFE_STATE#setScratchSpaceBuffer(2c44cd906ae4e829).(lowAddress); |
| 54 | cmd.setMaximumNumberOfThreadscxx . . $ NEO/XeHpcCore#tagCFE_STATE#setMaximumNumberOfThreads(cb2f890c2fdad230).(maxFrontEndThreads); |
| 55 | |
| 56 | cmd.setComputeOverdispatchDisablecxx . . $ NEO/Xe2HpgCore#tagCFE_STATE#setComputeOverdispatchDisable(b45ddcbc8423892c).(streamProperties.frontEndStatecxx . . $ NEO/StreamProperties#frontEndState..disableOverdispatchcxx . . $ NEO/FrontEndProperties#disableOverdispatch..valuecxx . . $ NEO/StreamPropertyType#value. == 1); |
| 57 | |
| 58 | PreambleHelpercxx . . $ NEO/PreambleHelper#<Family>::setSingleSliceDispatchModecxx . . $ NEO/PreambleHelper#setSingleSliceDispatchMode(b81e5e1865225ade).(&cmd, streamProperties.frontEndStatecxx . . $ NEO/StreamProperties#frontEndState..singleSliceDispatchCcsModecxx . . $ NEO/FrontEndProperties#singleSliceDispatchCcsMode..valuecxx . . $ NEO/StreamPropertyType#value. == 1); |
| 59 | |
| 60 | appendProgramVFEStatecxx . . $ NEO/PreambleHelper#appendProgramVFEState(f532f0e714c74734).(rootDeviceEnvironment, streamProperties, &cmd); |
| 61 | |
| 62 | if (debugManagercxx . . $ NEO/debugManager..flagscxx . . $ NEO/DebugSettingsManager#flags..ComputeOverdispatchDisablecxx . . $ NEO/DebugVariables#ComputeOverdispatchDisable..getcxx . . $ NEO/DebugVarBase#get(8f5363d873dd4781).() != -1) { |
| 63 | cmd.setComputeOverdispatchDisablecxx . . $ NEO/XeHpgCore#tagCFE_STATE#setComputeOverdispatchDisable(b45ddcbc8423892c).(debugManagercxx . . $ NEO/debugManager..flagscxx . . $ NEO/DebugSettingsManager#flags..ComputeOverdispatchDisablecxx . . $ NEO/DebugVariables#ComputeOverdispatchDisable..getcxx . . $ NEO/DebugVarBase#get(8f5363d873dd4781).()); |
| 64 | } |
| 65 | |
| 66 | if (debugManagercxx . . $ NEO/debugManager..flagscxx . . $ NEO/DebugSettingsManager#flags..MaximumNumberOfThreadscxx . . $ NEO/DebugVariables#MaximumNumberOfThreads..getcxx . . $ NEO/DebugVarBase#get(8f5363d873dd4781).() != -1) { |
| 67 | cmd.setMaximumNumberOfThreadscxx . . $ NEO/Xe2HpgCore#tagCFE_STATE#setMaximumNumberOfThreads(cb2f890c2fdad230).(debugManagercxx . . $ NEO/debugManager..flagscxx . . $ NEO/DebugSettingsManager#flags..MaximumNumberOfThreadscxx . . $ NEO/DebugVariables#MaximumNumberOfThreads..getcxx . . $ NEO/DebugVarBase#get(8f5363d873dd4781).()); |
| 68 | } |
| 69 | if (debugManagercxx . . $ NEO/debugManager..flagscxx . . $ NEO/DebugSettingsManager#flags..OverDispatchControlcxx . . $ NEO/DebugVariables#OverDispatchControl..getcxx . . $ NEO/DebugVarBase#get(8f5363d873dd4781).() != -1) { |
| 70 | cmd.setOverDispatchControlcxx . . $ NEO/Xe2HpgCore#tagCFE_STATE#setOverDispatchControl(5853e278bc4b872).(static_cast<typename CFE_STATEcxx . . $ NEO/PreambleHelper#programVfeState(3b006670d29f4154).CFE_STATE#::OVER_DISPATCH_CONTROLcxx . . $ NEO/XeHpcCore#tagCFE_STATE#OVER_DISPATCH_CONTROL#>(debugManagercxx . . $ NEO/debugManager..flagscxx . . $ NEO/DebugSettingsManager#flags..OverDispatchControlcxx . . $ NEO/DebugVariables#OverDispatchControl..getcxx . . $ NEO/DebugVarBase#get(8f5363d873dd4781).())); |
| 71 | } |
| 72 | if (debugManagercxx . . $ NEO/debugManager..flagscxx . . $ NEO/DebugSettingsManager#flags..CFELargeGRFThreadAdjustDisablecxx . . $ NEO/DebugVariables#CFELargeGRFThreadAdjustDisable..getcxx . . $ NEO/DebugVarBase#get(8f5363d873dd4781).() != -1) { |
| 73 | cmd.setLargeGRFThreadAdjustDisablecxx . . $ NEO/XeHpgCore#tagCFE_STATE#setLargeGRFThreadAdjustDisable(b45ddcbc8423892c).(debugManagercxx . . $ NEO/debugManager..flagscxx . . $ NEO/DebugSettingsManager#flags..CFELargeGRFThreadAdjustDisablecxx . . $ NEO/DebugVariables#CFELargeGRFThreadAdjustDisable..getcxx . . $ NEO/DebugVarBase#get(8f5363d873dd4781).()); |
| 74 | } |
| 75 | |
| 76 | *cfeState =cxx . . $ NEO/XeHpcCore#tagCFE_STATE#`operator=`(7d5497b766734fc6). cmd; |
| 77 | } |
| 78 | |
| 79 | template <typename GfxFamily> |
| 80 | uint64_tcxx . . $ uint64_t# PreambleHelpercxx . . $ NEO/PreambleHelper#<GfxFamily>::getScratchSpaceAddressOffsetForVfeStatecxx . . $ NEO/PreambleHelper#getScratchSpaceAddressOffsetForVfeState(fa6449644d0a0051).(LinearStreamcxx . . $ NEO/LinearStream# *pCommandStream, void *pVfeState) { |
| 81 | return 0; |
| 82 | } |
| 83 | |
| 84 | template <typename GfxFamily> |
| 85 | size_t PreambleHelpercxx . . $ NEO/PreambleHelper#<GfxFamily>::getVFECommandsSizecxx . . $ NEO/PreambleHelper#getVFECommandsSize(f708dce9a8856c70).() { |
| 86 | using CFE_STATEcxx . . $ NEO/PreambleHelper#getVFECommandsSize(f708dce9a8856c70).CFE_STATE# = typename Familycxx . . $ NEO/Family#::CFE_STATEcxx . . $ NEO/XeHpgCore#CFE_STATE#; |
| 87 | return sizeof(CFE_STATEcxx . . $ NEO/PreambleHelper#getVFECommandsSize(f708dce9a8856c70).CFE_STATE#); |
| 88 | } |
| 89 | |
| 90 | template <typename GfxFamily> |
| 91 | uint32_tcxx . . $ uint32_t# PreambleHelpercxx . . $ NEO/PreambleHelper#<GfxFamily>::getL3Configcxx . . $ NEO/PreambleHelper#getL3Config(2ff5256bc4bcda70).(const HardwareInfocxx . . $ NEO/HardwareInfo# &hwInfo, bool useSLM) { |
| 92 | return 0u; |
| 93 | } |
| 94 | |
| 95 | template <typename GfxFamily> |
| 96 | void PreambleHelpercxx . . $ NEO/PreambleHelper#<GfxFamily>::setSingleSliceDispatchModecxx . . $ NEO/PreambleHelper#setSingleSliceDispatchMode(b81e5e1865225ade).(void *cmd, bool enable) { |
| 97 | auto cfeState = reinterpret_cast<typename GfxFamily::CFE_STATE *>(cmd); |
| 98 | |
| 99 | cfeState->setSingleSliceDispatchCcsMode(enable); |
| 100 | |
| 101 | if (debugManagercxx . . $ NEO/debugManager..flagscxx . . $ NEO/DebugSettingsManager#flags..CFESingleSliceDispatchCCSModecxx . . $ NEO/DebugVariables#CFESingleSliceDispatchCCSMode..getcxx . . $ NEO/DebugVarBase#get(8f5363d873dd4781).() != -1) { |
| 102 | cfeState->setSingleSliceDispatchCcsMode(debugManagercxx . . $ NEO/debugManager..flagscxx . . $ NEO/DebugSettingsManager#flags..CFESingleSliceDispatchCCSModecxx . . $ NEO/DebugVariables#CFESingleSliceDispatchCCSMode..getcxx . . $ NEO/DebugVarBase#get(8f5363d873dd4781).()); |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | template <> |
| 107 | const uint32_tcxx . . $ uint32_t# L3CNTLRegisterOffsetcxx . . $ NEO/L3CNTLRegisterOffset#<Family>::registerOffsetcxx . . $ NEO/L3CNTLRegisterOffset#registerOffset. = stdcxx . . $ std/::numeric_limitscxx . . $ std/numeric_limits#<uint32_t>::maxcxx . . $ std/numeric_limits#max(2658d6455debfaef).(); |
| 108 | |
| 109 | template <> |
| 110 | struct DebugModeRegisterOffsetcxx . . $ NEO/DebugModeRegisterOffset#<Familycxx . . $ NEO/Family#> { |
| 111 | enumcxx . . $ NEO/DebugModeRegisterOffset#$anonymous_type_0# { |
| 112 | registerOffsetcxx . . $ NEO/DebugModeRegisterOffset#registerOffset. = 0x20d8, |
| 113 | debugEnabledValuecxx . . $ NEO/DebugModeRegisterOffset#debugEnabledValue. = (1 << 5) | (1 << 21) |
| 114 | }; |
| 115 | }; |
| 116 | |
| 117 | template <> |
| 118 | struct TdDebugControlRegisterOffsetcxx . . $ NEO/TdDebugControlRegisterOffset#<Familycxx . . $ NEO/Family#> { |
| 119 | enumcxx . . $ NEO/TdDebugControlRegisterOffset#$anonymous_type_1# { |
| 120 | registerOffsetcxx . . $ NEO/TdDebugControlRegisterOffset#registerOffset. = 0xe400, |
| 121 | debugEnabledValuecxx . . $ NEO/TdDebugControlRegisterOffset#debugEnabledValue. = (1 << 7) | (1 << 4) | (1 << 2) | (1 << 0) |
| 122 | }; |
| 123 | }; |
| 124 | |
| 125 | } // namespace NEO |