/* * Copyright (C) 2020-2023 Intel Corporation * * SPDX-License-Identifier: MIT * */ #include "shared/source/command_container/command_encoder.h" #include "shared/source/gen11/hw_cmds_base.h" #include "shared/source/gen11/reg_configs.h" #include "reg_configs_common.h" using Family = NEO::Gen11Family; #include "shared/source/command_container/command_encoder.inl" #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" #include "stream_properties.inl" namespace NEO { template <> bool EncodeSurfaceState::isBindingTablePrefetchPreferred() { return false; } template <> void EncodeSurfaceState::setAuxParamsForMCSCCS(R_SURFACE_STATE *surfaceState) { } template <> void EncodeSurfaceState::setClearColorParams(R_SURFACE_STATE *surfaceState, Gmm *gmm) { } template <> void EncodeSurfaceState::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); } } template size_t EncodeComputeMode::getCmdSizeForComputeMode(const RootDeviceEnvironment &rootDeviceEnvironment, bool hasSharedHandles, bool isRcs) { return sizeof(typename Family::PIPE_CONTROL) + 2u * sizeof(typename Family::MI_LOAD_REGISTER_IMM); } template <> void EncodeComputeMode::programComputeModeCommand(LinearStream &csr, StateComputeModeProperties &properties, const RootDeviceEnvironment &rootDeviceEnvironment, LogicalStateHelper *logicalStateHelper) { using PIPE_CONTROL = typename Family::PIPE_CONTROL; if (properties.threadArbitrationPolicy.isDirty) { PipeControlArgs args; args.csStallOnly = true; MemorySynchronizationCommands::addSingleBarrier(csr, args); LriHelper::program(&csr, RowChickenReg4::address, RowChickenReg4::regDataForArbitrationPolicy[properties.threadArbitrationPolicy.value], false); } if (properties.isCoherencyRequired.isDirty) { auto nonCoherentEnable = !properties.isCoherencyRequired.value; LriHelper::program(&csr, gen11HdcModeRegister::address, DwordBuilder::build(gen11HdcModeRegister::forceNonCoherentEnableBit, true, nonCoherentEnable), false); } } template struct EncodeDispatchKernel; template struct EncodeStates; template struct EncodeMath; template struct EncodeMathMMIO; template struct EncodeIndirectParams; template struct EncodeSetMMIO; template struct EncodeL3State; template struct EncodeMediaInterfaceDescriptorLoad; template struct EncodeStateBaseAddress; template struct EncodeStoreMMIO; template struct EncodeSurfaceState; template struct EncodeAtomic; template struct EncodeSempahore; template struct EncodeBatchBufferStartOrEnd; template struct EncodeMiFlushDW; template struct EncodeMiPredicate; template struct EncodeMemoryPrefetch; template struct EncodeWA; template struct EncodeMiArbCheck; template struct EncodeComputeMode; template struct EncodeEnableRayTracing; template struct EncodeNoop; template struct EncodeStoreMemory; template struct EncodeMemoryFence; template struct EncodeKernelArgsBuffer; } // namespace NEO