From 78604bd475527719c4ebd6f832a126c442c847fd Mon Sep 17 00:00:00 2001 From: Mateusz Jablonski Date: Mon, 16 Sep 2024 10:55:00 +0000 Subject: [PATCH] refactor: remove not needed code Signed-off-by: Mateusz Jablonski --- .../command_encoder_bdw_and_later.inl | 49 ------------------ ...mmand_stream_receiver_hw_bdw_and_later.inl | 14 +----- .../command_stream_receiver_hw.h | 1 - .../command_stream_receiver_hw_base.inl | 4 -- ...mmand_stream_receiver_hw_bdw_and_later.inl | 25 ---------- ...iver_simulated_common_hw_bdw_and_later.inl | 23 +-------- .../blit_commands_helper_bdw_and_later.inl | 36 ------------- .../source/helpers/gfx_core_helper_base.inl | 3 -- .../helpers/gfx_core_helper_bdw_and_later.inl | 50 ------------------- .../source/helpers/preamble_bdw_and_later.inl | 24 --------- 10 files changed, 2 insertions(+), 227 deletions(-) diff --git a/shared/source/command_container/command_encoder_bdw_and_later.inl b/shared/source/command_container/command_encoder_bdw_and_later.inl index 8c21e834fd..60dfde9feb 100644 --- a/shared/source/command_container/command_encoder_bdw_and_later.inl +++ b/shared/source/command_container/command_encoder_bdw_and_later.inl @@ -421,10 +421,6 @@ inline bool EncodeDispatchKernel::isDshNeeded(const DeviceInfo &deviceIn return true; } -template -inline void EncodeComputeMode::adjustPipelineSelect(CommandContainer &container, const NEO::KernelDescriptor &kernelDescriptor) { -} - template void EncodeStateBaseAddress::setSbaAddressesForDebugger(NEO::Debugger::SbaAddresses &sbaAddress, const STATE_BASE_ADDRESS &sbaCmd) { sbaAddress.indirectObjectBaseAddress = sbaCmd.getIndirectObjectBaseAddress(); @@ -498,56 +494,19 @@ size_t EncodeStateBaseAddress::getRequiredSizeForStateBaseAddress(Device return sizeof(typename Family::STATE_BASE_ADDRESS) + 2 * EncodeWA::getAdditionalPipelineSelectSize(device, isRcs); } -template -void EncodeL3State::encode(CommandContainer &container, bool enableSLM) { - auto offset = L3CNTLRegisterOffset::registerOffset; - auto data = PreambleHelper::getL3Config(container.getDevice()->getHardwareInfo(), enableSLM); - EncodeSetMMIO::encodeIMM(container, offset, data, false, false); -} - template void EncodeMiFlushDW::adjust(MI_FLUSH_DW *miFlushDwCmd, const ProductHelper &productHelper) {} -template -inline void EncodeWA::encodeAdditionalPipelineSelect(LinearStream &stream, const PipelineSelectArgs &args, bool is3DPipeline, - const RootDeviceEnvironment &rootDeviceEnvironment, bool isRcs) {} - -template -inline size_t EncodeWA::getAdditionalPipelineSelectSize(Device &device, bool isRcs) { - return 0; -} - template inline void EncodeWA::addPipeControlPriorToNonPipelinedStateCommand(LinearStream &commandStream, PipeControlArgs args, const RootDeviceEnvironment &rootDeviceEnvironment, bool isRcs) { MemorySynchronizationCommands::addSingleBarrier(commandStream, args); } -template -inline void EncodeWA::addPipeControlBeforeStateBaseAddress(LinearStream &commandStream, - const RootDeviceEnvironment &rootDeviceEnvironment, bool isRcs, bool dcFlushRequired) { - PipeControlArgs args; - args.dcFlushEnable = dcFlushRequired; - args.textureCacheInvalidationEnable = true; - - NEO::EncodeWA::addPipeControlPriorToNonPipelinedStateCommand(commandStream, args, rootDeviceEnvironment, isRcs); -} - template inline void EncodeWA::adjustCompressionFormatForPlanarImage(uint32_t &compressionFormat, int plane) { } -template -inline void EncodeSurfaceState::encodeExtraBufferParams(EncodeSurfaceStateArgs &args) { - auto surfaceState = reinterpret_cast(args.outMemory); - encodeExtraCacheSettings(surfaceState, args); -} - -template -bool EncodeSurfaceState::isBindingTablePrefetchPreferred() { - return true; -} - template void EncodeSurfaceState::setCoherencyType(R_SURFACE_STATE *surfaceState, COHERENCY_TYPE coherencyType) { surfaceState->setCoherencyType(coherencyType); @@ -602,14 +561,6 @@ inline void EncodeStoreMemory::programStoreDataImm(MI_STORE_DATA_IMM *cm *cmdBuffer = storeDataImmediate; } -template -inline void EncodeStoreMemory::encodeForceCompletionCheck(MI_STORE_DATA_IMM &storeDataImmCmd) { -} - -template -inline void EncodeMiArbCheck::adjust(MI_ARB_CHECK &miArbCheck, std::optional preParserDisable) { -} - template template void EncodeDispatchKernel::setupPostSyncMocs(WalkerType &walkerCmd, const RootDeviceEnvironment &rootDeviceEnvironment, bool dcFlush) {} diff --git a/shared/source/command_stream/aub_command_stream_receiver_hw_bdw_and_later.inl b/shared/source/command_stream/aub_command_stream_receiver_hw_bdw_and_later.inl index 87072a9bad..e76e5838c7 100644 --- a/shared/source/command_stream/aub_command_stream_receiver_hw_bdw_and_later.inl +++ b/shared/source/command_stream/aub_command_stream_receiver_hw_bdw_and_later.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 Intel Corporation + * Copyright (C) 2019-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -14,18 +14,6 @@ constexpr uint32_t AUBCommandStreamReceiverHw::getMaskAndValueForPoll return 0x100; } -template -void AUBCommandStreamReceiverHw::addContextToken(uint32_t dumpHandle) { - // Some simulator versions don't support adding the context token. - // This hook allows specialization for those that do. -} - -template -uint32_t AUBCommandStreamReceiverHw::getGUCWorkQueueItemHeader() { - uint32_t gucWorkQueueItemHeader = 0x00030001; - return gucWorkQueueItemHeader; -} - template int AUBCommandStreamReceiverHw::getAddressSpaceFromPTEBits(uint64_t entryBits) const { return AubMemDump::AddressSpaceValues::TraceNonlocal; diff --git a/shared/source/command_stream/command_stream_receiver_hw.h b/shared/source/command_stream/command_stream_receiver_hw.h index 850e320aba..5085bf7d6d 100644 --- a/shared/source/command_stream/command_stream_receiver_hw.h +++ b/shared/source/command_stream/command_stream_receiver_hw.h @@ -225,7 +225,6 @@ class CommandStreamReceiverHw : public CommandStreamReceiver { size_t getCmdSizeForHeaplessPrologue(Device &device) const; void handleAllocationsResidencyForHeaplessProlog(LinearStream &linearStream, Device &device); - void setClearSlmWorkAroundParameter(PipeControlArgs &args); void addPipeControlBeforeStateSip(LinearStream &commandStream, Device &device); void addPipeControlBefore3dState(LinearStream &commandStream, DispatchFlags &dispatchFlags); bool are4GbHeapsAvailable() const; diff --git a/shared/source/command_stream/command_stream_receiver_hw_base.inl b/shared/source/command_stream/command_stream_receiver_hw_base.inl index 916631be57..735a916755 100644 --- a/shared/source/command_stream/command_stream_receiver_hw_base.inl +++ b/shared/source/command_stream/command_stream_receiver_hw_base.inl @@ -945,10 +945,6 @@ void CommandStreamReceiverHw::resetKmdNotifyHelper(KmdNotifyHelper *n } } -template -void CommandStreamReceiverHw::setClearSlmWorkAroundParameter(PipeControlArgs &args) { -} - template uint64_t CommandStreamReceiverHw::getScratchPatchAddress() { return scratchSpaceController->getScratchPatchAddress(); diff --git a/shared/source/command_stream/command_stream_receiver_hw_bdw_and_later.inl b/shared/source/command_stream/command_stream_receiver_hw_bdw_and_later.inl index 39733d735a..5cc4278cd0 100644 --- a/shared/source/command_stream/command_stream_receiver_hw_bdw_and_later.inl +++ b/shared/source/command_stream/command_stream_receiver_hw_bdw_and_later.inl @@ -14,21 +14,6 @@ namespace NEO { template bool CommandStreamReceiverHw::are4GbHeapsAvailable() const { return true; } -template -inline void CommandStreamReceiverHw::programL3(LinearStream &csr, uint32_t &newL3Config, bool isBcs) { - typedef typename GfxFamily::PIPE_CONTROL PIPE_CONTROL; - if (csrSizeRequestFlags.l3ConfigChanged && this->isPreambleSent) { - // Add a PIPE_CONTROL w/ CS_stall - PipeControlArgs args = {}; - args.dcFlushEnable = true; - setClearSlmWorkAroundParameter(args); - MemorySynchronizationCommands::addSingleBarrier(csr, args); - - PreambleHelper::programL3(&csr, newL3Config, isBcs); - this->lastSentL3Config = newL3Config; - } -} - template size_t CommandStreamReceiverHw::getRequiredStateBaseAddressSize(const Device &device) const { using PIPELINE_SELECT = typename GfxFamily::PIPELINE_SELECT; @@ -42,16 +27,6 @@ size_t CommandStreamReceiverHw::getRequiredStateBaseAddressSize(const return size; } -template -inline size_t CommandStreamReceiverHw::getCmdSizeForL3Config() const { - if (!this->isPreambleSent) { - return sizeof(typename GfxFamily::MI_LOAD_REGISTER_IMM); - } else if (csrSizeRequestFlags.l3ConfigChanged) { - return sizeof(typename GfxFamily::MI_LOAD_REGISTER_IMM) + sizeof(typename GfxFamily::PIPE_CONTROL); - } - return 0; -} - template void CommandStreamReceiverHw::programPipelineSelect(LinearStream &commandStream, PipelineSelectArgs &pipelineSelectArgs) { if (csrSizeRequestFlags.mediaSamplerConfigChanged || csrSizeRequestFlags.systolicPipelineSelectMode || !isPreambleSent) { diff --git a/shared/source/command_stream/command_stream_receiver_simulated_common_hw_bdw_and_later.inl b/shared/source/command_stream/command_stream_receiver_simulated_common_hw_bdw_and_later.inl index 485cd3d42e..8f438e4c7c 100644 --- a/shared/source/command_stream/command_stream_receiver_simulated_common_hw_bdw_and_later.inl +++ b/shared/source/command_stream/command_stream_receiver_simulated_common_hw_bdw_and_later.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 Intel Corporation + * Copyright (C) 2019-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -16,17 +16,6 @@ void CommandStreamReceiverSimulatedCommonHw::initGlobalMMIO() { } } -template -uint64_t CommandStreamReceiverSimulatedCommonHw::getPPGTTAdditionalBits(GraphicsAllocation *gfxAllocation) { - return BIT(PageTableEntry::presentBit) | BIT(PageTableEntry::writableBit) | BIT(PageTableEntry::userSupervisorBit); -} - -template -void CommandStreamReceiverSimulatedCommonHw::getGTTData(void *memory, AubGTTData &data) { - data.present = true; - data.localMemory = false; -} - template uint32_t CommandStreamReceiverSimulatedCommonHw::getMemoryBankForGtt() const { return MemoryBanks::getBank(getDeviceIndex()); @@ -46,14 +35,4 @@ void CommandStreamReceiverSimulatedCommonHw::initEngineMMIO() { stream->writeMMIO(mmioPair.first, mmioPair.second); } } - -template -void CommandStreamReceiverSimulatedCommonHw::submitLRCA(const MiContextDescriptorReg &contextDescriptor) { - auto mmioBase = getCsTraits(osContext->getEngineType()).mmioBase; - stream->writeMMIO(AubMemDump::computeRegisterOffset(mmioBase, 0x2230), 0); - stream->writeMMIO(AubMemDump::computeRegisterOffset(mmioBase, 0x2230), 0); - stream->writeMMIO(AubMemDump::computeRegisterOffset(mmioBase, 0x2230), contextDescriptor.ulData[1]); - stream->writeMMIO(AubMemDump::computeRegisterOffset(mmioBase, 0x2230), contextDescriptor.ulData[0]); -} - } // namespace NEO diff --git a/shared/source/helpers/blit_commands_helper_bdw_and_later.inl b/shared/source/helpers/blit_commands_helper_bdw_and_later.inl index 60bddaba0f..89f6f13c8b 100644 --- a/shared/source/helpers/blit_commands_helper_bdw_and_later.inl +++ b/shared/source/helpers/blit_commands_helper_bdw_and_later.inl @@ -24,34 +24,6 @@ void BlitCommandsHelper::appendBlitCommandsBlockCopy(const BlitProper appendExtraMemoryProperties(blitCmd, rootDeviceEnvironment); } -template -void BlitCommandsHelper::appendBlitCommandsForImages(const BlitProperties &blitProperties, typename GfxFamily::XY_BLOCK_COPY_BLT &blitCmd, const RootDeviceEnvironment &rootDeviceEnvironment, uint32_t &srcSlicePitch, uint32_t &dstSlicePitch) { - appendTilingType(GMM_NOT_TILED, GMM_NOT_TILED, blitCmd); -} - -template -void BlitCommandsHelper::appendBlitCommandsForFillBuffer(NEO::GraphicsAllocation *dstAlloc, typename GfxFamily::XY_COLOR_BLT &blitCmd, const RootDeviceEnvironment &rootDeviceEnvironment) { - using XY_COLOR_BLT = typename GfxFamily::XY_COLOR_BLT; - if (blitCmd.getColorDepth() == XY_COLOR_BLT::COLOR_DEPTH::COLOR_DEPTH_32_BIT_COLOR) { - blitCmd.set32BppByteMask(XY_COLOR_BLT::_32BPP_BYTE_MASK::_32BPP_BYTE_MASK_WRITE_RGBA_CHANNEL); - } - appendExtraMemoryProperties(blitCmd, rootDeviceEnvironment); -} - -template -void BlitCommandsHelper::dispatchBlitMemoryColorFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, size_t patternSize, LinearStream &linearStream, size_t size, RootDeviceEnvironment &rootDeviceEnvironment) { - switch (patternSize) { - case 1: - NEO::BlitCommandsHelper::dispatchBlitMemoryFill<1>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_8_BIT_COLOR); - break; - case 2: - NEO::BlitCommandsHelper::dispatchBlitMemoryFill<2>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_16_BIT_COLOR1555); - break; - default: - NEO::BlitCommandsHelper::dispatchBlitMemoryFill<4>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_32_BIT_COLOR); - } -} - template void BlitCommandsHelper::appendSurfaceType(const BlitProperties &blitProperties, typename GfxFamily::XY_BLOCK_COPY_BLT &blitCmd) { } @@ -64,14 +36,6 @@ void BlitCommandsHelper::appendTilingEnable(typename GfxFamily::XY_CO template void BlitCommandsHelper::appendTilingType(const GMM_TILE_TYPE srcTilingType, const GMM_TILE_TYPE dstTilingType, typename GfxFamily::XY_BLOCK_COPY_BLT &blitCmd) { } -template -template -void BlitCommandsHelper::appendColorDepth(const BlitProperties &blitProperites, T &blitCmd) { -} - -template -void BlitCommandsHelper::appendSliceOffsets(const BlitProperties &blitProperties, typename GfxFamily::XY_BLOCK_COPY_BLT &blitCmd, uint32_t sliceIndex, const RootDeviceEnvironment &rootDeviceEnvironment, uint32_t srcSlicePitch, uint32_t dstSlicePitch) { -} template void BlitCommandsHelper::getBlitAllocationProperties(const GraphicsAllocation &allocation, uint32_t &pitch, uint32_t &qPitch, diff --git a/shared/source/helpers/gfx_core_helper_base.inl b/shared/source/helpers/gfx_core_helper_base.inl index 590c52299f..d355e73361 100644 --- a/shared/source/helpers/gfx_core_helper_base.inl +++ b/shared/source/helpers/gfx_core_helper_base.inl @@ -538,9 +538,6 @@ const StackVec GfxCoreHelperHw::getDeviceSubGroupSizes() c return {8, 16, 32}; } -template -void GfxCoreHelperHw::setExtraAllocationData(AllocationData &allocationData, const AllocationProperties &properties, const RootDeviceEnvironment &rootDeviceEnvironment) const {} - template bool GfxCoreHelperHw::isBankOverrideRequired(const HardwareInfo &hwInfo, const ProductHelper &productHelper) const { return false; diff --git a/shared/source/helpers/gfx_core_helper_bdw_and_later.inl b/shared/source/helpers/gfx_core_helper_bdw_and_later.inl index fa936d1e1e..6f992bb6a2 100644 --- a/shared/source/helpers/gfx_core_helper_bdw_and_later.inl +++ b/shared/source/helpers/gfx_core_helper_bdw_and_later.inl @@ -16,23 +16,11 @@ template void GfxCoreHelperHw::adjustDefaultEngineType(HardwareInfo *pHwInfo, const ProductHelper &productHelper, AILConfiguration *ailConfiguration) { } -template -uint32_t GfxCoreHelperHw::getComputeUnitsUsedForScratch(const RootDeviceEnvironment &rootDeviceEnvironment) const { - auto hwInfo = rootDeviceEnvironment.getHardwareInfo(); - return hwInfo->gtSystemInfo.MaxSubSlicesSupported * hwInfo->gtSystemInfo.MaxEuPerSubSlice * - hwInfo->gtSystemInfo.ThreadCount / hwInfo->gtSystemInfo.EUCount; -} - template inline uint32_t GfxCoreHelperHw::getGlobalTimeStampBits() const { return 36; } -template -bool GfxCoreHelperHw::isLocalMemoryEnabled(const HardwareInfo &hwInfo) const { - return false; -} - template bool GfxCoreHelperHw::hvAlign4Required() const { return true; @@ -66,33 +54,6 @@ bool GfxCoreHelperHw::makeResidentBeforeLockNeeded(bool precondition) return precondition; } -template -const EngineInstancesContainer GfxCoreHelperHw::getGpgpuEngineInstances(const RootDeviceEnvironment &rootDeviceEnvironment) const { - return { - {aub_stream::ENGINE_RCS, EngineUsage::regular}, - {aub_stream::ENGINE_RCS, EngineUsage::lowPriority}, - {aub_stream::ENGINE_RCS, EngineUsage::internal}, - }; -} - -template -EngineGroupType GfxCoreHelperHw::getEngineGroupType(aub_stream::EngineType engineType, EngineUsage engineUsage, const HardwareInfo &hwInfo) const { - switch (engineType) { - case aub_stream::ENGINE_RCS: - return EngineGroupType::renderCompute; - default: - UNRECOVERABLE_IF(true); - } -} - -template -uint32_t GfxCoreHelperHw::getMocsIndex(const GmmHelper &gmmHelper, bool l3enabled, bool l1enabled) const { - if (l3enabled) { - return gmmHelper.getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER) >> 1; - } - return gmmHelper.getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED) >> 1; -} - template uint32_t GfxCoreHelperHw::calculateAvailableThreadCount(const HardwareInfo &hwInfo, uint32_t grfCount) const { return hwInfo.gtSystemInfo.ThreadCount; @@ -119,17 +80,6 @@ template inline void MemorySynchronizationCommands::setPostSyncExtraProperties(PipeControlArgs &args) { } -template -inline void MemorySynchronizationCommands::setCacheFlushExtraProperties(PipeControlArgs &args) { -} - -template -inline void MemorySynchronizationCommands::setBarrierExtraProperties(void *barrierCmd, PipeControlArgs &args) { -} - -template -bool MemorySynchronizationCommands::isBarrierWaRequired(const RootDeviceEnvironment &rootDeviceEnvironment) { return false; } - template inline void MemorySynchronizationCommands::setBarrierWaFlags(void *barrierCmd) { reinterpret_cast(barrierCmd)->setCommandStreamerStallEnable(true); diff --git a/shared/source/helpers/preamble_bdw_and_later.inl b/shared/source/helpers/preamble_bdw_and_later.inl index a68aa41840..f564ca8288 100644 --- a/shared/source/helpers/preamble_bdw_and_later.inl +++ b/shared/source/helpers/preamble_bdw_and_later.inl @@ -8,24 +8,9 @@ #include "shared/source/command_stream/stream_properties.h" #include "shared/source/helpers/flat_batch_buffer_helper.h" #include "shared/source/helpers/preamble_base.inl" -#include "shared/source/kernel/kernel_execution_type.h" namespace NEO { -template -void PreambleHelper::programL3(LinearStream *pCommandStream, uint32_t l3Config, bool isBcs) { - LriHelper::program(pCommandStream, - L3CNTLRegisterOffset::registerOffset, - l3Config, - false, - isBcs); -} - -template -uint32_t PreambleHelper::getUrbEntryAllocationSize() { - return 0x782; -} - template void *PreambleHelper::getSpaceForVfeState(LinearStream *pCommandStream, const HardwareInfo &hwInfo, @@ -74,15 +59,6 @@ size_t PreambleHelper::getVFECommandsSize() { return sizeof(MEDIA_VFE_STATE) + sizeof(PIPE_CONTROL); } -template -void PreambleHelper::appendProgramVFEState(const RootDeviceEnvironment &rootDeviceEnvironment, const StreamProperties &streamProperties, void *cmd) {} - -template -size_t PreambleHelper::getCmdSizeForPipelineSelect(const RootDeviceEnvironment &rootDeviceEnvironment) { - using PIPELINE_SELECT = typename GfxFamily::PIPELINE_SELECT; - return sizeof(PIPELINE_SELECT); -} - template void PreambleHelper::setSingleSliceDispatchMode(void *cmd, bool enable) { }