2017-12-21 00:45:38 +01:00
|
|
|
/*
|
2022-02-10 23:33:40 +00:00
|
|
|
* Copyright (C) 2018-2022 Intel Corporation
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
2018-09-18 09:11:08 +02:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2021-12-07 13:50:28 +00:00
|
|
|
#include "shared/source/helpers/definitions/engine_group_types.h"
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/helpers/pipeline_select_helper.h"
|
2021-09-24 16:40:29 +00:00
|
|
|
#include "shared/source/kernel/kernel_execution_type.h"
|
2020-11-17 11:42:29 +01:00
|
|
|
|
2020-02-06 16:06:00 +01:00
|
|
|
#include "engine_node.h"
|
2019-02-27 11:39:32 +01:00
|
|
|
#include "igfxfmid.h"
|
|
|
|
|
2018-01-17 08:37:47 +01:00
|
|
|
#include <cstddef>
|
2018-11-14 08:40:37 +01:00
|
|
|
#include <cstdint>
|
2021-09-09 08:32:45 +00:00
|
|
|
#include <vector>
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2018-01-16 11:30:53 +01:00
|
|
|
|
2017-12-21 00:45:38 +01:00
|
|
|
struct HardwareInfo;
|
|
|
|
class Device;
|
2018-11-14 08:40:37 +01:00
|
|
|
struct DispatchFlags;
|
2018-01-08 15:58:02 +01:00
|
|
|
class GraphicsAllocation;
|
2017-12-21 00:45:38 +01:00
|
|
|
class LinearStream;
|
2019-09-10 16:13:11 +02:00
|
|
|
struct PipelineSelectArgs;
|
2021-04-01 18:26:29 +00:00
|
|
|
struct StreamProperties;
|
2017-12-21 00:45:38 +01:00
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
struct PreambleHelper {
|
2018-02-20 08:11:24 +01:00
|
|
|
using MI_LOAD_REGISTER_IMM = typename GfxFamily::MI_LOAD_REGISTER_IMM;
|
|
|
|
using PIPE_CONTROL = typename GfxFamily::PIPE_CONTROL;
|
2019-10-01 11:51:31 +02:00
|
|
|
using VFE_STATE_TYPE = typename GfxFamily::VFE_STATE_TYPE;
|
2018-02-20 08:11:24 +01:00
|
|
|
|
2017-12-21 00:45:38 +01:00
|
|
|
static void programL3(LinearStream *pCommandStream, uint32_t l3Config);
|
2019-08-19 15:01:00 +02:00
|
|
|
static void programPipelineSelect(LinearStream *pCommandStream,
|
2019-09-10 16:13:11 +02:00
|
|
|
const PipelineSelectArgs &pipelineSelectArgs,
|
2019-08-19 15:01:00 +02:00
|
|
|
const HardwareInfo &hwInfo);
|
2021-09-29 10:28:33 +00:00
|
|
|
static void appendProgramPipelineSelect(void *cmd, bool isSpecialModeSelected, const HardwareInfo &hwInfo);
|
2018-03-29 09:06:33 +02:00
|
|
|
static void programPreemption(LinearStream *pCommandStream, Device &device, GraphicsAllocation *preemptionCsr);
|
2021-03-31 14:11:31 +00:00
|
|
|
static void addPipeControlBeforeVfeCmd(LinearStream *pCommandStream, const HardwareInfo *hwInfo, EngineGroupType engineGroupType);
|
2021-08-13 14:48:13 +00:00
|
|
|
static void appendProgramVFEState(const HardwareInfo &hwInfo, const StreamProperties &streamProperties, void *cmd);
|
2021-04-01 18:26:29 +00:00
|
|
|
static void *getSpaceForVfeState(LinearStream *pCommandStream,
|
|
|
|
const HardwareInfo &hwInfo,
|
|
|
|
EngineGroupType engineGroupType);
|
|
|
|
static void programVfeState(void *pVfeState,
|
|
|
|
const HardwareInfo &hwInfo,
|
|
|
|
uint32_t scratchSize,
|
|
|
|
uint64_t scratchAddress,
|
|
|
|
uint32_t maxFrontEndThreads,
|
|
|
|
const StreamProperties &streamProperties);
|
2021-03-31 14:11:31 +00:00
|
|
|
static uint64_t getScratchSpaceAddressOffsetForVfeState(LinearStream *pCommandStream, void *pVfeState);
|
2022-02-10 23:33:40 +00:00
|
|
|
static void programAdditionalFieldsInVfeState(VFE_STATE_TYPE *mediaVfeState, const HardwareInfo &hwInfo, bool disableEUFusion);
|
2018-03-29 09:06:33 +02:00
|
|
|
static void programPreamble(LinearStream *pCommandStream, Device &device, uint32_t l3Config,
|
2022-03-16 12:16:30 +00:00
|
|
|
GraphicsAllocation *preemptionCsr);
|
2018-04-13 11:50:57 +02:00
|
|
|
static void programKernelDebugging(LinearStream *pCommandStream);
|
2020-06-24 14:53:51 +02:00
|
|
|
static void programSemaphoreDelay(LinearStream *pCommandStream);
|
2017-12-21 00:45:38 +01:00
|
|
|
static uint32_t getL3Config(const HardwareInfo &hwInfo, bool useSLM);
|
2019-08-05 14:57:15 -07:00
|
|
|
static bool isL3Configurable(const HardwareInfo &hwInfo);
|
2021-09-29 10:28:33 +00:00
|
|
|
static bool isSystolicModeConfigurable(const HardwareInfo &hwInfo);
|
|
|
|
static bool isSpecialPipelineSelectModeChanged(bool lastSpecialPipelineSelectMode, bool newSpecialPipelineSelectMode,
|
|
|
|
const HardwareInfo &hwInfo);
|
2018-02-20 08:11:24 +01:00
|
|
|
static size_t getAdditionalCommandsSize(const Device &device);
|
2022-03-07 17:00:26 +00:00
|
|
|
static std::vector<int32_t> getSupportedThreadArbitrationPolicies();
|
2019-05-16 17:17:53 +02:00
|
|
|
static size_t getVFECommandsSize();
|
2018-04-13 11:50:57 +02:00
|
|
|
static size_t getKernelDebuggingCommandsSize(bool debuggingActive);
|
2017-12-21 00:45:38 +01:00
|
|
|
static void programGenSpecificPreambleWorkArounds(LinearStream *pCommandStream, const HardwareInfo &hwInfo);
|
|
|
|
static uint32_t getUrbEntryAllocationSize();
|
2019-09-10 16:13:11 +02:00
|
|
|
static size_t getCmdSizeForPipelineSelect(const HardwareInfo &hwInfo);
|
2020-06-24 14:53:51 +02:00
|
|
|
static size_t getSemaphoreDelayCommandSize();
|
2020-10-06 11:54:04 +02:00
|
|
|
static uint32_t getScratchSizeValueToProgramMediaVfeState(uint32_t scratchSize);
|
2017-12-21 00:45:38 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
template <PRODUCT_FAMILY ProductFamily>
|
|
|
|
static uint32_t getL3ConfigHelper(bool useSLM);
|
|
|
|
|
|
|
|
template <PRODUCT_FAMILY ProductFamily>
|
|
|
|
struct L3CNTLREGConfig {
|
|
|
|
static const uint32_t valueForSLM;
|
|
|
|
static const uint32_t valueForNoSLM;
|
|
|
|
};
|
|
|
|
|
|
|
|
template <PRODUCT_FAMILY ProductFamily>
|
|
|
|
uint32_t getL3ConfigHelper(bool useSLM) {
|
|
|
|
if (!useSLM) {
|
|
|
|
return L3CNTLREGConfig<ProductFamily>::valueForNoSLM;
|
|
|
|
}
|
|
|
|
return L3CNTLREGConfig<ProductFamily>::valueForSLM;
|
|
|
|
}
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
struct L3CNTLRegisterOffset {
|
|
|
|
static const uint32_t registerOffset;
|
|
|
|
};
|
2018-02-20 08:11:24 +01:00
|
|
|
|
2019-10-01 13:28:37 +02:00
|
|
|
template <typename GfxFamily>
|
2019-12-11 15:30:14 +01:00
|
|
|
struct DebugModeRegisterOffset {
|
|
|
|
enum {
|
|
|
|
registerOffset = 0x20ec,
|
|
|
|
debugEnabledValue = (1 << 6) | (1 << 22)
|
|
|
|
};
|
|
|
|
};
|
2018-04-13 11:50:57 +02:00
|
|
|
|
2020-10-19 16:04:58 +02:00
|
|
|
template <typename GfxFamily>
|
|
|
|
struct TdDebugControlRegisterOffset {
|
|
|
|
enum {
|
|
|
|
registerOffset = 0xe400,
|
|
|
|
debugEnabledValue = (1 << 4) | (1 << 7)
|
|
|
|
};
|
|
|
|
};
|
2018-04-13 11:50:57 +02:00
|
|
|
|
2020-12-10 19:05:25 +00:00
|
|
|
template <typename GfxFamily>
|
|
|
|
struct GlobalSipRegister {
|
|
|
|
enum {
|
|
|
|
registerOffset = 0xE42C,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
} // namespace NEO
|