2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2024-02-22 09:00:01 +08:00
|
|
|
* Copyright (C) 2018-2024 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2018-09-19 03:29:07 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/command_stream/command_stream_receiver.h"
|
2022-02-22 20:51:29 +08:00
|
|
|
#include "shared/source/command_stream/wait_status.h"
|
2020-03-27 03:13:10 +08:00
|
|
|
#include "shared/source/direct_submission/direct_submission_hw.h"
|
|
|
|
#include "shared/source/direct_submission/dispatchers/blitter_dispatcher.h"
|
|
|
|
#include "shared/source/direct_submission/dispatchers/render_dispatcher.h"
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/helpers/dirty_state_helpers.h"
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2023-01-18 01:04:14 +08:00
|
|
|
class TagNodeBase;
|
2017-12-21 07:45:38 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
class DeviceCommandStreamReceiver;
|
2020-04-27 03:48:59 +08:00
|
|
|
struct PipeControlArgs;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
class CommandStreamReceiverHw : public CommandStreamReceiver {
|
2023-11-23 21:58:58 +08:00
|
|
|
using MI_BATCH_BUFFER_START = typename GfxFamily::MI_BATCH_BUFFER_START;
|
|
|
|
using PIPE_CONTROL = typename GfxFamily::PIPE_CONTROL;
|
|
|
|
using STATE_BASE_ADDRESS = typename GfxFamily::STATE_BASE_ADDRESS;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2023-06-01 21:21:48 +08:00
|
|
|
struct ImmediateFlushData {
|
2023-06-05 21:29:53 +08:00
|
|
|
PipelineSelectArgs pipelineSelectArgs{};
|
2023-06-01 21:21:48 +08:00
|
|
|
size_t estimatedSize = 0;
|
2023-06-27 21:42:31 +08:00
|
|
|
void *endPtr = nullptr;
|
2023-06-28 03:54:20 +08:00
|
|
|
size_t csrStartOffset = 0;
|
2023-06-01 21:21:48 +08:00
|
|
|
|
2023-06-02 20:04:06 +08:00
|
|
|
bool pipelineSelectFullConfigurationNeeded = false;
|
2023-06-01 21:21:48 +08:00
|
|
|
bool pipelineSelectDirty = false;
|
2023-06-02 20:04:06 +08:00
|
|
|
bool frontEndFullConfigurationNeeded = false;
|
|
|
|
bool frontEndDirty = false;
|
2023-06-03 06:10:15 +08:00
|
|
|
bool stateComputeModeFullConfigurationNeeded = false;
|
|
|
|
bool stateComputeModeDirty = false;
|
2023-06-05 21:29:53 +08:00
|
|
|
bool stateBaseAddressFullConfigurationNeeded = false;
|
|
|
|
bool stateBaseAddressDirty = false;
|
2023-06-19 23:40:22 +08:00
|
|
|
bool contextOneTimeInit = false;
|
2023-06-01 21:21:48 +08:00
|
|
|
};
|
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
public:
|
2020-10-29 22:33:35 +08:00
|
|
|
static CommandStreamReceiver *create(ExecutionEnvironment &executionEnvironment,
|
|
|
|
uint32_t rootDeviceIndex,
|
|
|
|
const DeviceBitfield deviceBitfield) {
|
2020-10-28 23:08:37 +08:00
|
|
|
return new CommandStreamReceiverHw<GfxFamily>(executionEnvironment, rootDeviceIndex, deviceBitfield);
|
2017-12-21 07:45:38 +08:00
|
|
|
}
|
|
|
|
|
2020-10-29 22:33:35 +08:00
|
|
|
CommandStreamReceiverHw(ExecutionEnvironment &executionEnvironment,
|
|
|
|
uint32_t rootDeviceIndex,
|
|
|
|
const DeviceBitfield deviceBitfield);
|
2020-01-16 00:02:47 +08:00
|
|
|
~CommandStreamReceiverHw() override;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2022-01-07 22:53:31 +08:00
|
|
|
SubmissionStatus flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) override;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
CompletionStamp flushTask(LinearStream &commandStream, size_t commandStreamStart,
|
2022-03-28 20:55:12 +08:00
|
|
|
const IndirectHeap *dsh, const IndirectHeap *ioh, const IndirectHeap *ssh,
|
2022-11-22 21:53:59 +08:00
|
|
|
TaskCountType taskLevel, DispatchFlags &dispatchFlags, Device &device) override;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2024-03-08 00:50:57 +08:00
|
|
|
CompletionStamp flushTaskStateless(LinearStream &commandStream, size_t commandStreamStart,
|
|
|
|
const IndirectHeap *dsh, const IndirectHeap *ioh, const IndirectHeap *ssh,
|
|
|
|
TaskCountType taskLevel, DispatchFlags &dispatchFlags, Device &device) override;
|
|
|
|
|
|
|
|
void addPipeControlFlushTaskIfNeeded(LinearStream &commandStreamCSR, TaskCountType taskLevel);
|
|
|
|
|
2022-11-30 22:57:18 +08:00
|
|
|
CompletionStamp flushBcsTask(LinearStream &commandStreamTask, size_t commandStreamTaskStart, const DispatchBcsFlags &dispatchBcsFlags, const HardwareInfo &hwInfo) override;
|
|
|
|
|
2023-06-01 21:21:48 +08:00
|
|
|
CompletionStamp flushImmediateTask(LinearStream &immediateCommandStream, size_t immediateCommandStreamStart,
|
|
|
|
ImmediateDispatchFlags &dispatchFlags, Device &device) override;
|
|
|
|
|
2024-03-29 11:22:39 +08:00
|
|
|
CompletionStamp flushImmediateTaskStateless(LinearStream &immediateCommandStream, size_t immediateCommandStreamStart,
|
|
|
|
ImmediateDispatchFlags &dispatchFlags, Device &device) override;
|
|
|
|
|
2020-07-06 15:34:15 +08:00
|
|
|
void forcePipeControl(NEO::LinearStream &commandStreamCSR);
|
|
|
|
|
2019-11-24 21:50:41 +08:00
|
|
|
bool flushBatchedSubmissions() override;
|
2020-05-23 00:11:28 +08:00
|
|
|
void programHardwareContext(LinearStream &cmdStream) override;
|
2020-05-27 21:30:31 +08:00
|
|
|
size_t getCmdsSizeForHardwareContext() const override;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
static void addBatchBufferEnd(LinearStream &commandStream, void **patchLocation);
|
2024-09-05 05:24:17 +08:00
|
|
|
void programEndingCmd(LinearStream &commandStream, void **patchLocation, bool directSubmissionEnabled, bool hasRelaxedOrderingDependencies, bool isBcs);
|
2018-07-05 17:23:28 +08:00
|
|
|
void addBatchBufferStart(MI_BATCH_BUFFER_START *commandBufferMemory, uint64_t startAddress, bool secondary);
|
2021-07-30 17:56:58 +08:00
|
|
|
|
2021-07-08 23:08:37 +08:00
|
|
|
size_t getRequiredStateBaseAddressSize(const Device &device) const;
|
2018-08-07 15:07:50 +08:00
|
|
|
size_t getRequiredCmdStreamSize(const DispatchFlags &dispatchFlags, Device &device);
|
|
|
|
size_t getRequiredCmdStreamSizeAligned(const DispatchFlags &dispatchFlags, Device &device);
|
2022-11-30 22:57:18 +08:00
|
|
|
size_t getRequiredCmdStreamSize(const DispatchBcsFlags &dispatchBcsFlags);
|
|
|
|
size_t getRequiredCmdStreamSizeAligned(const DispatchBcsFlags &dispatchBcsFlags);
|
2024-03-08 00:50:57 +08:00
|
|
|
|
|
|
|
size_t getRequiredCmdStreamHeaplessSize(const DispatchFlags &dispatchFlags, Device &device);
|
|
|
|
size_t getRequiredCmdStreamHeaplessSizeAligned(const DispatchFlags &dispatchFlags, Device &device);
|
|
|
|
|
2018-08-16 17:18:05 +08:00
|
|
|
size_t getRequiredCmdSizeForPreamble(Device &device) const;
|
2018-04-13 17:05:09 +08:00
|
|
|
size_t getCmdSizeForPreemption(const DispatchFlags &dispatchFlags) const;
|
2019-08-08 01:33:40 +08:00
|
|
|
size_t getCmdSizeForEpilogue(const DispatchFlags &dispatchFlags) const;
|
2019-08-08 17:44:23 +08:00
|
|
|
size_t getCmdSizeForEpilogueCommands(const DispatchFlags &dispatchFlags) const;
|
2018-04-13 17:05:09 +08:00
|
|
|
size_t getCmdSizeForL3Config() const;
|
|
|
|
size_t getCmdSizeForPipelineSelect() const;
|
2018-01-19 20:29:25 +08:00
|
|
|
size_t getCmdSizeForMediaSampler(bool mediaSamplerRequired) const;
|
2019-10-11 12:54:10 +08:00
|
|
|
size_t getCmdSizeForEngineMode(const DispatchFlags &dispatchFlags) const;
|
2020-11-27 03:02:18 +08:00
|
|
|
size_t getCmdSizeForPerDssBackedBuffer(const HardwareInfo &hwInfo);
|
2021-09-24 02:13:37 +08:00
|
|
|
size_t getCmdSizeForActivePartitionConfig() const;
|
2021-11-06 09:42:54 +08:00
|
|
|
size_t getCmdSizeForStallingCommands(const DispatchFlags &dispatchFlags) const;
|
|
|
|
size_t getCmdSizeForStallingNoPostSyncCommands() const;
|
2021-12-10 03:31:27 +08:00
|
|
|
size_t getCmdSizeForStallingPostSyncCommands() const;
|
2022-03-10 01:15:48 +08:00
|
|
|
size_t getCmdSizeForComputeMode();
|
|
|
|
MOCKABLE_VIRTUAL bool hasSharedHandles();
|
2019-11-12 20:59:37 +08:00
|
|
|
|
2020-03-19 22:15:51 +08:00
|
|
|
bool isPipelineSelectAlreadyProgrammed() const;
|
2021-07-06 21:29:10 +08:00
|
|
|
void programComputeMode(LinearStream &csr, DispatchFlags &dispatchFlags, const HardwareInfo &hwInfo);
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2022-11-22 21:53:59 +08:00
|
|
|
WaitStatus waitForTaskCountWithKmdNotifyFallback(TaskCountType taskCountToWait, FlushStamp flushStampToWait, bool useQuickKmdSleep, QueueThrottle throttle) override;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2018-03-14 18:07:51 +08:00
|
|
|
void collectStateBaseAddresPatchInfo(
|
2018-04-04 17:34:46 +08:00
|
|
|
uint64_t commandBufferAddress,
|
2018-03-14 18:07:51 +08:00
|
|
|
uint64_t commandOffset,
|
2022-03-28 20:55:12 +08:00
|
|
|
const LinearStream *dsh,
|
|
|
|
const LinearStream *ioh,
|
|
|
|
const LinearStream *ssh,
|
2022-09-30 21:20:48 +08:00
|
|
|
uint64_t generalStateBase,
|
|
|
|
bool imagesSupported);
|
2018-03-14 18:07:51 +08:00
|
|
|
|
2021-09-28 18:56:22 +08:00
|
|
|
void collectStateBaseAddresIohPatchInfo(uint64_t commandBufferAddress, uint64_t commandOffset, const LinearStream &ioh);
|
|
|
|
|
2018-04-10 16:26:59 +08:00
|
|
|
void resetKmdNotifyHelper(KmdNotifyHelper *newHelper);
|
|
|
|
|
2022-11-26 00:51:17 +08:00
|
|
|
CommandStreamReceiverType getType() const override {
|
2024-04-09 20:43:12 +08:00
|
|
|
return CommandStreamReceiverType::hardware;
|
2018-06-06 16:34:51 +08:00
|
|
|
}
|
|
|
|
|
2022-11-22 21:53:59 +08:00
|
|
|
TaskCountType flushBcsTask(const BlitPropertiesContainer &blitPropertiesContainer, bool blocking, bool profilingEnabled, Device &device) override;
|
2019-04-03 21:59:31 +08:00
|
|
|
|
2022-11-09 19:18:06 +08:00
|
|
|
SubmissionStatus flushTagUpdate() override;
|
2024-05-30 01:59:00 +08:00
|
|
|
SubmissionStatus flushMiFlushDW(bool initializeProlog);
|
2023-03-28 05:37:18 +08:00
|
|
|
SubmissionStatus flushPipeControl(bool stateCacheFlush);
|
2022-11-09 19:18:06 +08:00
|
|
|
SubmissionStatus flushSmallTask(LinearStream &commandStreamTask,
|
|
|
|
size_t commandStreamStartTask);
|
2024-09-23 20:46:37 +08:00
|
|
|
MOCKABLE_VIRTUAL SubmissionStatus flushHandler(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency);
|
2023-03-28 05:37:18 +08:00
|
|
|
SubmissionStatus sendRenderStateCacheFlush() override;
|
2021-02-23 16:48:08 +08:00
|
|
|
|
2023-03-27 17:06:13 +08:00
|
|
|
bool isUpdateTagFromWaitEnabled() override;
|
2021-02-23 16:48:08 +08:00
|
|
|
void updateTagFromWait() override;
|
|
|
|
|
2019-09-12 23:30:13 +08:00
|
|
|
bool isMultiOsContextCapable() const override;
|
|
|
|
|
2023-01-04 17:45:07 +08:00
|
|
|
MemoryCompressionState getMemoryCompressionState(bool auxTranslationRequired) const override;
|
2020-12-17 08:36:45 +08:00
|
|
|
|
2020-01-16 00:02:47 +08:00
|
|
|
bool isDirectSubmissionEnabled() const override {
|
|
|
|
return directSubmission.get() != nullptr;
|
|
|
|
}
|
|
|
|
|
2020-03-27 03:13:10 +08:00
|
|
|
bool isBlitterDirectSubmissionEnabled() const override {
|
|
|
|
return blitterDirectSubmission.get() != nullptr;
|
|
|
|
}
|
|
|
|
|
2022-11-21 22:55:39 +08:00
|
|
|
bool directSubmissionRelaxedOrderingEnabled() const override;
|
2024-12-09 17:55:26 +08:00
|
|
|
uint32_t getDirectSubmissionRelaxedOrderingQueueDepth() const override;
|
2022-11-21 22:55:39 +08:00
|
|
|
|
2023-07-05 16:55:12 +08:00
|
|
|
void stopDirectSubmission(bool blocking) override;
|
2021-07-30 17:56:58 +08:00
|
|
|
|
2024-03-22 19:18:35 +08:00
|
|
|
QueueThrottle getLastDirectSubmissionThrottle() override;
|
|
|
|
|
2021-06-15 19:31:12 +08:00
|
|
|
virtual bool isKmdWaitModeActive() { return true; }
|
2021-02-17 18:33:41 +08:00
|
|
|
|
2022-04-19 22:44:06 +08:00
|
|
|
bool initDirectSubmission() override;
|
2020-11-19 07:58:42 +08:00
|
|
|
GraphicsAllocation *getClearColorAllocation() override;
|
2020-07-17 17:28:59 +08:00
|
|
|
|
2021-03-29 22:46:41 +08:00
|
|
|
TagAllocatorBase *getTimestampPacketAllocator() override;
|
2024-12-17 20:00:36 +08:00
|
|
|
std::unique_ptr<TagAllocatorBase> createMultiRootDeviceTimestampPacketAllocator(const RootDeviceIndicesContainer &rootDeviceIndices) override;
|
2021-03-29 22:46:41 +08:00
|
|
|
|
2021-05-20 05:41:59 +08:00
|
|
|
void postInitFlagsSetup() override;
|
2021-11-18 03:51:43 +08:00
|
|
|
void programActivePartitionConfig(LinearStream &csr);
|
2021-05-20 05:41:59 +08:00
|
|
|
|
2021-12-11 05:31:34 +08:00
|
|
|
void programComputeBarrierCommand(LinearStream &cmdStream) override {
|
|
|
|
programStallingNoPostSyncCommandsForBarrier(cmdStream);
|
|
|
|
}
|
|
|
|
size_t getCmdsSizeForComputeBarrierCommand() const override {
|
|
|
|
return getCmdSizeForStallingNoPostSyncCommands();
|
|
|
|
}
|
2023-09-12 22:17:52 +08:00
|
|
|
void programStallingCommandsForBarrier(LinearStream &cmdStream, TimestampPacketContainer *barrierTimestampPacketNodes, const bool isDcFlushRequired) override;
|
2024-03-08 00:50:57 +08:00
|
|
|
SubmissionStatus initializeDeviceWithFirstSubmission(Device &device) override;
|
2021-12-11 05:31:34 +08:00
|
|
|
|
2022-09-28 07:51:57 +08:00
|
|
|
HeapDirtyState &getDshState() {
|
|
|
|
return dshState;
|
|
|
|
}
|
2022-09-27 06:28:10 +08:00
|
|
|
HeapDirtyState &getSshState() {
|
|
|
|
return sshState;
|
2023-03-01 03:46:30 +08:00
|
|
|
}
|
|
|
|
HeapDirtyState &getIohState() {
|
|
|
|
return iohState;
|
2022-09-27 06:28:10 +08:00
|
|
|
}
|
|
|
|
|
2023-03-31 04:03:12 +08:00
|
|
|
void dispatchRayTracingStateCommand(LinearStream &cmdStream, Device &device);
|
2023-11-23 21:58:58 +08:00
|
|
|
uint64_t getScratchPatchAddress();
|
2023-03-31 04:03:12 +08:00
|
|
|
|
2024-03-08 00:50:57 +08:00
|
|
|
SubmissionStatus programHeaplessProlog(Device &device);
|
2024-09-03 17:38:57 +08:00
|
|
|
MOCKABLE_VIRTUAL void programHeaplessStateProlog(Device &device, LinearStream &commandStream);
|
2024-03-08 00:50:57 +08:00
|
|
|
void programStateBaseAddressHeapless(Device &device, LinearStream &commandStream);
|
|
|
|
void programComputeModeHeapless(Device &device, LinearStream &commandStream);
|
2024-06-20 19:56:15 +08:00
|
|
|
void handleAllocationsResidencyForflushTaskStateless(const IndirectHeap *dsh, const IndirectHeap *ioh, const IndirectHeap *ssh, Device &device);
|
2024-05-09 19:17:06 +08:00
|
|
|
bool submitDependencyUpdate(TagNodeBase *tag) override;
|
2024-03-08 00:50:57 +08:00
|
|
|
|
2024-08-07 00:13:06 +08:00
|
|
|
void unblockPagingFenceSemaphore(uint64_t pagingFenceValue) override;
|
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
protected:
|
2019-07-31 14:57:00 +08:00
|
|
|
void programPreemption(LinearStream &csr, DispatchFlags &dispatchFlags);
|
2024-04-19 22:20:27 +08:00
|
|
|
void programL3(LinearStream &csr, uint32_t &newL3Config, bool isBcs);
|
2021-11-04 20:54:18 +08:00
|
|
|
void programPreamble(LinearStream &csr, Device &device, uint32_t &newL3Config);
|
2019-09-10 22:13:11 +08:00
|
|
|
void programPipelineSelect(LinearStream &csr, PipelineSelectArgs &pipelineSelectArgs);
|
2021-01-29 01:30:56 +08:00
|
|
|
void programEpilogue(LinearStream &csr, Device &device, void **batchBufferEndLocation, DispatchFlags &dispatchFlags);
|
2019-08-08 17:44:23 +08:00
|
|
|
void programEpliogueCommands(LinearStream &csr, const DispatchFlags &dispatchFlags);
|
2018-01-19 20:29:25 +08:00
|
|
|
void programMediaSampler(LinearStream &csr, DispatchFlags &dispatchFlags);
|
2020-11-27 03:02:18 +08:00
|
|
|
void programPerDssBackedBuffer(LinearStream &scr, Device &device, DispatchFlags &dispatchFlags);
|
2018-11-05 18:52:19 +08:00
|
|
|
void programStateSip(LinearStream &cmdStream, Device &device);
|
2019-05-29 21:37:54 +08:00
|
|
|
void programVFEState(LinearStream &csr, DispatchFlags &dispatchFlags, uint32_t maxFrontEndThreads);
|
2021-11-06 09:42:54 +08:00
|
|
|
void programStallingNoPostSyncCommandsForBarrier(LinearStream &cmdStream);
|
2023-07-13 17:26:41 +08:00
|
|
|
void programStallingPostSyncCommandsForBarrier(LinearStream &cmdStream, TagNodeBase &tagNode, bool dcFlushRequired);
|
2019-10-11 12:54:10 +08:00
|
|
|
void programEngineModeCommands(LinearStream &csr, const DispatchFlags &dispatchFlags);
|
|
|
|
void programEngineModeEpliogue(LinearStream &csr, const DispatchFlags &dispatchFlags);
|
2021-11-18 03:51:43 +08:00
|
|
|
void programActivePartitionConfigFlushTask(LinearStream &csr);
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2020-02-07 22:36:15 +08:00
|
|
|
void programEnginePrologue(LinearStream &csr);
|
2020-05-27 21:30:31 +08:00
|
|
|
size_t getCmdSizeForPrologue() const;
|
2024-03-08 00:50:57 +08:00
|
|
|
size_t getCmdSizeForHeaplessPrologue(Device &device) const;
|
|
|
|
void handleAllocationsResidencyForHeaplessProlog(LinearStream &linearStream, Device &device);
|
2020-01-31 15:50:12 +08:00
|
|
|
|
2021-10-01 19:47:49 +08:00
|
|
|
void addPipeControlBeforeStateSip(LinearStream &commandStream, Device &device);
|
2021-09-30 19:10:58 +08:00
|
|
|
void addPipeControlBefore3dState(LinearStream &commandStream, DispatchFlags &dispatchFlags);
|
2021-04-01 04:21:59 +08:00
|
|
|
bool are4GbHeapsAvailable() const;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2019-03-29 07:49:23 +08:00
|
|
|
void createScratchSpaceController();
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2019-01-28 20:44:59 +08:00
|
|
|
bool detectInitProgrammingFlagsRequired(const DispatchFlags &dispatchFlags) const;
|
2020-09-22 22:29:34 +08:00
|
|
|
bool checkPlatformSupportsNewResourceImplicitFlush() const;
|
|
|
|
bool checkPlatformSupportsGpuIdleImplicitFlush() const;
|
2021-11-30 22:41:26 +08:00
|
|
|
void configurePostSyncWriteOffset();
|
2022-03-25 21:00:53 +08:00
|
|
|
void unregisterDirectSubmissionFromController();
|
2023-02-03 02:57:24 +08:00
|
|
|
void handleFrontEndStateTransition(const DispatchFlags &dispatchFlags);
|
|
|
|
void handlePipelineSelectStateTransition(const DispatchFlags &dispatchFlags);
|
|
|
|
void handleStateBaseAddressStateTransition(const DispatchFlags &dispatchFlags, bool &isStateBaseAddressDirty);
|
2023-03-15 23:10:06 +08:00
|
|
|
void updateStreamTaskCount(LinearStream &stream, TaskCountType newTaskCount);
|
2023-05-15 22:41:44 +08:00
|
|
|
inline void programStateBaseAddress(const IndirectHeap *dsh,
|
|
|
|
const IndirectHeap *ioh,
|
|
|
|
const IndirectHeap *ssh,
|
|
|
|
DispatchFlags &dispatchFlags,
|
|
|
|
Device &device, LinearStream &commandStreamCSR,
|
|
|
|
bool stateBaseAddressDirty);
|
|
|
|
|
|
|
|
inline void reprogramStateBaseAddress(const IndirectHeap *dsh,
|
|
|
|
const IndirectHeap *ioh,
|
|
|
|
const IndirectHeap *ssh,
|
|
|
|
DispatchFlags &dispatchFlags,
|
|
|
|
Device &device, LinearStream &commandStreamCSR,
|
|
|
|
bool force32BitAllocations, bool sshDirty, bool bindingTablePoolCommandNeeded);
|
2023-06-05 21:29:53 +08:00
|
|
|
inline void programStateBaseAddressCommon(const IndirectHeap *dsh,
|
|
|
|
const IndirectHeap *ioh,
|
|
|
|
const IndirectHeap *ssh,
|
|
|
|
StateBaseAddressProperties *sbaProperties,
|
|
|
|
uint64_t generalStateBaseAddress,
|
|
|
|
uint64_t indirectObjectStateBaseAddress,
|
|
|
|
PipelineSelectArgs &pipelineSelectArgs,
|
|
|
|
Device &device,
|
|
|
|
LinearStream &csrCommandStream,
|
|
|
|
bool dispatchBindingTableCommand,
|
2023-07-01 03:57:19 +08:00
|
|
|
bool areMultipleSubDevicesInContext,
|
|
|
|
bool setGeneralStateBaseAddress);
|
2023-05-15 22:41:44 +08:00
|
|
|
|
2024-02-23 12:57:45 +08:00
|
|
|
inline void processBarrierWithPostSync(LinearStream &commandStreamTask,
|
|
|
|
DispatchFlags &dispatchFlags,
|
|
|
|
bool &levelClosed,
|
|
|
|
void *¤tPipeControlForNooping,
|
|
|
|
void *&epiloguePipeControlLocation,
|
|
|
|
bool &hasStallingCmdsOnTaskStream,
|
|
|
|
PipeControlArgs &args);
|
|
|
|
|
2024-02-23 22:49:07 +08:00
|
|
|
inline CompletionStamp handleFlushTaskSubmission(BatchBuffer &&batchBuffer,
|
|
|
|
const DispatchFlags &dispatchFlags,
|
|
|
|
Device &device,
|
|
|
|
void *currentPipeControlForNooping,
|
|
|
|
void *epiloguePipeControlLocation,
|
|
|
|
PipeControlArgs &args,
|
|
|
|
bool submitTask,
|
|
|
|
bool submitCSR,
|
|
|
|
bool hasStallingCmdsOnTaskStream,
|
|
|
|
bool levelClosed,
|
|
|
|
bool implicitFlush);
|
|
|
|
|
2024-02-22 10:33:09 +08:00
|
|
|
inline CompletionStamp updateTaskCountAndGetCompletionStamp(bool levelClosed);
|
2023-05-15 22:41:44 +08:00
|
|
|
inline void programSamplerCacheFlushBetweenRedescribedSurfaceReads(LinearStream &commandStreamCSR);
|
2023-03-14 01:56:20 +08:00
|
|
|
bool bcsRelaxedOrderingAllowed(const BlitPropertiesContainer &blitPropertiesContainer, bool hasStallingCmds) const;
|
2023-06-02 20:04:06 +08:00
|
|
|
inline void handleImmediateFlushPipelineSelectState(ImmediateDispatchFlags &dispatchFlags, ImmediateFlushData &flushData);
|
2023-06-03 06:10:15 +08:00
|
|
|
inline void dispatchImmediateFlushPipelineSelectCommand(ImmediateFlushData &flushData, LinearStream &csrStream);
|
2023-06-02 20:04:06 +08:00
|
|
|
inline void handleImmediateFlushFrontEndState(ImmediateDispatchFlags &dispatchFlags, ImmediateFlushData &flushData);
|
2023-07-01 03:57:19 +08:00
|
|
|
inline void dispatchImmediateFlushFrontEndCommand(ImmediateFlushData &flushData, Device &device, LinearStream &csrStream);
|
2023-06-03 06:10:15 +08:00
|
|
|
inline void handleImmediateFlushStateComputeModeState(ImmediateDispatchFlags &dispatchFlags, ImmediateFlushData &flushData);
|
|
|
|
inline void dispatchImmediateFlushStateComputeModeCommand(ImmediateFlushData &flushData, LinearStream &csrStream);
|
2023-06-05 21:29:53 +08:00
|
|
|
inline void handleImmediateFlushStateBaseAddressState(ImmediateDispatchFlags &dispatchFlags, ImmediateFlushData &flushData, Device &device);
|
|
|
|
inline void dispatchImmediateFlushStateBaseAddressCommand(ImmediateFlushData &flushData, LinearStream &csrStream, Device &device);
|
2023-03-14 01:56:20 +08:00
|
|
|
|
2023-06-20 22:57:40 +08:00
|
|
|
inline void handleImmediateFlushOneTimeContextInitState(ImmediateDispatchFlags &dispatchFlags, ImmediateFlushData &flushData, Device &device);
|
|
|
|
inline void dispatchImmediateFlushOneTimeContextInitCommand(ImmediateFlushData &flushData, LinearStream &csrStream, Device &device);
|
2023-06-19 23:40:22 +08:00
|
|
|
|
2023-06-22 21:17:49 +08:00
|
|
|
inline void handleImmediateFlushJumpToImmediate(ImmediateFlushData &flushData);
|
|
|
|
inline void dispatchImmediateFlushJumpToImmediateCommand(LinearStream &immediateCommandStream,
|
|
|
|
size_t immediateCommandStreamStart,
|
|
|
|
ImmediateFlushData &flushData,
|
|
|
|
LinearStream &csrStream);
|
2023-06-27 21:42:31 +08:00
|
|
|
inline void dispatchImmediateFlushClientBufferCommands(ImmediateDispatchFlags &dispatchFlags,
|
|
|
|
LinearStream &immediateCommandStream,
|
|
|
|
ImmediateFlushData &flushData);
|
2023-06-22 21:17:49 +08:00
|
|
|
|
2024-03-29 11:22:39 +08:00
|
|
|
void handleImmediateFlushStatelessAllocationsResidency(size_t csrEstimatedSize,
|
2024-06-20 19:56:15 +08:00
|
|
|
LinearStream &csrStream,
|
|
|
|
Device &device);
|
2024-03-29 11:22:39 +08:00
|
|
|
|
2023-06-28 03:54:20 +08:00
|
|
|
inline void handleImmediateFlushAllocationsResidency(Device &device,
|
|
|
|
LinearStream &immediateCommandStream,
|
|
|
|
ImmediateFlushData &flushData,
|
|
|
|
LinearStream &csrStream);
|
|
|
|
|
|
|
|
inline CompletionStamp handleImmediateFlushSendBatchBuffer(LinearStream &immediateCommandStream,
|
|
|
|
size_t immediateCommandStreamStart,
|
|
|
|
ImmediateDispatchFlags &dispatchFlags,
|
|
|
|
ImmediateFlushData &flushData,
|
|
|
|
LinearStream &csrStream);
|
2023-06-19 23:40:22 +08:00
|
|
|
|
2024-02-22 09:00:01 +08:00
|
|
|
inline void handleBatchedDispatchImplicitFlush(uint64_t globalMemorySize, bool implicitFlush);
|
|
|
|
|
2024-02-23 12:13:19 +08:00
|
|
|
inline BatchBuffer prepareBatchBufferForSubmission(LinearStream &commandStreamTask,
|
|
|
|
size_t commandStreamStartTask,
|
|
|
|
LinearStream &commandStreamCSR,
|
|
|
|
size_t commandStreamStartCSR,
|
|
|
|
DispatchFlags &dispatchFlags,
|
|
|
|
Device &device,
|
|
|
|
bool submitTask,
|
|
|
|
bool submitCSR,
|
|
|
|
bool hasStallingCmdsOnTaskStream);
|
|
|
|
|
|
|
|
inline void chainCsrWorkToTask(LinearStream &commandStreamCSR,
|
|
|
|
LinearStream &commandStreamTask,
|
|
|
|
size_t commandStreamStartTask,
|
|
|
|
void *bbEndLocation,
|
|
|
|
size_t &chainedBatchBufferStartOffset,
|
|
|
|
GraphicsAllocation *&chainedBatchBuffer);
|
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
HeapDirtyState dshState;
|
|
|
|
HeapDirtyState iohState;
|
|
|
|
HeapDirtyState sshState;
|
|
|
|
|
|
|
|
CsrSizeRequestFlags csrSizeRequestFlags = {};
|
2020-01-16 00:02:47 +08:00
|
|
|
|
2020-11-18 21:56:18 +08:00
|
|
|
bool wasSubmittedToSingleSubdevice = false;
|
|
|
|
|
2020-03-27 03:13:10 +08:00
|
|
|
std::unique_ptr<DirectSubmissionHw<GfxFamily, RenderDispatcher<GfxFamily>>> directSubmission;
|
|
|
|
std::unique_ptr<DirectSubmissionHw<GfxFamily, BlitterDispatcher<GfxFamily>>> blitterDirectSubmission;
|
2021-04-13 04:19:19 +08:00
|
|
|
|
|
|
|
size_t cmdStreamStart = 0;
|
2022-07-01 19:10:43 +08:00
|
|
|
uint32_t latestSentBcsWaValue = std::numeric_limits<uint32_t>::max();
|
2017-12-21 07:45:38 +08:00
|
|
|
};
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|