2020-01-17 15:56:05 +08:00
|
|
|
/*
|
2023-01-06 00:57:56 +08:00
|
|
|
* Copyright (C) 2020-2023 Intel Corporation
|
2020-01-17 15:56:05 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/command_container/command_encoder.h"
|
|
|
|
#include "shared/source/gen9/hw_cmds_base.h"
|
2020-03-03 18:59:49 +08:00
|
|
|
#include "shared/source/gen9/reg_configs.h"
|
2020-01-17 15:56:05 +08:00
|
|
|
|
2022-07-25 23:30:11 +08:00
|
|
|
using Family = NEO::Gen9Family;
|
2020-01-17 15:56:05 +08:00
|
|
|
|
2020-07-31 14:40:52 +08:00
|
|
|
#include "shared/source/command_container/command_encoder.inl"
|
2021-08-03 19:48:35 +08:00
|
|
|
#include "shared/source/command_container/command_encoder_bdw_and_later.inl"
|
|
|
|
#include "shared/source/command_container/encode_compute_mode_bdw_and_later.inl"
|
|
|
|
#include "shared/source/command_container/image_surface_state/compression_params_bdw_and_later.inl"
|
2020-01-17 15:56:05 +08:00
|
|
|
|
2023-01-09 23:02:00 +08:00
|
|
|
#include "stream_properties.inl"
|
|
|
|
|
2020-07-31 14:40:52 +08:00
|
|
|
namespace NEO {
|
2021-01-29 18:17:10 +08:00
|
|
|
template <>
|
2023-07-18 19:48:29 +08:00
|
|
|
void EncodeSurfaceState<Family>::setAuxParamsForMCSCCS(R_SURFACE_STATE *surfaceState, const ReleaseHelper *releaseHelper) {
|
2021-01-29 18:17:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
void EncodeSurfaceState<Family>::setClearColorParams(R_SURFACE_STATE *surfaceState, Gmm *gmm) {
|
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
void EncodeSurfaceState<Family>::setFlagsForMediaCompression(R_SURFACE_STATE *surfaceState, Gmm *gmm) {
|
|
|
|
if (gmm->gmmResourceInfo->getResourceFlags()->Info.MediaCompressed) {
|
|
|
|
surfaceState->setAuxiliarySurfaceMode(Family::RENDER_SURFACE_STATE::AUXILIARY_SURFACE_MODE::AUXILIARY_SURFACE_MODE_AUX_NONE);
|
|
|
|
}
|
|
|
|
}
|
2022-03-08 22:18:31 +08:00
|
|
|
template <typename Family>
|
2023-01-23 22:08:25 +08:00
|
|
|
size_t EncodeComputeMode<Family>::getCmdSizeForComputeMode(const RootDeviceEnvironment &rootDeviceEnvironment, bool hasSharedHandles, bool isRcs) {
|
2022-03-08 22:18:31 +08:00
|
|
|
return sizeof(typename Family::PIPE_CONTROL) + sizeof(typename Family::MI_LOAD_REGISTER_IMM);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <typename Family>
|
|
|
|
void EncodeComputeMode<Family>::programComputeModeCommand(LinearStream &csr, StateComputeModeProperties &properties,
|
2023-09-13 01:51:43 +08:00
|
|
|
const RootDeviceEnvironment &rootDeviceEnvironment) {
|
2022-03-08 22:18:31 +08:00
|
|
|
using PIPE_CONTROL = typename Family::PIPE_CONTROL;
|
|
|
|
UNRECOVERABLE_IF(properties.threadArbitrationPolicy.value == ThreadArbitrationPolicy::NotPresent);
|
|
|
|
|
|
|
|
if (properties.threadArbitrationPolicy.isDirty) {
|
2022-07-21 22:28:10 +08:00
|
|
|
PipeControlArgs args;
|
|
|
|
args.csStallOnly = true;
|
|
|
|
MemorySynchronizationCommands<Family>::addSingleBarrier(csr, args);
|
2022-03-08 22:18:31 +08:00
|
|
|
|
2022-07-25 23:30:11 +08:00
|
|
|
LriHelper<Gen9Family>::program(&csr,
|
|
|
|
DebugControlReg2::address,
|
|
|
|
DebugControlReg2::getRegData(properties.threadArbitrationPolicy.value),
|
|
|
|
false);
|
2022-03-08 22:18:31 +08:00
|
|
|
}
|
|
|
|
}
|
2021-01-29 18:17:10 +08:00
|
|
|
|
2020-01-17 15:56:05 +08:00
|
|
|
template struct EncodeDispatchKernel<Family>;
|
2023-12-04 20:20:54 +08:00
|
|
|
template void EncodeDispatchKernel<Family>::encodeAdditionalWalkerFields<Family::DefaultWalkerType>(const RootDeviceEnvironment &rootDeviceEnvironment, Family::DefaultWalkerType &walkerCmd, const EncodeWalkerArgs &walkerArgs);
|
2023-12-10 03:26:30 +08:00
|
|
|
template void EncodeDispatchKernel<Family>::adjustTimestampPacket<Family::DefaultWalkerType>(Family::DefaultWalkerType &walkerCmd, const EncodeDispatchKernelArgs &args);
|
2023-12-13 19:47:42 +08:00
|
|
|
template void EncodeDispatchKernel<Family>::setupPostSyncForRegularEvent<Family::DefaultWalkerType>(Family::DefaultWalkerType &walkerCmd, const EncodeDispatchKernelArgs &args);
|
|
|
|
template void EncodeDispatchKernel<Family>::setupPostSyncForInOrderExec<Family::DefaultWalkerType>(Family::DefaultWalkerType &walkerCmd, const EncodeDispatchKernelArgs &args);
|
2023-11-23 21:58:58 +08:00
|
|
|
template void EncodeDispatchKernel<Family>::setGrfInfo<Family::INTERFACE_DESCRIPTOR_DATA>(Family::INTERFACE_DESCRIPTOR_DATA *pInterfaceDescriptor, uint32_t numGrf, const size_t &sizeCrossThreadData, const size_t &sizePerThreadData, const RootDeviceEnvironment &rootDeviceEnvironment);
|
|
|
|
template void EncodeDispatchKernel<Family>::appendAdditionalIDDFields<Family::INTERFACE_DESCRIPTOR_DATA>(Family::INTERFACE_DESCRIPTOR_DATA *pInterfaceDescriptor, const RootDeviceEnvironment &rootDeviceEnvironment, const uint32_t threadsPerThreadGroup, uint32_t slmTotalSize, SlmPolicy slmPolicy);
|
|
|
|
template void EncodeDispatchKernel<Family>::programBarrierEnable<Family::INTERFACE_DESCRIPTOR_DATA>(Family::INTERFACE_DESCRIPTOR_DATA &interfaceDescriptor, uint32_t value, const HardwareInfo &hwInfo);
|
2023-12-04 20:20:54 +08:00
|
|
|
template void EncodeDispatchKernel<Family>::adjustInterfaceDescriptorData<Family::DefaultWalkerType, Family::INTERFACE_DESCRIPTOR_DATA>(Family::INTERFACE_DESCRIPTOR_DATA &interfaceDescriptor, const Device &device, const HardwareInfo &hwInfo, const uint32_t threadGroupCount, const uint32_t numGrf, Family::DefaultWalkerType &walkerCmd);
|
|
|
|
template void EncodeDispatchKernel<Family>::setupPostSyncMocs<Family::DefaultWalkerType>(Family::DefaultWalkerType &walkerCmd, const RootDeviceEnvironment &rootDeviceEnvironment, bool dcFlush);
|
|
|
|
template void EncodeDispatchKernel<Family>::encode<Family::DefaultWalkerType>(CommandContainer &container, EncodeDispatchKernelArgs &args);
|
|
|
|
template void EncodeDispatchKernel<Family>::encodeThreadData<Family::DefaultWalkerType>(Family::DefaultWalkerType &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);
|
|
|
|
template void EncodeDispatchKernel<Family>::adjustWalkOrder<Family::DefaultWalkerType>(Family::DefaultWalkerType &walkerCmd, uint32_t requiredWorkGroupOrder, const RootDeviceEnvironment &rootDeviceEnvironment);
|
2023-11-23 21:58:58 +08:00
|
|
|
|
2023-12-21 21:16:43 +08:00
|
|
|
template void InOrderPatchCommandHelpers::PatchCmd<Family>::patchComputeWalker(uint64_t appendCounterValue);
|
|
|
|
|
2020-01-17 15:56:05 +08:00
|
|
|
template struct EncodeStates<Family>;
|
2020-02-26 02:23:04 +08:00
|
|
|
template struct EncodeMath<Family>;
|
2020-01-17 15:56:05 +08:00
|
|
|
template struct EncodeMathMMIO<Family>;
|
|
|
|
template struct EncodeIndirectParams<Family>;
|
|
|
|
template struct EncodeSetMMIO<Family>;
|
|
|
|
template struct EncodeL3State<Family>;
|
|
|
|
template struct EncodeMediaInterfaceDescriptorLoad<Family>;
|
|
|
|
template struct EncodeStateBaseAddress<Family>;
|
|
|
|
template struct EncodeStoreMMIO<Family>;
|
|
|
|
template struct EncodeSurfaceState<Family>;
|
2020-01-24 21:58:15 +08:00
|
|
|
template struct EncodeAtomic<Family>;
|
2023-03-10 21:49:06 +08:00
|
|
|
template struct EncodeSemaphore<Family>;
|
2020-01-28 20:50:19 +08:00
|
|
|
template struct EncodeBatchBufferStartOrEnd<Family>;
|
2020-02-21 22:35:08 +08:00
|
|
|
template struct EncodeMiFlushDW<Family>;
|
2022-11-08 19:05:43 +08:00
|
|
|
template struct EncodeMiPredicate<Family>;
|
2020-04-03 23:38:09 +08:00
|
|
|
template struct EncodeMemoryPrefetch<Family>;
|
2020-07-31 14:40:52 +08:00
|
|
|
template struct EncodeWA<Family>;
|
2020-11-17 01:12:08 +08:00
|
|
|
template struct EncodeMiArbCheck<Family>;
|
2021-05-18 10:46:21 +08:00
|
|
|
template struct EncodeComputeMode<Family>;
|
2021-02-27 06:02:57 +08:00
|
|
|
template struct EncodeEnableRayTracing<Family>;
|
2021-11-18 06:36:00 +08:00
|
|
|
template struct EncodeNoop<Family>;
|
2021-12-02 22:17:45 +08:00
|
|
|
template struct EncodeStoreMemory<Family>;
|
2022-04-06 22:41:45 +08:00
|
|
|
template struct EncodeMemoryFence<Family>;
|
2023-07-27 20:36:00 +08:00
|
|
|
template struct EnodeUserInterrupt<Family>;
|
2020-01-24 21:58:15 +08:00
|
|
|
} // namespace NEO
|