|
10 | 10 |
|
11 | 11 | using Family = NEO::Gen12LpFamily;
|
12 | 12 |
|
13 |
| -#include "shared/source/command_stream/command_stream_receiver_hw_bdw_and_later.inl" |
| 13 | +#include "shared/source/command_stream/command_stream_receiver_hw_base.inl" |
14 | 14 | #include "shared/source/command_stream/command_stream_receiver_hw_heap_addressing.inl"
|
15 | 15 | #include "shared/source/command_stream/device_command_stream.h"
|
16 | 16 | #include "shared/source/gmm_helper/gmm.h"
|
| 17 | +#include "shared/source/helpers/address_patch.h" |
17 | 18 | #include "shared/source/helpers/blit_commands_helper_base.inl"
|
18 | 19 | #include "shared/source/helpers/populate_factory.h"
|
| 20 | +#include "shared/source/helpers/state_base_address_tgllp_and_later.inl" |
19 | 21 |
|
20 | 22 | namespace NEO {
|
21 | 23 | static auto gfxCore = IGFX_GEN12LP_CORE;
|
22 | 24 |
|
| 25 | +template <typename GfxFamily> |
| 26 | +bool CommandStreamReceiverHw<GfxFamily>::are4GbHeapsAvailable() const { return true; } |
| 27 | + |
| 28 | +template <typename GfxFamily> |
| 29 | +size_t CommandStreamReceiverHw<GfxFamily>::getRequiredStateBaseAddressSize(const Device &device) const { |
| 30 | + size_t size = 0; |
| 31 | + const auto &productHelper = getProductHelper(); |
| 32 | + if (productHelper.is3DPipelineSelectWARequired()) { |
| 33 | + size += (2 * PreambleHelper<GfxFamily>::getCmdSizeForPipelineSelect(peekRootDeviceEnvironment())); |
| 34 | + } |
| 35 | + size += sizeof(typename GfxFamily::STATE_BASE_ADDRESS) + sizeof(PIPE_CONTROL); |
| 36 | + return size; |
| 37 | +} |
| 38 | + |
| 39 | +template <typename GfxFamily> |
| 40 | +void CommandStreamReceiverHw<GfxFamily>::programPipelineSelect(LinearStream &commandStream, PipelineSelectArgs &pipelineSelectArgs) { |
| 41 | + if (csrSizeRequestFlags.mediaSamplerConfigChanged || csrSizeRequestFlags.systolicPipelineSelectMode || !isPreambleSent) { |
| 42 | + if (!isPipelineSelectAlreadyProgrammed()) { |
| 43 | + PreambleHelper<GfxFamily>::programPipelineSelect(&commandStream, pipelineSelectArgs, peekRootDeviceEnvironment()); |
| 44 | + } |
| 45 | + this->lastMediaSamplerConfig = pipelineSelectArgs.mediaSamplerRequired; |
| 46 | + this->lastSystolicPipelineSelectMode = pipelineSelectArgs.systolicPipelineSelectMode; |
| 47 | + this->streamProperties.pipelineSelect.setPropertiesAll(true, this->lastMediaSamplerConfig, this->lastSystolicPipelineSelectMode); |
| 48 | + this->streamProperties.pipelineSelect.clearIsDirty(); |
| 49 | + } |
| 50 | +} |
| 51 | + |
| 52 | +template <typename GfxFamily> |
| 53 | +void CommandStreamReceiverHw<GfxFamily>::createScratchSpaceController() { |
| 54 | + scratchSpaceController = std::make_unique<ScratchSpaceControllerBase>(rootDeviceIndex, executionEnvironment, *internalAllocationStorage.get()); |
| 55 | +} |
| 56 | + |
| 57 | +template <typename GfxFamily> |
| 58 | +void CommandStreamReceiverHw<GfxFamily>::programEpliogueCommands(LinearStream &csr, const DispatchFlags &dispatchFlags) { |
| 59 | + this->programEngineModeEpliogue(csr, dispatchFlags); |
| 60 | +} |
| 61 | + |
| 62 | +template <typename GfxFamily> |
| 63 | +size_t CommandStreamReceiverHw<GfxFamily>::getCmdSizeForEpilogueCommands(const DispatchFlags &dispatchFlags) const { |
| 64 | + return this->getCmdSizeForEngineMode(dispatchFlags); |
| 65 | +} |
| 66 | + |
| 67 | +template <typename GfxFamily> |
| 68 | +bool CommandStreamReceiverHw<GfxFamily>::isMultiOsContextCapable() const { |
| 69 | + return false; |
| 70 | +} |
| 71 | + |
| 72 | +template <typename GfxFamily> |
| 73 | +inline void CommandStreamReceiverHw<GfxFamily>::addPipeControlBeforeStateSip(LinearStream &commandStream, Device &device) {} |
| 74 | + |
| 75 | +template <typename GfxFamily> |
| 76 | +inline void CommandStreamReceiverHw<GfxFamily>::addPipeControlBefore3dState(LinearStream &commandStream, DispatchFlags &dispatchFlags) {} |
| 77 | + |
| 78 | +template <typename GfxFamily> |
| 79 | +bool CommandStreamReceiverHw<GfxFamily>::checkPlatformSupportsNewResourceImplicitFlush() const { |
| 80 | + return false; |
| 81 | +} |
| 82 | + |
| 83 | +template <typename GfxFamily> |
| 84 | +bool CommandStreamReceiverHw<GfxFamily>::checkPlatformSupportsGpuIdleImplicitFlush() const { |
| 85 | + return false; |
| 86 | +} |
| 87 | + |
| 88 | +template <typename GfxFamily> |
| 89 | +GraphicsAllocation *CommandStreamReceiverHw<GfxFamily>::getClearColorAllocation() { |
| 90 | + return nullptr; |
| 91 | +} |
| 92 | + |
| 93 | +template <typename GfxFamily> |
| 94 | +void CommandStreamReceiverHw<GfxFamily>::programPerDssBackedBuffer(LinearStream &commandStream, Device &device, DispatchFlags &dispatchFlags) { |
| 95 | +} |
| 96 | + |
| 97 | +template <typename GfxFamily> |
| 98 | +size_t CommandStreamReceiverHw<GfxFamily>::getCmdSizeForPerDssBackedBuffer(const HardwareInfo &hwInfo) { |
| 99 | + return 0; |
| 100 | +} |
| 101 | + |
| 102 | +template <typename GfxFamily> |
| 103 | +void CommandStreamReceiverHw<GfxFamily>::dispatchRayTracingStateCommand(LinearStream &cmdStream, Device &device) { |
| 104 | +} |
| 105 | + |
| 106 | +template <typename GfxFamily> |
| 107 | +void CommandStreamReceiverHw<GfxFamily>::collectStateBaseAddresIohPatchInfo(uint64_t commandBufferAddress, uint64_t commandOffset, const LinearStream &ioh) { |
| 108 | + using STATE_BASE_ADDRESS = typename GfxFamily::STATE_BASE_ADDRESS; |
| 109 | + |
| 110 | + PatchInfoData indirectObjectPatchInfo = {ioh.getGraphicsAllocation()->getGpuAddress(), 0u, PatchInfoAllocationType::indirectObjectHeap, commandBufferAddress, |
| 111 | + commandOffset + STATE_BASE_ADDRESS::PATCH_CONSTANTS::INDIRECTOBJECTBASEADDRESS_BYTEOFFSET, PatchInfoAllocationType::defaultType}; |
| 112 | + flatBatchBufferHelper->setPatchInfoData(indirectObjectPatchInfo); |
| 113 | +} |
| 114 | + |
| 115 | +template <typename GfxFamily> |
| 116 | +size_t CommandStreamReceiverHw<GfxFamily>::getCmdSizeForActivePartitionConfig() const { |
| 117 | + return 0; |
| 118 | +} |
| 119 | + |
| 120 | +template <typename GfxFamily> |
| 121 | +inline void CommandStreamReceiverHw<GfxFamily>::programActivePartitionConfig(LinearStream &csr) { |
| 122 | +} |
| 123 | + |
| 124 | +template <typename GfxFamily> |
| 125 | +inline size_t CommandStreamReceiverHw<GfxFamily>::getCmdSizeForStallingNoPostSyncCommands() const { |
| 126 | + return sizeof(typename GfxFamily::PIPE_CONTROL); |
| 127 | +} |
| 128 | + |
| 129 | +template <typename GfxFamily> |
| 130 | +inline size_t CommandStreamReceiverHw<GfxFamily>::getCmdSizeForStallingPostSyncCommands() const { |
| 131 | + return MemorySynchronizationCommands<GfxFamily>::getSizeForBarrierWithPostSyncOperation(peekRootDeviceEnvironment(), false); |
| 132 | +} |
| 133 | + |
| 134 | +template <typename GfxFamily> |
| 135 | +inline void CommandStreamReceiverHw<GfxFamily>::programStallingNoPostSyncCommandsForBarrier(LinearStream &cmdStream) { |
| 136 | + PipeControlArgs args; |
| 137 | + MemorySynchronizationCommands<GfxFamily>::addSingleBarrier(cmdStream, args); |
| 138 | +} |
| 139 | + |
| 140 | +template <typename GfxFamily> |
| 141 | +inline void CommandStreamReceiverHw<GfxFamily>::programStallingPostSyncCommandsForBarrier(LinearStream &cmdStream, TagNodeBase &tagNode, bool dcFlushRequired) { |
| 142 | + auto barrierTimestampPacketGpuAddress = TimestampPacketHelper::getContextEndGpuAddress(tagNode); |
| 143 | + PipeControlArgs args; |
| 144 | + args.dcFlushEnable = this->dcFlushSupport && dcFlushRequired; |
| 145 | + MemorySynchronizationCommands<GfxFamily>::addBarrierWithPostSyncOperation( |
| 146 | + cmdStream, |
| 147 | + PostSyncMode::immediateData, |
| 148 | + barrierTimestampPacketGpuAddress, |
| 149 | + 0, |
| 150 | + peekRootDeviceEnvironment(), |
| 151 | + args); |
| 152 | +} |
| 153 | + |
| 154 | +template <typename GfxFamily> |
| 155 | +inline void CommandStreamReceiverHw<GfxFamily>::configurePostSyncWriteOffset() { |
| 156 | +} |
| 157 | + |
23 | 158 | template <typename GfxFamily>
|
24 | 159 | uint64_t BlitCommandsHelper<GfxFamily>::getMaxBlitWidthOverride(const RootDeviceEnvironment &rootDeviceEnvironment) {
|
25 | 160 | return 0;
|
|
0 commit comments