2020-01-17 15:56:05 +08:00
|
|
|
/*
|
2024-01-09 02:01:13 +08:00
|
|
|
* Copyright (C) 2020-2024 Intel Corporation
|
2020-01-17 15:56:05 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2022-03-25 22:19:49 +08:00
|
|
|
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/command_container/cmdcontainer.h"
|
2022-11-10 17:58:55 +08:00
|
|
|
#include "shared/source/command_container/encode_alu_helper.h"
|
2023-01-25 23:26:00 +08:00
|
|
|
#include "shared/source/command_stream/preemption_mode.h"
|
2021-09-28 18:56:22 +08:00
|
|
|
#include "shared/source/debugger/debugger.h"
|
2023-12-05 23:21:29 +08:00
|
|
|
#include "shared/source/helpers/definitions/command_encoder_args.h"
|
2020-02-26 02:23:04 +08:00
|
|
|
#include "shared/source/helpers/register_offsets.h"
|
2020-04-07 20:07:31 +08:00
|
|
|
#include "shared/source/kernel/kernel_arg_descriptor.h"
|
2023-01-25 23:26:00 +08:00
|
|
|
#include "shared/source/kernel/kernel_execution_type.h"
|
2020-01-17 15:56:05 +08:00
|
|
|
|
2022-07-21 22:51:09 +08:00
|
|
|
#include <list>
|
2023-03-01 05:08:09 +08:00
|
|
|
#include <optional>
|
2022-07-21 22:51:09 +08:00
|
|
|
|
2020-01-17 15:56:05 +08:00
|
|
|
namespace NEO {
|
2022-12-29 20:27:52 +08:00
|
|
|
enum class SlmPolicy;
|
2020-01-17 15:56:05 +08:00
|
|
|
|
2021-05-18 10:46:21 +08:00
|
|
|
class BindlessHeapsHelper;
|
2023-01-26 22:33:36 +08:00
|
|
|
class Gmm;
|
2020-06-23 18:03:43 +08:00
|
|
|
class GmmHelper;
|
2020-10-07 20:22:26 +08:00
|
|
|
class IndirectHeap;
|
2023-12-11 20:10:56 +08:00
|
|
|
class InOrderExecInfo;
|
2023-01-26 22:33:36 +08:00
|
|
|
class ProductHelper;
|
|
|
|
|
|
|
|
struct DeviceInfo;
|
|
|
|
struct DispatchKernelEncoderI;
|
|
|
|
struct EncodeSurfaceStateArgs;
|
2021-05-18 10:46:21 +08:00
|
|
|
struct HardwareInfo;
|
2023-01-26 22:33:36 +08:00
|
|
|
struct KernelDescriptor;
|
2022-09-27 06:28:10 +08:00
|
|
|
struct KernelInfo;
|
2023-01-26 22:33:36 +08:00
|
|
|
struct MiFlushArgs;
|
2023-03-06 20:42:09 +08:00
|
|
|
struct EncodeDummyBlitWaArgs;
|
2023-01-26 22:33:36 +08:00
|
|
|
struct PipeControlArgs;
|
|
|
|
struct PipelineSelectArgs;
|
|
|
|
struct RootDeviceEnvironment;
|
2023-02-20 18:27:13 +08:00
|
|
|
struct StateBaseAddressProperties;
|
2021-05-18 10:46:21 +08:00
|
|
|
struct StateComputeModeProperties;
|
2020-06-23 18:03:43 +08:00
|
|
|
|
2022-01-13 01:53:00 +08:00
|
|
|
struct EncodeDispatchKernelArgs {
|
2023-12-11 20:10:56 +08:00
|
|
|
uint64_t eventAddress = 0;
|
2023-10-04 02:42:36 +08:00
|
|
|
uint64_t postSyncImmValue = 0;
|
2023-12-11 20:10:56 +08:00
|
|
|
uint64_t inOrderCounterValue = 0;
|
2022-01-13 01:53:00 +08:00
|
|
|
Device *device = nullptr;
|
2023-12-11 20:10:56 +08:00
|
|
|
NEO::InOrderExecInfo *inOrderExecInfo = nullptr;
|
2022-01-13 01:53:00 +08:00
|
|
|
DispatchKernelEncoderI *dispatchInterface = nullptr;
|
2023-01-26 22:33:36 +08:00
|
|
|
IndirectHeap *surfaceStateHeap = nullptr;
|
|
|
|
IndirectHeap *dynamicStateHeap = nullptr;
|
2022-06-14 21:22:59 +08:00
|
|
|
const void *threadGroupDimensions = nullptr;
|
2023-09-22 19:18:43 +08:00
|
|
|
void *outWalkerPtr = nullptr;
|
2022-09-06 23:31:18 +08:00
|
|
|
std::list<void *> *additionalCommands = nullptr;
|
2022-01-13 01:53:00 +08:00
|
|
|
PreemptionMode preemptionMode = PreemptionMode::Initial;
|
2023-12-13 22:51:31 +08:00
|
|
|
NEO::RequiredPartitionDim requiredPartitionDim = NEO::RequiredPartitionDim::none;
|
|
|
|
NEO::RequiredDispatchWalkOrder requiredDispatchWalkOrder = NEO::RequiredDispatchWalkOrder::none;
|
2023-12-05 23:21:29 +08:00
|
|
|
uint32_t additionalSizeParam = NEO::additionalKernelLaunchSizeParamNotSet;
|
2022-01-13 01:53:00 +08:00
|
|
|
uint32_t partitionCount = 0u;
|
|
|
|
bool isIndirect = false;
|
|
|
|
bool isPredicate = false;
|
|
|
|
bool isTimestampEvent = false;
|
|
|
|
bool requiresUncachedMocs = false;
|
|
|
|
bool useGlobalAtomics = false;
|
|
|
|
bool isInternal = false;
|
|
|
|
bool isCooperative = false;
|
2022-05-28 00:47:43 +08:00
|
|
|
bool isHostScopeSignalEvent = false;
|
|
|
|
bool isKernelUsingSystemAllocation = false;
|
2022-06-27 18:30:29 +08:00
|
|
|
bool isKernelDispatchedFromImmediateCmdList = false;
|
2022-08-17 22:58:27 +08:00
|
|
|
bool isRcs = false;
|
2022-10-12 02:47:13 +08:00
|
|
|
bool dcFlushEnable = false;
|
2023-12-01 22:30:28 +08:00
|
|
|
bool isHeaplessModeEnabled = false;
|
2023-12-12 18:27:05 +08:00
|
|
|
bool interruptEvent = false;
|
2024-01-09 02:01:13 +08:00
|
|
|
|
|
|
|
bool requiresSystemMemoryFence() const {
|
|
|
|
return (isHostScopeSignalEvent && isKernelUsingSystemAllocation);
|
|
|
|
}
|
2022-01-13 01:53:00 +08:00
|
|
|
};
|
|
|
|
|
2022-11-08 19:05:43 +08:00
|
|
|
enum class MiPredicateType : uint32_t {
|
2023-12-14 00:09:52 +08:00
|
|
|
disable = 0,
|
|
|
|
noopOnResult2Clear = 1,
|
|
|
|
noopOnResult2Set = 2
|
2022-11-08 19:05:43 +08:00
|
|
|
};
|
|
|
|
|
2022-11-10 17:58:55 +08:00
|
|
|
enum class CompareOperation : uint32_t {
|
2023-12-19 15:40:17 +08:00
|
|
|
equal = 0,
|
|
|
|
notEqual = 1,
|
|
|
|
greaterOrEqual = 2,
|
|
|
|
less = 3,
|
2022-11-10 17:58:55 +08:00
|
|
|
};
|
|
|
|
|
2022-05-26 21:20:02 +08:00
|
|
|
struct EncodeWalkerArgs {
|
2022-12-12 21:35:16 +08:00
|
|
|
EncodeWalkerArgs() = delete;
|
|
|
|
|
2023-11-30 18:36:43 +08:00
|
|
|
KernelExecutionType kernelExecutionType = KernelExecutionType::defaultType;
|
2022-05-26 21:20:02 +08:00
|
|
|
bool requiredSystemFence = false;
|
2022-12-12 21:35:16 +08:00
|
|
|
const KernelDescriptor &kernelDescriptor;
|
2023-12-13 22:51:31 +08:00
|
|
|
NEO::RequiredDispatchWalkOrder requiredDispatchWalkOrder = NEO::RequiredDispatchWalkOrder::none;
|
2023-12-05 23:21:29 +08:00
|
|
|
uint32_t additionalSizeParam = NEO::additionalKernelLaunchSizeParamNotSet;
|
2023-12-07 17:35:23 +08:00
|
|
|
uint32_t maxFrontEndThreads = 0;
|
2022-05-26 21:20:02 +08:00
|
|
|
};
|
|
|
|
|
2020-01-17 15:56:05 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
struct EncodeDispatchKernel {
|
2023-12-04 20:20:54 +08:00
|
|
|
using DefaultWalkerType = typename GfxFamily::DefaultWalkerType;
|
2020-01-17 15:56:05 +08:00
|
|
|
using INTERFACE_DESCRIPTOR_DATA = typename GfxFamily::INTERFACE_DESCRIPTOR_DATA;
|
|
|
|
using BINDING_TABLE_STATE = typename GfxFamily::BINDING_TABLE_STATE;
|
|
|
|
|
2023-12-01 22:30:28 +08:00
|
|
|
static void encodeCommon(CommandContainer &container, EncodeDispatchKernelArgs &args);
|
|
|
|
|
|
|
|
template <typename WalkerType>
|
2023-09-13 01:51:43 +08:00
|
|
|
static void encode(CommandContainer &container, EncodeDispatchKernelArgs &args);
|
2020-11-17 16:37:44 +08:00
|
|
|
|
2023-11-23 21:58:58 +08:00
|
|
|
template <typename WalkerType>
|
|
|
|
static void encodeAdditionalWalkerFields(const RootDeviceEnvironment &rootDeviceEnvironment, WalkerType &walkerCmd, const EncodeWalkerArgs &walkerArgs);
|
2020-01-17 15:56:05 +08:00
|
|
|
|
2023-11-23 21:58:58 +08:00
|
|
|
template <typename InterfaceDescriptorType>
|
|
|
|
static void appendAdditionalIDDFields(InterfaceDescriptorType *pInterfaceDescriptor, const RootDeviceEnvironment &rootDeviceEnvironment,
|
2022-04-26 22:28:18 +08:00
|
|
|
const uint32_t threadsPerThreadGroup, uint32_t slmTotalSize, SlmPolicy slmPolicy);
|
2020-08-03 22:33:02 +08:00
|
|
|
|
2023-12-01 22:30:28 +08:00
|
|
|
template <typename WalkerType>
|
|
|
|
static void encodeThreadData(WalkerType &walkerCmd,
|
|
|
|
const uint32_t *startWorkGroup,
|
|
|
|
const uint32_t *numWorkGroups,
|
|
|
|
const uint32_t *workGroupSizes,
|
|
|
|
uint32_t simd,
|
|
|
|
uint32_t localIdDimensions,
|
|
|
|
uint32_t threadsPerThreadGroup,
|
|
|
|
uint32_t threadExecutionMask,
|
|
|
|
bool localIdsGenerationByRuntime,
|
|
|
|
bool inlineDataProgrammingRequired,
|
|
|
|
bool isIndirect,
|
|
|
|
uint32_t requiredWorkGroupOrder,
|
|
|
|
const RootDeviceEnvironment &rootDeviceEnvironment);
|
|
|
|
|
2023-11-23 21:58:58 +08:00
|
|
|
template <typename InterfaceDescriptorType>
|
|
|
|
static void setGrfInfo(InterfaceDescriptorType *pInterfaceDescriptor, uint32_t numGrf, const size_t &sizeCrossThreadData,
|
2023-09-23 00:06:50 +08:00
|
|
|
const size_t &sizePerThreadData, const RootDeviceEnvironment &rootDeviceEnvironment);
|
2022-01-20 19:23:30 +08:00
|
|
|
|
2023-02-03 02:57:24 +08:00
|
|
|
static void *getInterfaceDescriptor(CommandContainer &container, IndirectHeap *childDsh, uint32_t &iddOffset);
|
2020-01-17 15:56:05 +08:00
|
|
|
|
2020-07-07 04:55:37 +08:00
|
|
|
static bool isRuntimeLocalIdsGenerationRequired(uint32_t activeChannels,
|
2022-02-04 01:00:25 +08:00
|
|
|
const size_t *lws,
|
2020-07-07 04:55:37 +08:00
|
|
|
std::array<uint8_t, 3> walkOrder,
|
|
|
|
bool requireInputWalkOrder,
|
|
|
|
uint32_t &requiredWalkOrder,
|
|
|
|
uint32_t simd);
|
|
|
|
|
|
|
|
static bool inlineDataProgrammingRequired(const KernelDescriptor &kernelDesc);
|
2020-06-26 22:03:30 +08:00
|
|
|
|
2023-11-23 21:58:58 +08:00
|
|
|
template <typename InterfaceDescriptorType>
|
|
|
|
static void programBarrierEnable(InterfaceDescriptorType &interfaceDescriptor, uint32_t value, const HardwareInfo &hwInfo);
|
2020-07-23 03:17:50 +08:00
|
|
|
|
2023-11-23 21:58:58 +08:00
|
|
|
template <typename WalkerType, typename InterfaceDescriptorType>
|
|
|
|
static void adjustInterfaceDescriptorData(InterfaceDescriptorType &interfaceDescriptor, const Device &device, const HardwareInfo &hwInfo, const uint32_t threadGroupCount, const uint32_t numGrf, WalkerType &walkerCmd);
|
2020-11-25 00:16:55 +08:00
|
|
|
|
2020-11-27 17:22:59 +08:00
|
|
|
static void adjustBindingTablePrefetch(INTERFACE_DESCRIPTOR_DATA &interfaceDescriptor, uint32_t samplerCount, uint32_t bindingTableEntryCount);
|
|
|
|
|
2023-11-23 21:58:58 +08:00
|
|
|
template <typename WalkerType>
|
2023-12-10 03:26:30 +08:00
|
|
|
static void adjustTimestampPacket(WalkerType &walkerCmd, const EncodeDispatchKernelArgs &args);
|
2022-03-25 19:24:00 +08:00
|
|
|
|
2023-12-13 19:47:42 +08:00
|
|
|
template <typename WalkerType>
|
|
|
|
static void setupPostSyncForRegularEvent(WalkerType &walkerCmd, const EncodeDispatchKernelArgs &args);
|
|
|
|
|
|
|
|
template <typename WalkerType>
|
|
|
|
static void setupPostSyncForInOrderExec(WalkerType &walkerCmd, const EncodeDispatchKernelArgs &args);
|
|
|
|
|
2023-11-23 21:58:58 +08:00
|
|
|
template <typename WalkerType>
|
|
|
|
static void setupPostSyncMocs(WalkerType &walkerCmd, const RootDeviceEnvironment &rootDeviceEnvironment, bool dcFlush);
|
2022-05-27 01:53:33 +08:00
|
|
|
|
2023-12-01 22:30:28 +08:00
|
|
|
template <typename WalkerType>
|
|
|
|
static void adjustWalkOrder(WalkerType &walkerCmd, uint32_t requiredWorkGroupOrder, const RootDeviceEnvironment &rootDeviceEnvironment);
|
2022-05-19 02:10:53 +08:00
|
|
|
|
2023-02-03 02:57:24 +08:00
|
|
|
static size_t getSizeRequiredDsh(const KernelDescriptor &kernelDescriptor, uint32_t iddCount);
|
2022-09-27 06:28:10 +08:00
|
|
|
static size_t getSizeRequiredSsh(const KernelInfo &kernelInfo);
|
2023-02-03 02:57:24 +08:00
|
|
|
inline static size_t additionalSizeRequiredDsh(uint32_t iddCount);
|
2023-01-26 22:33:36 +08:00
|
|
|
static bool isDshNeeded(const DeviceInfo &deviceInfo);
|
2023-02-03 02:57:24 +08:00
|
|
|
static size_t getDefaultDshAlignment();
|
|
|
|
static constexpr size_t getDefaultSshAlignment() {
|
|
|
|
using BINDING_TABLE_STATE = typename GfxFamily::BINDING_TABLE_STATE;
|
|
|
|
return BINDING_TABLE_STATE::SURFACESTATEPOINTER_ALIGN_SIZE;
|
|
|
|
}
|
2024-01-30 09:00:53 +08:00
|
|
|
|
|
|
|
template <bool isHeapless>
|
|
|
|
static void setScratchAddress(uint64_t &scratchAddress, uint32_t requiredScratchSlot0Size, uint32_t requiredScratchSlot1Size, IndirectHeap *ssh, CommandStreamReceiver &csr);
|
2020-01-17 15:56:05 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
struct EncodeStates {
|
|
|
|
using BINDING_TABLE_STATE = typename GfxFamily::BINDING_TABLE_STATE;
|
|
|
|
using INTERFACE_DESCRIPTOR_DATA = typename GfxFamily::INTERFACE_DESCRIPTOR_DATA;
|
|
|
|
using SAMPLER_STATE = typename GfxFamily::SAMPLER_STATE;
|
2020-11-26 17:04:26 +08:00
|
|
|
using SAMPLER_BORDER_COLOR_STATE = typename GfxFamily::SAMPLER_BORDER_COLOR_STATE;
|
2020-01-17 15:56:05 +08:00
|
|
|
|
2022-09-27 06:28:10 +08:00
|
|
|
static constexpr uint32_t alignIndirectStatePointer = MemoryConstants::cacheLineSize;
|
|
|
|
static constexpr size_t alignInterfaceDescriptorData = MemoryConstants::cacheLineSize;
|
2020-01-17 15:56:05 +08:00
|
|
|
|
|
|
|
static uint32_t copySamplerState(IndirectHeap *dsh,
|
|
|
|
uint32_t samplerStateOffset,
|
|
|
|
uint32_t samplerCount,
|
|
|
|
uint32_t borderColorOffset,
|
2020-11-26 17:04:26 +08:00
|
|
|
const void *fnDynamicStateHeap,
|
2021-08-25 18:28:05 +08:00
|
|
|
BindlessHeapsHelper *bindlessHeapHelper,
|
2022-11-10 08:05:51 +08:00
|
|
|
const RootDeviceEnvironment &rootDeviceEnvironment);
|
2023-03-16 08:12:49 +08:00
|
|
|
static size_t getSshHeapSize();
|
2020-01-17 15:56:05 +08:00
|
|
|
};
|
|
|
|
|
2020-02-26 02:23:04 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
struct EncodeMath {
|
|
|
|
using MI_MATH_ALU_INST_INLINE = typename GfxFamily::MI_MATH_ALU_INST_INLINE;
|
|
|
|
using MI_MATH = typename GfxFamily::MI_MATH;
|
2023-12-04 21:53:09 +08:00
|
|
|
constexpr static size_t streamCommandSize = sizeof(MI_MATH) + sizeof(MI_MATH_ALU_INST_INLINE) * RegisterConstants::numAluInstForReadModifyWrite;
|
2020-02-26 02:23:04 +08:00
|
|
|
|
|
|
|
static uint32_t *commandReserve(CommandContainer &container);
|
2022-03-23 16:57:31 +08:00
|
|
|
static uint32_t *commandReserve(LinearStream &cmdStream);
|
2020-02-26 02:23:04 +08:00
|
|
|
static void greaterThan(CommandContainer &container,
|
|
|
|
AluRegisters firstOperandRegister,
|
|
|
|
AluRegisters secondOperandRegister,
|
|
|
|
AluRegisters finalResultRegister);
|
2020-02-26 02:23:04 +08:00
|
|
|
static void addition(CommandContainer &container,
|
|
|
|
AluRegisters firstOperandRegister,
|
|
|
|
AluRegisters secondOperandRegister,
|
|
|
|
AluRegisters finalResultRegister);
|
2022-03-23 16:57:31 +08:00
|
|
|
static void addition(LinearStream &cmdStream,
|
|
|
|
AluRegisters firstOperandRegister,
|
|
|
|
AluRegisters secondOperandRegister,
|
|
|
|
AluRegisters finalResultRegister);
|
2020-12-05 00:15:15 +08:00
|
|
|
static void bitwiseAnd(CommandContainer &container,
|
|
|
|
AluRegisters firstOperandRegister,
|
|
|
|
AluRegisters secondOperandRegister,
|
|
|
|
AluRegisters finalResultRegister);
|
2020-02-26 02:23:04 +08:00
|
|
|
};
|
|
|
|
|
2022-11-08 19:05:43 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
struct EncodeMiPredicate {
|
|
|
|
static void encode(LinearStream &cmdStream, MiPredicateType predicateType);
|
|
|
|
|
|
|
|
static constexpr size_t getCmdSize() {
|
|
|
|
if constexpr (GfxFamily::isUsingMiSetPredicate) {
|
|
|
|
return sizeof(typename GfxFamily::MI_SET_PREDICATE);
|
|
|
|
} else {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-01-17 15:56:05 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
struct EncodeMathMMIO {
|
|
|
|
using MI_STORE_REGISTER_MEM = typename GfxFamily::MI_STORE_REGISTER_MEM;
|
|
|
|
using MI_MATH_ALU_INST_INLINE = typename GfxFamily::MI_MATH_ALU_INST_INLINE;
|
|
|
|
using MI_MATH = typename GfxFamily::MI_MATH;
|
|
|
|
|
|
|
|
static const size_t size = sizeof(MI_STORE_REGISTER_MEM);
|
|
|
|
|
|
|
|
static void encodeMulRegVal(CommandContainer &container, uint32_t offset, uint32_t val, uint64_t dstAddress);
|
|
|
|
|
|
|
|
static void encodeGreaterThanPredicate(CommandContainer &container, uint64_t lhsVal, uint32_t rhsVal);
|
|
|
|
|
2020-12-05 00:15:15 +08:00
|
|
|
static void encodeBitwiseAndVal(CommandContainer &container,
|
|
|
|
uint32_t regOffset,
|
|
|
|
uint32_t immVal,
|
2022-04-06 20:35:32 +08:00
|
|
|
uint64_t dstAddress,
|
|
|
|
bool workloadPartition);
|
2020-12-05 00:15:15 +08:00
|
|
|
|
2020-02-26 02:23:04 +08:00
|
|
|
static void encodeAlu(MI_MATH_ALU_INST_INLINE *pAluParam, AluRegisters srcA, AluRegisters srcB, AluRegisters op, AluRegisters dest, AluRegisters result);
|
2020-01-17 15:56:05 +08:00
|
|
|
|
2020-02-26 02:23:04 +08:00
|
|
|
static void encodeAluSubStoreCarry(MI_MATH_ALU_INST_INLINE *pAluParam, AluRegisters regA, AluRegisters regB, AluRegisters finalResultRegister);
|
2020-01-17 15:56:05 +08:00
|
|
|
|
2020-02-26 02:23:04 +08:00
|
|
|
static void encodeAluAdd(MI_MATH_ALU_INST_INLINE *pAluParam,
|
2020-11-25 11:15:37 +08:00
|
|
|
AluRegisters firstOperandRegister,
|
|
|
|
AluRegisters secondOperandRegister,
|
|
|
|
AluRegisters finalResultRegister);
|
|
|
|
|
|
|
|
static void encodeAluAnd(MI_MATH_ALU_INST_INLINE *pAluParam,
|
2020-02-26 02:23:04 +08:00
|
|
|
AluRegisters firstOperandRegister,
|
|
|
|
AluRegisters secondOperandRegister,
|
|
|
|
AluRegisters finalResultRegister);
|
2022-11-10 17:58:55 +08:00
|
|
|
|
|
|
|
static void encodeIncrement(LinearStream &cmdStream, AluRegisters operandRegister);
|
|
|
|
static void encodeDecrement(LinearStream &cmdStream, AluRegisters operandRegister);
|
|
|
|
static constexpr size_t getCmdSizeForIncrementOrDecrement() {
|
|
|
|
return (EncodeAluHelper<GfxFamily, 4>::getCmdsSize() + (2 * sizeof(typename GfxFamily::MI_LOAD_REGISTER_IMM)));
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
enum class IncrementOrDecrementOperation {
|
2023-12-19 15:40:17 +08:00
|
|
|
increment = 0,
|
|
|
|
decrement = 1,
|
2022-11-10 17:58:55 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
static void encodeIncrementOrDecrement(LinearStream &cmdStream, AluRegisters operandRegister, IncrementOrDecrementOperation operationType);
|
2020-01-17 15:56:05 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
struct EncodeIndirectParams {
|
|
|
|
using MI_LOAD_REGISTER_IMM = typename GfxFamily::MI_LOAD_REGISTER_IMM;
|
|
|
|
using MI_LOAD_REGISTER_MEM = typename GfxFamily::MI_LOAD_REGISTER_MEM;
|
|
|
|
using MI_LOAD_REGISTER_REG = typename GfxFamily::MI_LOAD_REGISTER_REG;
|
|
|
|
using MI_STORE_REGISTER_MEM = typename GfxFamily::MI_STORE_REGISTER_MEM;
|
|
|
|
using MI_MATH = typename GfxFamily::MI_MATH;
|
|
|
|
using MI_MATH_ALU_INST_INLINE = typename GfxFamily::MI_MATH_ALU_INST_INLINE;
|
2021-09-24 20:20:21 +08:00
|
|
|
|
2021-10-07 01:32:04 +08:00
|
|
|
static void encode(CommandContainer &container, uint64_t crossThreadDataGpuVa, DispatchKernelEncoderI *dispatchInterface, uint64_t implicitArgsGpuPtr);
|
|
|
|
static void setGroupCountIndirect(CommandContainer &container, const NEO::CrossThreadDataOffset offsets[3], uint64_t crossThreadAddress);
|
|
|
|
static void setWorkDimIndirect(CommandContainer &container, const NEO::CrossThreadDataOffset offset, uint64_t crossThreadAddress, const uint32_t *groupSize);
|
|
|
|
static void setGlobalWorkSizeIndirect(CommandContainer &container, const NEO::CrossThreadDataOffset offsets[3], uint64_t crossThreadAddress, const uint32_t *lws);
|
2020-01-17 15:56:05 +08:00
|
|
|
|
2021-09-24 20:20:21 +08:00
|
|
|
static size_t getCmdsSizeForSetWorkDimIndirect(const uint32_t *groupSize, bool misalignedPtr);
|
2020-01-17 15:56:05 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
struct EncodeSetMMIO {
|
|
|
|
using MI_LOAD_REGISTER_IMM = typename GfxFamily::MI_LOAD_REGISTER_IMM;
|
|
|
|
using MI_LOAD_REGISTER_MEM = typename GfxFamily::MI_LOAD_REGISTER_MEM;
|
|
|
|
using MI_LOAD_REGISTER_REG = typename GfxFamily::MI_LOAD_REGISTER_REG;
|
|
|
|
|
|
|
|
static const size_t sizeIMM = sizeof(MI_LOAD_REGISTER_IMM);
|
|
|
|
static const size_t sizeMEM = sizeof(MI_LOAD_REGISTER_MEM);
|
|
|
|
static const size_t sizeREG = sizeof(MI_LOAD_REGISTER_REG);
|
|
|
|
|
2020-10-06 16:58:18 +08:00
|
|
|
static void encodeIMM(CommandContainer &container, uint32_t offset, uint32_t data, bool remap);
|
2020-01-17 15:56:05 +08:00
|
|
|
static void encodeMEM(CommandContainer &container, uint32_t offset, uint64_t address);
|
|
|
|
static void encodeREG(CommandContainer &container, uint32_t dstOffset, uint32_t srcOffset);
|
2020-10-20 21:14:56 +08:00
|
|
|
|
2021-09-03 19:42:31 +08:00
|
|
|
static void encodeIMM(LinearStream &cmdStream, uint32_t offset, uint32_t data, bool remap);
|
|
|
|
static void encodeMEM(LinearStream &cmdStream, uint32_t offset, uint64_t address);
|
|
|
|
static void encodeREG(LinearStream &cmdStream, uint32_t dstOffset, uint32_t srcOffset);
|
|
|
|
|
2020-10-20 21:14:56 +08:00
|
|
|
static bool isRemapApplicable(uint32_t offset);
|
|
|
|
static void remapOffset(MI_LOAD_REGISTER_MEM *pMiLoadReg);
|
|
|
|
static void remapOffset(MI_LOAD_REGISTER_REG *pMiLoadReg);
|
2020-01-17 15:56:05 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
struct EncodeL3State {
|
|
|
|
static void encode(CommandContainer &container, bool enableSLM);
|
|
|
|
};
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
struct EncodeMediaInterfaceDescriptorLoad {
|
|
|
|
using INTERFACE_DESCRIPTOR_DATA = typename GfxFamily::INTERFACE_DESCRIPTOR_DATA;
|
|
|
|
|
2023-02-03 02:57:24 +08:00
|
|
|
static void encode(CommandContainer &container, IndirectHeap *childDsh);
|
2020-01-17 15:56:05 +08:00
|
|
|
};
|
|
|
|
|
2022-08-17 22:58:27 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
struct EncodeStateBaseAddressArgs {
|
|
|
|
using STATE_BASE_ADDRESS = typename GfxFamily::STATE_BASE_ADDRESS;
|
|
|
|
|
|
|
|
CommandContainer *container = nullptr;
|
|
|
|
STATE_BASE_ADDRESS &sbaCmd;
|
2023-02-20 18:27:13 +08:00
|
|
|
StateBaseAddressProperties *sbaProperties = nullptr;
|
2022-08-17 22:58:27 +08:00
|
|
|
|
|
|
|
uint32_t statelessMocsIndex = 0;
|
2023-02-25 00:55:21 +08:00
|
|
|
uint32_t l1CachePolicy = 0;
|
|
|
|
uint32_t l1CachePolicyDebuggerActive = 0;
|
2022-08-17 22:58:27 +08:00
|
|
|
|
|
|
|
bool useGlobalAtomics = false;
|
|
|
|
bool multiOsContextCapable = false;
|
|
|
|
bool isRcs = false;
|
2023-02-23 05:30:40 +08:00
|
|
|
bool doubleSbaWa = false;
|
2023-11-23 21:58:58 +08:00
|
|
|
bool heaplessModeEnabled = false;
|
2022-08-17 22:58:27 +08:00
|
|
|
};
|
|
|
|
|
2020-01-17 15:56:05 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
struct EncodeStateBaseAddress {
|
2020-08-03 19:13:58 +08:00
|
|
|
using STATE_BASE_ADDRESS = typename GfxFamily::STATE_BASE_ADDRESS;
|
2022-08-17 22:58:27 +08:00
|
|
|
static void encode(EncodeStateBaseAddressArgs<GfxFamily> &args);
|
|
|
|
static size_t getRequiredSizeForStateBaseAddress(Device &device, CommandContainer &container, bool isRcs);
|
2022-09-07 22:27:09 +08:00
|
|
|
static void setSbaTrackingForL0DebuggerIfEnabled(bool trackingEnabled,
|
|
|
|
Device &device,
|
|
|
|
LinearStream &commandStream,
|
2022-11-23 04:07:45 +08:00
|
|
|
STATE_BASE_ADDRESS &sbaCmd, bool useFirstLevelBB);
|
2022-09-07 22:27:09 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
static void setSbaAddressesForDebugger(NEO::Debugger::SbaAddresses &sbaAddress, const STATE_BASE_ADDRESS &sbaCmd);
|
2020-01-17 15:56:05 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
struct EncodeStoreMMIO {
|
|
|
|
using MI_STORE_REGISTER_MEM = typename GfxFamily::MI_STORE_REGISTER_MEM;
|
|
|
|
|
|
|
|
static const size_t size = sizeof(MI_STORE_REGISTER_MEM);
|
2022-04-06 20:35:32 +08:00
|
|
|
static void encode(LinearStream &csr, uint32_t offset, uint64_t address, bool workloadPartition);
|
|
|
|
static void encode(MI_STORE_REGISTER_MEM *cmdBuffer, uint32_t offset, uint64_t address, bool workloadPartition);
|
|
|
|
static void appendFlags(MI_STORE_REGISTER_MEM *storeRegMem, bool workloadPartition);
|
2020-06-01 21:34:10 +08:00
|
|
|
};
|
2020-01-17 15:56:05 +08:00
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
struct EncodeComputeMode {
|
2023-01-23 22:08:25 +08:00
|
|
|
static size_t getCmdSizeForComputeMode(const RootDeviceEnvironment &rootDeviceEnvironment, bool hasSharedHandles, bool isRcs);
|
2022-03-10 01:15:48 +08:00
|
|
|
static void programComputeModeCommandWithSynchronization(LinearStream &csr, StateComputeModeProperties &properties,
|
|
|
|
const PipelineSelectArgs &args, bool hasSharedHandles,
|
2023-09-13 01:51:43 +08:00
|
|
|
const RootDeviceEnvironment &rootDeviceEnvironment, bool isRcs, bool dcFlush);
|
|
|
|
static void programComputeModeCommand(LinearStream &csr, StateComputeModeProperties &properties, const RootDeviceEnvironment &rootDeviceEnvironment);
|
2020-03-19 17:29:36 +08:00
|
|
|
|
2020-12-21 08:56:30 +08:00
|
|
|
static void adjustPipelineSelect(CommandContainer &container, const NEO::KernelDescriptor &kernelDescriptor);
|
2020-01-17 15:56:05 +08:00
|
|
|
};
|
2020-01-24 21:58:15 +08:00
|
|
|
|
2020-03-25 17:04:42 +08:00
|
|
|
template <typename GfxFamily>
|
2023-03-10 21:49:06 +08:00
|
|
|
struct EncodeSemaphore {
|
2020-01-24 21:58:15 +08:00
|
|
|
using MI_SEMAPHORE_WAIT = typename GfxFamily::MI_SEMAPHORE_WAIT;
|
|
|
|
using COMPARE_OPERATION = typename GfxFamily::MI_SEMAPHORE_WAIT::COMPARE_OPERATION;
|
|
|
|
|
2020-02-05 03:26:04 +08:00
|
|
|
static constexpr uint32_t invalidHardwareTag = -2;
|
|
|
|
|
2020-01-24 21:58:15 +08:00
|
|
|
static void programMiSemaphoreWait(MI_SEMAPHORE_WAIT *cmd,
|
|
|
|
uint64_t compareAddress,
|
2023-09-11 23:39:43 +08:00
|
|
|
uint64_t compareData,
|
2020-10-16 21:58:47 +08:00
|
|
|
COMPARE_OPERATION compareMode,
|
2023-03-04 03:01:14 +08:00
|
|
|
bool registerPollMode,
|
2023-09-11 23:39:43 +08:00
|
|
|
bool waitMode,
|
2023-09-12 19:42:40 +08:00
|
|
|
bool useQwordData,
|
|
|
|
bool indirect);
|
2020-10-16 21:58:47 +08:00
|
|
|
|
|
|
|
static void addMiSemaphoreWaitCommand(LinearStream &commandStream,
|
|
|
|
uint64_t compareAddress,
|
2023-09-11 23:39:43 +08:00
|
|
|
uint64_t compareData,
|
2020-10-16 21:58:47 +08:00
|
|
|
COMPARE_OPERATION compareMode,
|
2023-09-11 23:39:43 +08:00
|
|
|
bool registerPollMode,
|
2023-09-12 19:42:40 +08:00
|
|
|
bool useQwordData,
|
|
|
|
bool indirect);
|
2020-02-11 22:21:18 +08:00
|
|
|
|
2023-03-04 03:01:14 +08:00
|
|
|
static void applyMiSemaphoreWaitCommand(LinearStream &commandStream,
|
|
|
|
std::list<void *> &commandsList);
|
|
|
|
|
2022-11-10 17:58:55 +08:00
|
|
|
static constexpr size_t getSizeMiSemaphoreWait() { return sizeof(MI_SEMAPHORE_WAIT); }
|
2023-09-11 23:39:43 +08:00
|
|
|
|
|
|
|
protected:
|
2023-09-12 19:42:40 +08:00
|
|
|
static void appendSemaphoreCommand(MI_SEMAPHORE_WAIT &cmd, uint64_t compareData, bool indirect, bool useQwordData);
|
2020-01-24 21:58:15 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
struct EncodeAtomic {
|
|
|
|
using MI_ATOMIC = typename GfxFamily::MI_ATOMIC;
|
|
|
|
using ATOMIC_OPCODES = typename GfxFamily::MI_ATOMIC::ATOMIC_OPCODES;
|
|
|
|
using DATA_SIZE = typename GfxFamily::MI_ATOMIC::DATA_SIZE;
|
|
|
|
|
2020-10-02 03:08:46 +08:00
|
|
|
static void programMiAtomic(LinearStream &commandStream,
|
|
|
|
uint64_t writeAddress,
|
2020-01-24 21:58:15 +08:00
|
|
|
ATOMIC_OPCODES opcode,
|
2020-10-02 03:08:46 +08:00
|
|
|
DATA_SIZE dataSize,
|
|
|
|
uint32_t returnDataControl,
|
2021-03-05 01:54:14 +08:00
|
|
|
uint32_t csStall,
|
|
|
|
uint32_t operand1dword0,
|
|
|
|
uint32_t operand1dword1);
|
2020-10-02 03:08:46 +08:00
|
|
|
|
|
|
|
static void programMiAtomic(MI_ATOMIC *atomic,
|
|
|
|
uint64_t writeAddress,
|
|
|
|
ATOMIC_OPCODES opcode,
|
|
|
|
DATA_SIZE dataSize,
|
|
|
|
uint32_t returnDataControl,
|
2021-03-05 01:54:14 +08:00
|
|
|
uint32_t csStall,
|
|
|
|
uint32_t operand1dword0,
|
|
|
|
uint32_t operand1dword1);
|
|
|
|
|
|
|
|
static void setMiAtomicAddress(MI_ATOMIC &atomic, uint64_t writeAddress);
|
2020-01-24 21:58:15 +08:00
|
|
|
};
|
|
|
|
|
2020-01-28 20:50:19 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
struct EncodeBatchBufferStartOrEnd {
|
|
|
|
using MI_BATCH_BUFFER_START = typename GfxFamily::MI_BATCH_BUFFER_START;
|
|
|
|
using MI_BATCH_BUFFER_END = typename GfxFamily::MI_BATCH_BUFFER_END;
|
|
|
|
|
2022-09-02 21:10:48 +08:00
|
|
|
static constexpr size_t getBatchBufferStartSize() {
|
|
|
|
return sizeof(MI_BATCH_BUFFER_START);
|
|
|
|
}
|
|
|
|
|
|
|
|
static constexpr size_t getBatchBufferEndSize() {
|
|
|
|
return sizeof(MI_BATCH_BUFFER_END);
|
|
|
|
}
|
|
|
|
|
2023-04-05 21:21:45 +08:00
|
|
|
static void programBatchBufferStart(MI_BATCH_BUFFER_START *cmdBuffer, uint64_t address, bool secondLevel, bool indirect, bool predicate);
|
2022-11-10 17:58:55 +08:00
|
|
|
static void programBatchBufferStart(LinearStream *commandStream, uint64_t address, bool secondLevel, bool indirect, bool predicate);
|
2020-01-28 20:50:19 +08:00
|
|
|
static void programBatchBufferEnd(CommandContainer &container);
|
2022-09-02 21:10:48 +08:00
|
|
|
static void programBatchBufferEnd(LinearStream &commandStream);
|
2022-11-10 17:58:55 +08:00
|
|
|
|
2023-09-12 01:20:00 +08:00
|
|
|
static void programConditionalDataMemBatchBufferStart(LinearStream &commandStream, uint64_t startAddress, uint64_t compareAddress, uint64_t compareData, CompareOperation compareOperation, bool indirect, bool useQwordData);
|
|
|
|
static void programConditionalDataRegBatchBufferStart(LinearStream &commandStream, uint64_t startAddress, uint32_t compareReg, uint64_t compareData, CompareOperation compareOperation, bool indirect, bool useQwordData);
|
2022-11-10 17:58:55 +08:00
|
|
|
static void programConditionalRegRegBatchBufferStart(LinearStream &commandStream, uint64_t startAddress, AluRegisters compareReg0, AluRegisters compareReg1, CompareOperation compareOperation, bool indirect);
|
2023-04-04 01:57:51 +08:00
|
|
|
static void programConditionalRegMemBatchBufferStart(LinearStream &commandStream, uint64_t startAddress, uint64_t compareAddress, uint32_t compareReg, CompareOperation compareOperation, bool indirect);
|
2022-11-10 17:58:55 +08:00
|
|
|
|
2023-09-12 01:20:00 +08:00
|
|
|
static size_t constexpr getCmdSizeConditionalDataMemBatchBufferStart(bool useQwordData) {
|
|
|
|
size_t size = (getCmdSizeConditionalBufferStartBase() + sizeof(typename GfxFamily::MI_LOAD_REGISTER_MEM) + (2 * sizeof(typename GfxFamily::MI_LOAD_REGISTER_IMM)));
|
|
|
|
size += useQwordData ? sizeof(typename GfxFamily::MI_LOAD_REGISTER_MEM) : sizeof(typename GfxFamily::MI_LOAD_REGISTER_IMM);
|
|
|
|
|
|
|
|
return size;
|
2022-11-10 17:58:55 +08:00
|
|
|
}
|
|
|
|
|
2023-09-12 01:20:00 +08:00
|
|
|
static size_t constexpr getCmdSizeConditionalDataRegBatchBufferStart(bool useQwordData) {
|
|
|
|
size_t size = (getCmdSizeConditionalBufferStartBase() + sizeof(typename GfxFamily::MI_LOAD_REGISTER_REG) + (2 * sizeof(typename GfxFamily::MI_LOAD_REGISTER_IMM)));
|
|
|
|
size += useQwordData ? sizeof(typename GfxFamily::MI_LOAD_REGISTER_REG) : sizeof(typename GfxFamily::MI_LOAD_REGISTER_IMM);
|
|
|
|
|
|
|
|
return size;
|
2022-11-10 17:58:55 +08:00
|
|
|
}
|
|
|
|
|
2023-04-04 01:57:51 +08:00
|
|
|
static size_t constexpr getCmdSizeConditionalRegMemBatchBufferStart() {
|
|
|
|
return (getCmdSizeConditionalBufferStartBase() + +sizeof(typename GfxFamily::MI_LOAD_REGISTER_MEM) + sizeof(typename GfxFamily::MI_LOAD_REGISTER_REG) + (2 * sizeof(typename GfxFamily::MI_LOAD_REGISTER_IMM)));
|
|
|
|
}
|
|
|
|
|
2022-11-10 17:58:55 +08:00
|
|
|
static size_t constexpr getCmdSizeConditionalRegRegBatchBufferStart() {
|
|
|
|
return getCmdSizeConditionalBufferStartBase();
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
static void appendBatchBufferStart(MI_BATCH_BUFFER_START &cmd, bool indirect, bool predicate);
|
|
|
|
static void programConditionalBatchBufferStartBase(LinearStream &commandStream, uint64_t startAddress, AluRegisters regA, AluRegisters regB, CompareOperation compareOperation, bool indirect);
|
|
|
|
|
|
|
|
static size_t constexpr getCmdSizeConditionalBufferStartBase() {
|
|
|
|
return (EncodeAluHelper<GfxFamily, 4>::getCmdsSize() + sizeof(typename GfxFamily::MI_LOAD_REGISTER_REG) +
|
|
|
|
(2 * EncodeMiPredicate<GfxFamily>::getCmdSize()) + sizeof(MI_BATCH_BUFFER_START));
|
|
|
|
}
|
2020-01-28 20:50:19 +08:00
|
|
|
};
|
|
|
|
|
2020-02-21 22:35:08 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
struct EncodeMiFlushDW {
|
|
|
|
using MI_FLUSH_DW = typename GfxFamily::MI_FLUSH_DW;
|
2023-03-06 20:42:09 +08:00
|
|
|
static void programWithWa(LinearStream &commandStream, uint64_t immediateDataGpuAddress, uint64_t immediateData,
|
|
|
|
MiFlushArgs &args);
|
|
|
|
|
|
|
|
static size_t getCommandSizeWithWa(const EncodeDummyBlitWaArgs &waArgs);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
static size_t getWaSize(const EncodeDummyBlitWaArgs &waArgs);
|
|
|
|
static void appendWa(LinearStream &commandStream, MiFlushArgs &args);
|
|
|
|
static void adjust(MI_FLUSH_DW *miFlushDwCmd, const ProductHelper &productHelper);
|
2020-02-21 22:35:08 +08:00
|
|
|
};
|
2020-04-03 23:38:09 +08:00
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
struct EncodeMemoryPrefetch {
|
2023-01-26 03:28:09 +08:00
|
|
|
static void programMemoryPrefetch(LinearStream &commandStream, const GraphicsAllocation &graphicsAllocation, uint32_t size, size_t offset, const RootDeviceEnvironment &rootDeviceEnvironment);
|
|
|
|
static size_t getSizeForMemoryPrefetch(size_t size, const RootDeviceEnvironment &rootDeviceEnvironment);
|
2020-04-03 23:38:09 +08:00
|
|
|
};
|
2020-11-17 01:12:08 +08:00
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
struct EncodeMiArbCheck {
|
|
|
|
using MI_ARB_CHECK = typename GfxFamily::MI_ARB_CHECK;
|
|
|
|
|
2023-03-01 05:08:09 +08:00
|
|
|
static void programWithWa(LinearStream &commandStream, std::optional<bool> preParserDisable, EncodeDummyBlitWaArgs &waArgs);
|
|
|
|
static size_t getCommandSizeWithWa(const EncodeDummyBlitWaArgs &waArgs);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
static void program(LinearStream &commandStream, std::optional<bool> preParserDisable);
|
2020-11-17 01:12:08 +08:00
|
|
|
static size_t getCommandSize();
|
2023-03-01 05:08:09 +08:00
|
|
|
static void adjust(MI_ARB_CHECK &miArbCheck, std::optional<bool> preParserDisable);
|
|
|
|
};
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
struct EncodeWA {
|
|
|
|
static void encodeAdditionalPipelineSelect(LinearStream &stream, const PipelineSelectArgs &args, bool is3DPipeline,
|
|
|
|
const RootDeviceEnvironment &rootDeviceEnvironment, bool isRcs);
|
|
|
|
static size_t getAdditionalPipelineSelectSize(Device &device, bool isRcs);
|
|
|
|
|
|
|
|
static void addPipeControlPriorToNonPipelinedStateCommand(LinearStream &commandStream, PipeControlArgs args,
|
|
|
|
const RootDeviceEnvironment &rootDeviceEnvironment, bool isRcs);
|
|
|
|
static void setAdditionalPipeControlFlagsForNonPipelineStateCommand(PipeControlArgs &args);
|
|
|
|
|
|
|
|
static void addPipeControlBeforeStateBaseAddress(LinearStream &commandStream, const RootDeviceEnvironment &rootDeviceEnvironment, bool isRcs, bool dcFlushRequired);
|
|
|
|
|
|
|
|
static void adjustCompressionFormatForPlanarImage(uint32_t &compressionFormat, int plane);
|
2020-11-17 01:12:08 +08:00
|
|
|
};
|
2021-02-27 06:02:57 +08:00
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
struct EncodeEnableRayTracing {
|
2022-07-22 02:44:54 +08:00
|
|
|
static void programEnableRayTracing(LinearStream &commandStream, uint64_t backBuffer);
|
2022-02-03 01:40:00 +08:00
|
|
|
static void append3dStateBtd(void *ptr3dStateBtd);
|
2021-02-27 06:02:57 +08:00
|
|
|
};
|
|
|
|
|
2021-11-18 06:36:00 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
struct EncodeNoop {
|
|
|
|
static void alignToCacheLine(LinearStream &commandStream);
|
|
|
|
static void emitNoop(LinearStream &commandStream, size_t bytesToUpdate);
|
|
|
|
};
|
|
|
|
|
2021-12-02 22:17:45 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
struct EncodeStoreMemory {
|
|
|
|
using MI_STORE_DATA_IMM = typename GfxFamily::MI_STORE_DATA_IMM;
|
|
|
|
static void programStoreDataImm(LinearStream &commandStream,
|
|
|
|
uint64_t gpuAddress,
|
|
|
|
uint32_t dataDword0,
|
|
|
|
uint32_t dataDword1,
|
|
|
|
bool storeQword,
|
|
|
|
bool workloadPartitionOffset);
|
|
|
|
|
|
|
|
static void programStoreDataImm(MI_STORE_DATA_IMM *cmdBuffer,
|
|
|
|
uint64_t gpuAddress,
|
|
|
|
uint32_t dataDword0,
|
|
|
|
uint32_t dataDword1,
|
|
|
|
bool storeQword,
|
|
|
|
bool workloadPartitionOffset);
|
|
|
|
|
|
|
|
static size_t getStoreDataImmSize() {
|
|
|
|
return sizeof(MI_STORE_DATA_IMM);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2022-04-06 22:41:45 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
struct EncodeMemoryFence {
|
|
|
|
static size_t getSystemMemoryFenceSize();
|
|
|
|
|
2023-09-13 01:51:43 +08:00
|
|
|
static void encodeSystemMemoryFence(LinearStream &commandStream, const GraphicsAllocation *globalFenceAllocation);
|
2022-08-03 19:54:08 +08:00
|
|
|
};
|
|
|
|
|
2023-07-27 20:36:00 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
struct EnodeUserInterrupt {
|
|
|
|
static void encode(LinearStream &commandStream);
|
|
|
|
};
|
|
|
|
|
2020-01-24 21:58:15 +08:00
|
|
|
} // namespace NEO
|