2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2025-03-18 08:28:35 +08:00
|
|
|
* Copyright (C) 2018-2025 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
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2019-02-27 18:39:32 +08:00
|
|
|
#include "igfxfmid.h"
|
|
|
|
|
2018-01-17 15:37:47 +08:00
|
|
|
#include <cstddef>
|
2018-11-14 15:40:37 +08:00
|
|
|
#include <cstdint>
|
2021-09-09 16:32:45 +08:00
|
|
|
#include <vector>
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2023-01-03 00:19:30 +08:00
|
|
|
enum class EngineGroupType : uint32_t;
|
2017-12-21 07:45:38 +08:00
|
|
|
struct HardwareInfo;
|
|
|
|
class Device;
|
2018-11-14 15:40:37 +08:00
|
|
|
struct DispatchFlags;
|
2018-01-08 22:58:02 +08:00
|
|
|
class GraphicsAllocation;
|
2017-12-21 07:45:38 +08:00
|
|
|
class LinearStream;
|
2019-09-10 22:13:11 +08:00
|
|
|
struct PipelineSelectArgs;
|
2021-04-02 02:26:29 +08:00
|
|
|
struct StreamProperties;
|
2022-12-20 23:56:50 +08:00
|
|
|
struct RootDeviceEnvironment;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
struct PreambleHelper {
|
2018-02-20 15:11:24 +08:00
|
|
|
using MI_LOAD_REGISTER_IMM = typename GfxFamily::MI_LOAD_REGISTER_IMM;
|
|
|
|
using PIPE_CONTROL = typename GfxFamily::PIPE_CONTROL;
|
|
|
|
|
2024-04-19 22:20:27 +08:00
|
|
|
static void programL3(LinearStream *pCommandStream, uint32_t l3Config, bool isBcs);
|
2019-08-19 21:01:00 +08:00
|
|
|
static void programPipelineSelect(LinearStream *pCommandStream,
|
2019-09-10 22:13:11 +08:00
|
|
|
const PipelineSelectArgs &pipelineSelectArgs,
|
2023-01-26 11:58:18 +08:00
|
|
|
const RootDeviceEnvironment &rootDeviceEnvironment);
|
2023-09-13 01:51:43 +08:00
|
|
|
static void programPreemption(LinearStream *pCommandStream, Device &device, GraphicsAllocation *preemptionCsr);
|
2021-03-31 22:11:31 +08:00
|
|
|
static void addPipeControlBeforeVfeCmd(LinearStream *pCommandStream, const HardwareInfo *hwInfo, EngineGroupType engineGroupType);
|
2022-12-20 23:56:50 +08:00
|
|
|
static void appendProgramVFEState(const RootDeviceEnvironment &rootDeviceEnvironment, const StreamProperties &streamProperties, void *cmd);
|
2021-04-02 02:26:29 +08:00
|
|
|
static void *getSpaceForVfeState(LinearStream *pCommandStream,
|
|
|
|
const HardwareInfo &hwInfo,
|
|
|
|
EngineGroupType engineGroupType);
|
|
|
|
static void programVfeState(void *pVfeState,
|
2022-12-20 23:56:50 +08:00
|
|
|
const RootDeviceEnvironment &rootDeviceEnvironment,
|
2021-04-02 02:26:29 +08:00
|
|
|
uint32_t scratchSize,
|
|
|
|
uint64_t scratchAddress,
|
|
|
|
uint32_t maxFrontEndThreads,
|
2023-09-13 01:51:43 +08:00
|
|
|
const StreamProperties &streamProperties);
|
2021-03-31 22:11:31 +08:00
|
|
|
static uint64_t getScratchSpaceAddressOffsetForVfeState(LinearStream *pCommandStream, void *pVfeState);
|
2018-03-29 15:06:33 +08:00
|
|
|
static void programPreamble(LinearStream *pCommandStream, Device &device, uint32_t l3Config,
|
2024-04-19 22:20:27 +08:00
|
|
|
GraphicsAllocation *preemptionCsr, bool isBcs);
|
|
|
|
static void programSemaphoreDelay(LinearStream *pCommandStream, bool isBcs);
|
2017-12-21 07:45:38 +08:00
|
|
|
static uint32_t getL3Config(const HardwareInfo &hwInfo, bool useSLM);
|
2023-01-28 00:02:13 +08:00
|
|
|
static bool isSystolicModeConfigurable(const RootDeviceEnvironment &rootDeviceEnvironment);
|
2018-02-20 15:11:24 +08:00
|
|
|
static size_t getAdditionalCommandsSize(const Device &device);
|
2022-03-08 01:00:26 +08:00
|
|
|
static std::vector<int32_t> getSupportedThreadArbitrationPolicies();
|
2019-05-16 23:17:53 +08:00
|
|
|
static size_t getVFECommandsSize();
|
2018-04-13 17:50:57 +08:00
|
|
|
static size_t getKernelDebuggingCommandsSize(bool debuggingActive);
|
2017-12-21 07:45:38 +08:00
|
|
|
static void programGenSpecificPreambleWorkArounds(LinearStream *pCommandStream, const HardwareInfo &hwInfo);
|
|
|
|
static uint32_t getUrbEntryAllocationSize();
|
2023-01-26 11:58:18 +08:00
|
|
|
static size_t getCmdSizeForPipelineSelect(const RootDeviceEnvironment &rootDeviceEnvironment);
|
2020-06-24 20:53:51 +08:00
|
|
|
static size_t getSemaphoreDelayCommandSize();
|
2020-10-06 17:54:04 +08:00
|
|
|
static uint32_t getScratchSizeValueToProgramMediaVfeState(uint32_t scratchSize);
|
2024-01-04 18:27:27 +08:00
|
|
|
static void setSingleSliceDispatchMode(void *cmd, bool enable);
|
2017-12-21 07:45:38 +08:00
|
|
|
};
|
|
|
|
|
2023-12-04 18:51:53 +08:00
|
|
|
template <PRODUCT_FAMILY productFamily>
|
2017-12-21 07:45:38 +08:00
|
|
|
static uint32_t getL3ConfigHelper(bool useSLM);
|
|
|
|
|
2023-12-04 18:51:53 +08:00
|
|
|
template <PRODUCT_FAMILY productFamily>
|
2017-12-21 07:45:38 +08:00
|
|
|
struct L3CNTLREGConfig {
|
|
|
|
static const uint32_t valueForSLM;
|
|
|
|
static const uint32_t valueForNoSLM;
|
|
|
|
};
|
|
|
|
|
2023-12-04 18:51:53 +08:00
|
|
|
template <PRODUCT_FAMILY productFamily>
|
2017-12-21 07:45:38 +08:00
|
|
|
uint32_t getL3ConfigHelper(bool useSLM) {
|
|
|
|
if (!useSLM) {
|
2023-12-04 18:51:53 +08:00
|
|
|
return L3CNTLREGConfig<productFamily>::valueForNoSLM;
|
2017-12-21 07:45:38 +08:00
|
|
|
}
|
2023-12-04 18:51:53 +08:00
|
|
|
return L3CNTLREGConfig<productFamily>::valueForSLM;
|
2017-12-21 07:45:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
struct L3CNTLRegisterOffset {
|
|
|
|
static const uint32_t registerOffset;
|
|
|
|
};
|
2018-02-20 15:11:24 +08:00
|
|
|
|
2019-10-01 19:28:37 +08:00
|
|
|
template <typename GfxFamily>
|
2019-12-11 22:30:14 +08:00
|
|
|
struct DebugModeRegisterOffset {
|
|
|
|
enum {
|
|
|
|
registerOffset = 0x20ec,
|
|
|
|
debugEnabledValue = (1 << 6) | (1 << 22)
|
|
|
|
};
|
|
|
|
};
|
2018-04-13 17:50:57 +08:00
|
|
|
|
2020-10-19 22:04:58 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
struct TdDebugControlRegisterOffset {
|
|
|
|
enum {
|
|
|
|
registerOffset = 0xe400,
|
|
|
|
debugEnabledValue = (1 << 4) | (1 << 7)
|
|
|
|
};
|
|
|
|
};
|
2018-04-13 17:50:57 +08:00
|
|
|
|
2020-12-11 03:05:25 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
struct GlobalSipRegister {
|
|
|
|
enum {
|
|
|
|
registerOffset = 0xE42C,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|