2021-04-24 00:43:48 +08:00
|
|
|
/*
|
2023-01-09 23:02:00 +08:00
|
|
|
* Copyright (C) 2021-2023 Intel Corporation
|
2021-04-24 00:43:48 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "shared/source/command_stream/csr_definitions.h"
|
|
|
|
#include "shared/source/command_stream/stream_properties.h"
|
|
|
|
#include "shared/source/debug_settings/debug_settings_manager.h"
|
2023-02-02 00:23:01 +08:00
|
|
|
#include "shared/source/helpers/gfx_core_helper.h"
|
2023-01-09 23:02:00 +08:00
|
|
|
#include "shared/source/helpers/pipe_control_args.h"
|
2021-04-24 00:43:48 +08:00
|
|
|
#include "shared/source/helpers/pipeline_select_helper.h"
|
|
|
|
#include "shared/source/helpers/preamble_base.inl"
|
|
|
|
|
|
|
|
#include "reg_configs_common.h"
|
|
|
|
|
|
|
|
namespace NEO {
|
|
|
|
|
2023-10-20 06:32:43 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
void PreambleHelper<GfxFamily>::addPipeControlBeforeVfeCmd(LinearStream *pCommandStream, const HardwareInfo *hwInfo, EngineGroupType engineGroupType) {
|
2021-04-24 00:43:48 +08:00
|
|
|
}
|
|
|
|
|
2023-10-20 06:32:43 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
void PreambleHelper<GfxFamily>::programL3(LinearStream *pCommandStream, uint32_t l3Config) {
|
2021-04-24 00:43:48 +08:00
|
|
|
}
|
|
|
|
|
2023-10-20 06:32:43 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
uint32_t PreambleHelper<GfxFamily>::getUrbEntryAllocationSize() {
|
2021-04-24 00:43:48 +08:00
|
|
|
return 0u;
|
|
|
|
}
|
|
|
|
|
2022-06-25 00:50:31 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
void *PreambleHelper<GfxFamily>::getSpaceForVfeState(LinearStream *pCommandStream,
|
|
|
|
const HardwareInfo &hwInfo,
|
|
|
|
EngineGroupType engineGroupType) {
|
2021-04-24 00:43:48 +08:00
|
|
|
using CFE_STATE = typename Family::CFE_STATE;
|
|
|
|
return pCommandStream->getSpace(sizeof(CFE_STATE));
|
|
|
|
}
|
|
|
|
|
2021-11-23 20:22:28 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
void PreambleHelper<GfxFamily>::programVfeState(void *pVfeState,
|
2022-12-20 23:56:50 +08:00
|
|
|
const RootDeviceEnvironment &rootDeviceEnvironment,
|
2021-11-23 20:22:28 +08:00
|
|
|
uint32_t scratchSize,
|
|
|
|
uint64_t scratchAddress,
|
|
|
|
uint32_t maxFrontEndThreads,
|
2023-09-13 01:51:43 +08:00
|
|
|
const StreamProperties &streamProperties) {
|
2021-04-24 00:43:48 +08:00
|
|
|
using CFE_STATE = typename Family::CFE_STATE;
|
|
|
|
|
|
|
|
auto cfeState = reinterpret_cast<CFE_STATE *>(pVfeState);
|
|
|
|
CFE_STATE cmd = Family::cmdInitCfeState;
|
|
|
|
|
|
|
|
uint32_t lowAddress = uint32_t(0xFFFFFFFF & scratchAddress);
|
|
|
|
cmd.setScratchSpaceBuffer(lowAddress);
|
|
|
|
cmd.setMaximumNumberOfThreads(maxFrontEndThreads);
|
2022-12-20 23:56:50 +08:00
|
|
|
appendProgramVFEState(rootDeviceEnvironment, streamProperties, &cmd);
|
2021-04-24 00:43:48 +08:00
|
|
|
|
|
|
|
if (DebugManager.flags.CFEMaximumNumberOfThreads.get() != -1) {
|
|
|
|
cmd.setMaximumNumberOfThreads(DebugManager.flags.CFEMaximumNumberOfThreads.get());
|
|
|
|
}
|
|
|
|
if (DebugManager.flags.CFEOverDispatchControl.get() != -1) {
|
|
|
|
cmd.setOverDispatchControl(static_cast<typename CFE_STATE::OVER_DISPATCH_CONTROL>(DebugManager.flags.CFEOverDispatchControl.get()));
|
|
|
|
}
|
|
|
|
if (DebugManager.flags.CFELargeGRFThreadAdjustDisable.get() != -1) {
|
|
|
|
cmd.setLargeGRFThreadAdjustDisable(DebugManager.flags.CFELargeGRFThreadAdjustDisable.get());
|
|
|
|
}
|
|
|
|
|
|
|
|
*cfeState = cmd;
|
|
|
|
}
|
|
|
|
|
2023-10-20 06:32:43 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
uint64_t PreambleHelper<GfxFamily>::getScratchSpaceAddressOffsetForVfeState(LinearStream *pCommandStream, void *pVfeState) {
|
2021-04-24 00:43:48 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2022-06-25 00:50:31 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
size_t PreambleHelper<GfxFamily>::getVFECommandsSize() {
|
2021-04-24 00:43:48 +08:00
|
|
|
using CFE_STATE = typename Family::CFE_STATE;
|
|
|
|
return sizeof(CFE_STATE);
|
|
|
|
}
|
|
|
|
|
2023-10-20 06:32:43 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
uint32_t PreambleHelper<GfxFamily>::getL3Config(const HardwareInfo &hwInfo, bool useSLM) {
|
2021-04-24 00:43:48 +08:00
|
|
|
return 0u;
|
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
const uint32_t L3CNTLRegisterOffset<Family>::registerOffset = std::numeric_limits<uint32_t>::max();
|
|
|
|
|
2021-09-24 00:46:42 +08:00
|
|
|
template <>
|
|
|
|
struct DebugModeRegisterOffset<Family> {
|
|
|
|
enum {
|
|
|
|
registerOffset = 0x20d8,
|
|
|
|
debugEnabledValue = (1 << 5) | (1 << 21)
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
template <>
|
|
|
|
struct TdDebugControlRegisterOffset<Family> {
|
|
|
|
enum {
|
|
|
|
registerOffset = 0xe400,
|
|
|
|
debugEnabledValue = (1 << 7) | (1 << 4) | (1 << 2) | (1 << 0)
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-04-24 00:43:48 +08:00
|
|
|
} // namespace NEO
|