2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2024-01-19 20:38:56 +08:00
|
|
|
* Copyright (C) 2018-2024 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2018-09-20 11:54:29 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2023-01-25 23:26:00 +08:00
|
|
|
#include "shared/source/command_stream/csr_definitions.h"
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/command_stream/linear_stream.h"
|
2021-08-27 23:23:29 +08:00
|
|
|
#include "shared/source/command_stream/stream_properties.h"
|
2024-05-27 17:27:22 +08:00
|
|
|
#include "shared/source/gmm_helper/cache_settings_helper.h"
|
2023-01-18 01:04:14 +08:00
|
|
|
#include "shared/source/helpers/blit_properties_container.h"
|
2023-02-25 00:55:21 +08:00
|
|
|
#include "shared/source/helpers/cache_policy.h"
|
2023-09-04 17:42:02 +08:00
|
|
|
#include "shared/source/helpers/common_types.h"
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/helpers/completion_stamp.h"
|
2024-03-22 19:18:35 +08:00
|
|
|
#include "shared/source/helpers/kmd_notify_properties.h"
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/helpers/options.h"
|
2024-05-07 03:17:52 +08:00
|
|
|
#include "shared/source/memory_manager/graphics_allocation.h"
|
2020-11-06 20:01:29 +08:00
|
|
|
#include "shared/source/utilities/spinlock.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
|
2023-11-27 21:47:52 +08:00
|
|
|
#include "aubstream/allocation_params.h"
|
|
|
|
|
2023-01-18 01:04:14 +08:00
|
|
|
#include <atomic>
|
2017-12-21 07:45:38 +08:00
|
|
|
#include <cstddef>
|
|
|
|
#include <cstdint>
|
2023-01-18 01:04:14 +08:00
|
|
|
#include <functional>
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2023-02-17 00:51:55 +08:00
|
|
|
|
2023-11-17 20:14:15 +08:00
|
|
|
enum class AllocationType;
|
2023-01-24 23:33:52 +08:00
|
|
|
enum class DebugPauseState : uint32_t;
|
2023-01-18 01:04:14 +08:00
|
|
|
struct BatchBuffer;
|
2023-02-17 00:51:55 +08:00
|
|
|
struct HardwareInfo;
|
2023-01-18 01:04:14 +08:00
|
|
|
struct WaitParams;
|
|
|
|
class SubmissionAggregator;
|
|
|
|
class FlushStampTracker;
|
2022-12-22 19:31:28 +08:00
|
|
|
class Thread;
|
|
|
|
class FlatBatchBufferHelper;
|
2018-10-29 20:26:58 +08:00
|
|
|
class AllocationsList;
|
2017-12-21 07:45:38 +08:00
|
|
|
class Device;
|
2018-10-22 21:17:32 +08:00
|
|
|
class ExecutionEnvironment;
|
2018-07-05 17:23:28 +08:00
|
|
|
class ExperimentalCommandBuffer;
|
2018-10-22 21:17:32 +08:00
|
|
|
class GmmPageTableMngr;
|
2018-07-05 17:23:28 +08:00
|
|
|
class GraphicsAllocation;
|
2018-10-29 17:38:53 +08:00
|
|
|
class HostPtrSurface;
|
2018-04-17 19:50:50 +08:00
|
|
|
class IndirectHeap;
|
2018-10-22 21:17:32 +08:00
|
|
|
class InternalAllocationStorage;
|
2018-07-05 17:23:28 +08:00
|
|
|
class LinearStream;
|
2017-12-21 07:45:38 +08:00
|
|
|
class MemoryManager;
|
2021-02-25 16:38:48 +08:00
|
|
|
class MultiGraphicsAllocation;
|
2018-08-27 21:48:29 +08:00
|
|
|
class OsContext;
|
2018-10-22 21:17:32 +08:00
|
|
|
class OSInterface;
|
2018-11-22 22:16:20 +08:00
|
|
|
class ScratchSpaceController;
|
2021-03-25 02:21:13 +08:00
|
|
|
class HwPerfCounter;
|
|
|
|
class HwTimeStamps;
|
2022-07-24 12:21:16 +08:00
|
|
|
class GmmHelper;
|
2021-03-25 02:21:13 +08:00
|
|
|
class TagAllocatorBase;
|
2022-11-10 17:37:42 +08:00
|
|
|
class KmdNotifyHelper;
|
2022-12-09 22:37:32 +08:00
|
|
|
class GfxCoreHelper;
|
2022-12-15 20:13:57 +08:00
|
|
|
class ProductHelper;
|
2023-05-12 22:49:39 +08:00
|
|
|
class ReleaseHelper;
|
2023-01-18 01:04:14 +08:00
|
|
|
enum class WaitStatus;
|
|
|
|
struct AubSubCaptureStatus;
|
2020-09-15 15:33:12 +08:00
|
|
|
|
2023-09-25 15:45:36 +08:00
|
|
|
template <typename TSize, uint32_t packetCount>
|
2021-03-22 23:14:49 +08:00
|
|
|
class TimestampPackets;
|
2018-11-27 20:07:41 +08:00
|
|
|
|
|
|
|
template <typename T1>
|
|
|
|
class TagAllocator;
|
2024-05-09 19:17:06 +08:00
|
|
|
class TagNodeBase;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2018-04-04 17:34:46 +08:00
|
|
|
enum class DispatchMode {
|
2023-12-13 17:17:24 +08:00
|
|
|
deviceDefault = 0, // default for given device
|
|
|
|
immediateDispatch, // everything is submitted to the HW immediately
|
|
|
|
adaptiveDispatch, // dispatching is handled to async thread, which combines batch buffers basing on load (not implemented)
|
|
|
|
batchedDispatchWithCounter, // dispatching is batched, after n commands there is implicit flush (not implemented)
|
|
|
|
batchedDispatch // dispatching is batched, explicit clFlush is required
|
2018-04-04 17:34:46 +08:00
|
|
|
};
|
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
class CommandStreamReceiver {
|
|
|
|
public:
|
2022-04-06 21:59:23 +08:00
|
|
|
static constexpr size_t startingResidencyContainerSize = 128;
|
|
|
|
|
2018-01-10 21:05:34 +08:00
|
|
|
enum class SamplerCacheFlushState {
|
|
|
|
samplerCacheFlushNotRequired,
|
2022-07-24 12:21:16 +08:00
|
|
|
samplerCacheFlushBefore, // add sampler cache flush before Walker with redescribed image
|
|
|
|
samplerCacheFlushAfter // add sampler cache flush after Walker with redescribed image
|
2018-01-10 21:05:34 +08:00
|
|
|
};
|
2020-04-30 23:12:01 +08:00
|
|
|
|
2018-08-06 20:55:04 +08:00
|
|
|
using MutexType = std::recursive_mutex;
|
2022-09-19 18:20:14 +08:00
|
|
|
using TimeType = std::chrono::high_resolution_clock::time_point;
|
2020-10-29 22:33:35 +08:00
|
|
|
CommandStreamReceiver(ExecutionEnvironment &executionEnvironment,
|
|
|
|
uint32_t rootDeviceIndex,
|
|
|
|
const DeviceBitfield deviceBitfield);
|
2024-06-27 18:27:42 +08:00
|
|
|
CommandStreamReceiver(const CommandStreamReceiver &) = delete;
|
|
|
|
CommandStreamReceiver &operator=(const CommandStreamReceiver &) = delete;
|
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
virtual ~CommandStreamReceiver();
|
|
|
|
|
2022-01-07 22:53:31 +08:00
|
|
|
virtual SubmissionStatus flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) = 0;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2022-11-30 22:57:18 +08:00
|
|
|
virtual CompletionStamp flushTask(LinearStream &commandStreamTask, size_t commandStreamTaskStart,
|
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) = 0;
|
2024-03-08 00:50:57 +08:00
|
|
|
|
|
|
|
virtual CompletionStamp flushTaskStateless(LinearStream &commandStreamTask, size_t commandStreamTaskStart,
|
|
|
|
const IndirectHeap *dsh, const IndirectHeap *ioh, const IndirectHeap *ssh,
|
|
|
|
TaskCountType taskLevel, DispatchFlags &dispatchFlags, Device &device) = 0;
|
|
|
|
|
2022-11-30 22:57:18 +08:00
|
|
|
virtual CompletionStamp flushBcsTask(LinearStream &commandStream, size_t commandStreamStart, const DispatchBcsFlags &dispatchBcsFlags, const HardwareInfo &hwInfo) = 0;
|
2023-06-01 21:21:48 +08:00
|
|
|
virtual CompletionStamp flushImmediateTask(LinearStream &immediateCommandStream, size_t immediateCommandStreamStart,
|
|
|
|
ImmediateDispatchFlags &dispatchFlags, Device &device) = 0;
|
2024-03-29 11:22:39 +08:00
|
|
|
|
|
|
|
virtual CompletionStamp flushImmediateTaskStateless(LinearStream &immediateCommandStream, size_t immediateCommandStreamStart,
|
|
|
|
ImmediateDispatchFlags &dispatchFlags, Device &device) = 0;
|
2023-03-28 05:37:18 +08:00
|
|
|
virtual SubmissionStatus sendRenderStateCacheFlush() = 0;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2019-11-24 21:50:41 +08:00
|
|
|
virtual bool flushBatchedSubmissions() = 0;
|
2022-01-07 22:53:31 +08:00
|
|
|
MOCKABLE_VIRTUAL SubmissionStatus submitBatchBuffer(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency);
|
2024-11-20 20:36:45 +08:00
|
|
|
void pollForCompletion() { pollForCompletion(false); }
|
|
|
|
virtual void pollForAubCompletion(){};
|
|
|
|
virtual void pollForCompletion(bool skipTaskCountCheck) {}
|
2020-05-23 00:11:28 +08:00
|
|
|
virtual void programHardwareContext(LinearStream &cmdStream) = 0;
|
2020-05-27 21:30:31 +08:00
|
|
|
virtual size_t getCmdsSizeForHardwareContext() const = 0;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2021-05-15 00:46:50 +08:00
|
|
|
void makeResident(MultiGraphicsAllocation &gfxAllocation);
|
2019-12-04 01:22:29 +08:00
|
|
|
MOCKABLE_VIRTUAL void makeResident(GraphicsAllocation &gfxAllocation);
|
2017-12-21 07:45:38 +08:00
|
|
|
virtual void makeNonResident(GraphicsAllocation &gfxAllocation);
|
2022-05-27 11:58:07 +08:00
|
|
|
MOCKABLE_VIRTUAL void makeSurfacePackNonResident(ResidencyContainer &allocationsForResidency, bool clearAllocations);
|
2024-08-22 18:25:49 +08:00
|
|
|
virtual SubmissionStatus processResidency(ResidencyContainer &allocationsForResidency, uint32_t handleId);
|
2018-11-26 21:04:52 +08:00
|
|
|
virtual void processEviction();
|
2018-02-09 05:52:58 +08:00
|
|
|
void makeResidentHostPtrAllocation(GraphicsAllocation *gfxAllocation);
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2020-09-30 22:58:20 +08:00
|
|
|
MOCKABLE_VIRTUAL void ensureCommandBufferAllocation(LinearStream &commandStream, size_t minimumRequiredSize, size_t additionalAllocationSize);
|
2019-02-20 17:31:32 +08:00
|
|
|
|
2018-10-11 17:19:49 +08:00
|
|
|
MemoryManager *getMemoryManager() const;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2018-09-11 17:19:21 +08:00
|
|
|
ResidencyContainer &getResidencyAllocations();
|
2018-09-12 16:44:35 +08:00
|
|
|
ResidencyContainer &getEvictionAllocations();
|
2023-09-04 17:42:02 +08:00
|
|
|
PrivateAllocsToReuseContainer &getOwnedPrivateAllocations();
|
2018-09-11 17:19:21 +08:00
|
|
|
|
2018-08-17 19:38:09 +08:00
|
|
|
virtual GmmPageTableMngr *createPageTableManager() { return nullptr; }
|
2021-10-06 20:42:30 +08:00
|
|
|
bool needsPageTableManager() const;
|
2018-08-17 19:38:09 +08:00
|
|
|
|
2022-11-22 21:53:59 +08:00
|
|
|
MOCKABLE_VIRTUAL WaitStatus waitForTaskCount(TaskCountType requiredTaskCount);
|
|
|
|
WaitStatus waitForTaskCountAndCleanAllocationList(TaskCountType requiredTaskCount, uint32_t allocationUsage);
|
|
|
|
MOCKABLE_VIRTUAL WaitStatus waitForTaskCountAndCleanTemporaryAllocationList(TaskCountType requiredTaskCount);
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
LinearStream &getCS(size_t minRequiredSize = 1024u);
|
2020-02-03 20:24:53 +08:00
|
|
|
OSInterface *getOSInterface() const;
|
2022-07-24 12:21:16 +08:00
|
|
|
ExecutionEnvironment &peekExecutionEnvironment() const { return executionEnvironment; }
|
2022-04-28 17:05:59 +08:00
|
|
|
GmmHelper *peekGmmHelper() const;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
MOCKABLE_VIRTUAL void setTagAllocation(GraphicsAllocation *allocation);
|
2018-04-03 18:23:14 +08:00
|
|
|
GraphicsAllocation *getTagAllocation() const {
|
|
|
|
return tagAllocation;
|
|
|
|
}
|
2021-02-25 16:38:48 +08:00
|
|
|
MultiGraphicsAllocation *getTagsMultiAllocation() const {
|
|
|
|
return tagsMultiAllocation;
|
|
|
|
}
|
2021-03-11 22:23:53 +08:00
|
|
|
MultiGraphicsAllocation &createTagsMultiAllocation();
|
2023-02-06 18:12:34 +08:00
|
|
|
|
|
|
|
TaskCountType getNextBarrierCount() { return this->barrierCount.fetch_add(1u); }
|
2023-02-07 14:00:02 +08:00
|
|
|
TaskCountType peekBarrierCount() const { return this->barrierCount.load(); }
|
2022-11-22 21:53:59 +08:00
|
|
|
volatile TagAddressType *getTagAddress() const { return tagAddress; }
|
2023-02-06 18:12:34 +08:00
|
|
|
volatile TagAddressType *getBarrierCountTagAddress() const { return this->barrierCountTagAddress; }
|
|
|
|
uint64_t getBarrierCountGpuAddress() const;
|
2022-12-06 15:32:34 +08:00
|
|
|
uint64_t getDebugPauseStateGPUAddress() const;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2022-07-24 12:21:16 +08:00
|
|
|
virtual bool waitForFlushStamp(FlushStamp &flushStampToWait) { return true; }
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2022-11-22 21:53:59 +08:00
|
|
|
TaskCountType peekTaskCount() const { return taskCount; }
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2022-11-22 21:53:59 +08:00
|
|
|
TaskCountType peekTaskLevel() const { return taskLevel; }
|
2019-07-10 13:57:54 +08:00
|
|
|
FlushStamp obtainCurrentFlushStamp() const;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2022-11-22 21:53:59 +08:00
|
|
|
TaskCountType peekLatestSentTaskCount() const { return latestSentTaskCount; }
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2022-11-22 21:53:59 +08:00
|
|
|
TaskCountType peekLatestFlushedTaskCount() const { return latestFlushedTaskCount; }
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2018-04-26 17:43:47 +08:00
|
|
|
void enableNTo1SubmissionModel() { this->nTo1SubmissionModelEnabled = true; }
|
|
|
|
bool isNTo1SubmissionModelEnabled() const { return this->nTo1SubmissionModelEnabled; }
|
2018-04-04 17:34:46 +08:00
|
|
|
void overrideDispatchPolicy(DispatchMode overrideValue) { this->dispatchMode = overrideValue; }
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2018-12-13 18:06:28 +08:00
|
|
|
void setMediaVFEStateDirty(bool dirty) { mediaVfeStateDirty = dirty; }
|
2023-03-10 21:20:23 +08:00
|
|
|
bool getMediaVFEStateDirty() const { return mediaVfeStateDirty; }
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2023-04-28 17:38:31 +08:00
|
|
|
void setGSBAStateDirty(bool dirty) { gsbaStateDirty = dirty; }
|
|
|
|
bool getGSBAStateDirty() const { return gsbaStateDirty; }
|
2023-03-10 21:20:23 +08:00
|
|
|
|
|
|
|
void setStateComputeModeDirty(bool dirty) { stateComputeModeDirty = dirty; }
|
|
|
|
bool getStateComputeModeDirty() const { return stateComputeModeDirty; }
|
2021-02-05 00:32:23 +08:00
|
|
|
|
2023-03-31 04:03:12 +08:00
|
|
|
void setBtdCommandDirty(bool dirty) { btdCommandDirty = dirty; }
|
|
|
|
bool getBtdCommandDirty() const { return btdCommandDirty; }
|
|
|
|
bool isRayTracingStateProgramingNeeded(Device &device) const;
|
|
|
|
|
2024-01-23 18:41:31 +08:00
|
|
|
void setRequiredScratchSizes(uint32_t newRequiredScratchSlot0Size, uint32_t newRequiredPrivateScratchSlot1Size);
|
2018-11-22 22:16:20 +08:00
|
|
|
GraphicsAllocation *getScratchAllocation();
|
2024-05-07 03:17:52 +08:00
|
|
|
GraphicsAllocation *getDebugSurfaceAllocation() const {
|
|
|
|
if (primaryCsr) {
|
|
|
|
return primaryCsr->getDebugSurfaceAllocation();
|
|
|
|
}
|
|
|
|
return debugSurface;
|
|
|
|
}
|
2018-03-21 19:58:30 +08:00
|
|
|
GraphicsAllocation *allocateDebugSurface(size_t size);
|
2024-05-07 03:17:52 +08:00
|
|
|
GraphicsAllocation *getPreemptionAllocation() const {
|
|
|
|
if (primaryCsr) {
|
|
|
|
return primaryCsr->getPreemptionAllocation();
|
|
|
|
}
|
|
|
|
return preemptionAllocation;
|
|
|
|
}
|
|
|
|
GraphicsAllocation *getGlobalFenceAllocation() const {
|
|
|
|
if (primaryCsr) {
|
|
|
|
return primaryCsr->getGlobalFenceAllocation();
|
|
|
|
}
|
|
|
|
|
|
|
|
return globalFenceAllocation;
|
|
|
|
}
|
2024-09-16 23:53:10 +08:00
|
|
|
GraphicsAllocation *getWorkPartitionAllocation() const {
|
|
|
|
if (primaryCsr) {
|
|
|
|
return primaryCsr->getWorkPartitionAllocation();
|
|
|
|
}
|
|
|
|
return workPartitionAllocation;
|
|
|
|
}
|
|
|
|
|
2024-05-07 03:17:52 +08:00
|
|
|
GraphicsAllocation *getGlobalStatelessHeapAllocation() const {
|
|
|
|
if (primaryCsr) {
|
|
|
|
return primaryCsr->getGlobalStatelessHeapAllocation();
|
|
|
|
}
|
|
|
|
|
|
|
|
return globalStatelessHeapAllocation;
|
|
|
|
}
|
2019-11-12 20:59:37 +08:00
|
|
|
|
2022-11-22 21:53:59 +08:00
|
|
|
virtual WaitStatus waitForTaskCountWithKmdNotifyFallback(TaskCountType taskCountToWait, FlushStamp flushStampToWait, bool useQuickKmdSleep, QueueThrottle throttle) = 0;
|
|
|
|
virtual WaitStatus waitForCompletionWithTimeout(const WaitParams ¶ms, TaskCountType taskCountToWait);
|
|
|
|
WaitStatus baseWaitFunction(volatile TagAddressType *pollAddress, const WaitParams ¶ms, TaskCountType taskCountToWait);
|
|
|
|
MOCKABLE_VIRTUAL bool testTaskCountReady(volatile TagAddressType *pollAddress, TaskCountType taskCountToWait);
|
2024-08-28 21:59:25 +08:00
|
|
|
void downloadAllocations(bool blockingWait) { downloadAllocations(blockingWait, this->latestFlushedTaskCount); };
|
|
|
|
virtual void downloadAllocations(bool blockingWait, TaskCountType taskCount){};
|
2023-10-31 23:44:14 +08:00
|
|
|
virtual void removeDownloadAllocation(GraphicsAllocation *alloc){};
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2018-01-10 21:05:34 +08:00
|
|
|
void setSamplerCacheFlushRequired(SamplerCacheFlushState value) { this->samplerCacheFlushRequired = value; }
|
|
|
|
|
2018-11-27 20:07:41 +08:00
|
|
|
FlatBatchBufferHelper &getFlatBatchBufferHelper() const { return *flatBatchBufferHelper; }
|
2023-01-18 01:04:14 +08:00
|
|
|
void overwriteFlatBatchBufferHelper(FlatBatchBufferHelper *newHelper);
|
2018-03-14 18:07:51 +08:00
|
|
|
|
2018-06-13 02:33:03 +08:00
|
|
|
MOCKABLE_VIRTUAL void initProgrammingFlags();
|
2021-09-23 03:25:21 +08:00
|
|
|
virtual AubSubCaptureStatus checkAndActivateAubSubCapture(const std::string &kernelName);
|
2019-06-03 15:57:27 +08:00
|
|
|
void programForAubSubCapture(bool wasActiveInPreviousEnqueue, bool isActive);
|
2019-04-01 15:33:19 +08:00
|
|
|
virtual void addAubComment(const char *comment);
|
2018-06-13 02:33:03 +08:00
|
|
|
|
2022-12-22 19:31:28 +08:00
|
|
|
IndirectHeap &getIndirectHeap(IndirectHeapType heapType, size_t minRequiredSize);
|
|
|
|
void allocateHeapMemory(IndirectHeapType heapType, size_t minRequiredSize, IndirectHeap *&indirectHeap);
|
|
|
|
void releaseIndirectHeap(IndirectHeapType heapType);
|
2023-02-03 02:57:24 +08:00
|
|
|
void *getIndirectHeapCurrentPtr(IndirectHeapType heapType) const;
|
2018-04-26 16:01:01 +08:00
|
|
|
|
2022-11-26 00:51:17 +08:00
|
|
|
virtual enum CommandStreamReceiverType getType() const = 0;
|
2018-07-05 17:23:28 +08:00
|
|
|
void setExperimentalCmdBuffer(std::unique_ptr<ExperimentalCommandBuffer> &&cmdBuffer);
|
2018-06-06 16:34:51 +08:00
|
|
|
|
2018-07-16 23:11:43 +08:00
|
|
|
bool initializeTagAllocation();
|
2021-02-17 01:04:00 +08:00
|
|
|
MOCKABLE_VIRTUAL bool createWorkPartitionAllocation(const Device &device);
|
2020-02-06 03:00:08 +08:00
|
|
|
MOCKABLE_VIRTUAL bool createGlobalFenceAllocation();
|
2019-06-28 03:33:05 +08:00
|
|
|
MOCKABLE_VIRTUAL bool createPreemptionAllocation();
|
2019-09-04 22:44:27 +08:00
|
|
|
MOCKABLE_VIRTUAL bool createPerDssBackedBuffer(Device &device);
|
2022-09-01 23:54:57 +08:00
|
|
|
[[nodiscard]] MOCKABLE_VIRTUAL std::unique_lock<MutexType> obtainUniqueOwnership();
|
2018-07-16 23:11:43 +08:00
|
|
|
|
2018-09-06 15:03:07 +08:00
|
|
|
bool peekTimestampPacketWriteEnabled() const { return timestampPacketWriteEnabled; }
|
|
|
|
|
2022-03-03 17:56:18 +08:00
|
|
|
bool isLatestTaskCountFlushed() {
|
|
|
|
return this->peekLatestFlushedTaskCount() == this->peekTaskCount();
|
|
|
|
}
|
|
|
|
|
2022-01-12 23:32:07 +08:00
|
|
|
size_t defaultSshSize = 0u;
|
2018-08-29 19:39:27 +08:00
|
|
|
|
2018-10-29 20:26:58 +08:00
|
|
|
AllocationsList &getTemporaryAllocations();
|
|
|
|
AllocationsList &getAllocationsForReuse();
|
2022-07-13 23:05:42 +08:00
|
|
|
AllocationsList &getDeferredAllocations();
|
2018-10-22 21:17:32 +08:00
|
|
|
InternalAllocationStorage *getInternalAllocationStorage() const { return internalAllocationStorage.get(); }
|
2019-05-06 16:50:25 +08:00
|
|
|
MOCKABLE_VIRTUAL bool createAllocationForHostSurface(HostPtrSurface &surface, bool requiresL3Flush);
|
2020-02-03 17:52:12 +08:00
|
|
|
virtual size_t getPreferredTagPoolSize() const;
|
2022-10-13 23:53:33 +08:00
|
|
|
virtual void fillReusableAllocationsList();
|
2019-01-10 16:37:56 +08:00
|
|
|
virtual void setupContext(OsContext &osContext) { this->osContext = &osContext; }
|
2018-11-26 21:04:52 +08:00
|
|
|
OsContext &getOsContext() const { return *osContext; }
|
2024-06-17 18:43:53 +08:00
|
|
|
uint8_t getUmdPowerHintValue() const;
|
2024-06-06 23:23:40 +08:00
|
|
|
bool initializeResources(bool allocateInterrupt);
|
2021-03-25 02:21:13 +08:00
|
|
|
TagAllocatorBase *getEventTsAllocator();
|
|
|
|
TagAllocatorBase *getEventPerfCountAllocator(const uint32_t tagSize);
|
2021-03-29 22:46:41 +08:00
|
|
|
virtual TagAllocatorBase *getTimestampPacketAllocator() = 0;
|
2023-01-20 00:11:39 +08:00
|
|
|
virtual std::unique_ptr<TagAllocatorBase> createMultiRootDeviceTimestampPacketAllocator(const RootDeviceIndicesContainer rootDeviceIndices) = 0;
|
2018-11-27 20:07:41 +08:00
|
|
|
|
2020-03-19 20:48:13 +08:00
|
|
|
virtual bool expectMemory(const void *gfxAddress, const void *srcAddress, size_t length, uint32_t compareOperation);
|
2023-10-18 21:54:46 +08:00
|
|
|
MOCKABLE_VIRTUAL bool writeMemory(GraphicsAllocation &gfxAllocation) { return writeMemory(gfxAllocation, false, 0, 0); }
|
|
|
|
virtual bool writeMemory(GraphicsAllocation &gfxAllocation, bool isChunkCopy, uint64_t gpuVaChunkOffset, size_t chunkSize) { return false; }
|
2023-11-27 21:47:52 +08:00
|
|
|
virtual void writeMemoryAub(aub_stream::AllocationParams &allocationParams){};
|
2024-08-14 01:11:57 +08:00
|
|
|
virtual void initializeEngine(){};
|
2018-11-28 22:32:13 +08:00
|
|
|
|
2019-09-12 23:30:13 +08:00
|
|
|
virtual bool isMultiOsContextCapable() const = 0;
|
2018-02-09 05:52:58 +08:00
|
|
|
|
2023-01-04 17:45:07 +08:00
|
|
|
virtual MemoryCompressionState getMemoryCompressionState(bool auxTranslationRequired) const = 0;
|
2020-12-17 08:36:45 +08:00
|
|
|
|
2022-11-22 21:53:59 +08:00
|
|
|
void setLatestSentTaskCount(TaskCountType latestSentTaskCount) {
|
2019-03-18 22:23:18 +08:00
|
|
|
this->latestSentTaskCount = latestSentTaskCount;
|
|
|
|
}
|
2022-11-22 21:53:59 +08:00
|
|
|
void setLatestFlushedTaskCount(TaskCountType latestFlushedTaskCount) {
|
2021-11-12 18:38:26 +08:00
|
|
|
this->latestFlushedTaskCount = latestFlushedTaskCount;
|
|
|
|
}
|
2019-03-18 22:23:18 +08:00
|
|
|
|
2022-11-22 21:53:59 +08:00
|
|
|
virtual TaskCountType flushBcsTask(const BlitPropertiesContainer &blitPropertiesContainer, bool blocking, bool profilingEnabled, Device &device) = 0;
|
2019-04-03 21:59:31 +08:00
|
|
|
|
2022-11-09 19:18:06 +08:00
|
|
|
virtual SubmissionStatus flushTagUpdate() = 0;
|
2021-02-23 16:48:08 +08:00
|
|
|
virtual void updateTagFromWait() = 0;
|
2023-03-27 17:06:13 +08:00
|
|
|
virtual bool isUpdateTagFromWaitEnabled() = 0;
|
2023-08-07 21:33:24 +08:00
|
|
|
virtual void flushMonitorFence(){};
|
2024-05-06 17:27:41 +08:00
|
|
|
virtual bool isTlbFlushRequiredForStateCacheFlush();
|
2021-02-23 16:48:08 +08:00
|
|
|
|
2019-05-21 23:25:05 +08:00
|
|
|
ScratchSpaceController *getScratchSpaceController() const {
|
|
|
|
return scratchSpaceController.get();
|
|
|
|
}
|
|
|
|
|
2024-05-07 03:17:52 +08:00
|
|
|
ScratchSpaceController *getPrimaryScratchSpaceController() const {
|
|
|
|
if (primaryCsr) {
|
|
|
|
return primaryCsr->getScratchSpaceController();
|
|
|
|
}
|
|
|
|
return getScratchSpaceController();
|
|
|
|
}
|
|
|
|
|
2022-03-29 23:31:51 +08:00
|
|
|
void downloadAllocation(GraphicsAllocation &gfxAllocation);
|
2021-12-27 18:43:20 +08:00
|
|
|
|
2024-01-24 23:42:31 +08:00
|
|
|
bool isInstructionCacheFlushRequired() const {
|
|
|
|
return requiresInstructionCacheFlush;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setInstructionCacheFlushed() {
|
|
|
|
requiresInstructionCacheFlush = false;
|
|
|
|
}
|
|
|
|
|
2019-08-28 01:14:24 +08:00
|
|
|
void registerInstructionCacheFlush() {
|
|
|
|
auto mutex = obtainUniqueOwnership();
|
|
|
|
requiresInstructionCacheFlush = true;
|
|
|
|
}
|
|
|
|
|
2024-06-21 20:00:59 +08:00
|
|
|
MOCKABLE_VIRTUAL bool checkDcFlushRequiredForDcMitigationAndReset() {
|
|
|
|
auto ret = this->requiresDcFlush;
|
|
|
|
this->requiresDcFlush = false;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
void registerDcFlushForDcMitigation() {
|
|
|
|
this->requiresDcFlush = true;
|
|
|
|
}
|
|
|
|
|
2019-09-20 03:09:44 +08:00
|
|
|
bool isLocalMemoryEnabled() const { return localMemoryEnabled; }
|
|
|
|
|
2022-04-19 22:44:06 +08:00
|
|
|
uint32_t getRootDeviceIndex() const { return rootDeviceIndex; }
|
2019-11-07 21:15:04 +08:00
|
|
|
|
2023-06-27 23:41:05 +08:00
|
|
|
MOCKABLE_VIRTUAL void startControllingDirectSubmissions();
|
2021-10-29 19:54:52 +08:00
|
|
|
|
2023-03-27 17:06:13 +08:00
|
|
|
bool isAnyDirectSubmissionEnabled() {
|
2021-11-16 21:26:36 +08:00
|
|
|
return this->isDirectSubmissionEnabled() || isBlitterDirectSubmissionEnabled();
|
|
|
|
}
|
|
|
|
|
2022-04-19 22:44:06 +08:00
|
|
|
virtual bool initDirectSubmission() {
|
2020-01-16 00:02:47 +08:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual bool isDirectSubmissionEnabled() const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2020-03-27 03:13:10 +08:00
|
|
|
virtual bool isBlitterDirectSubmissionEnabled() const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2022-11-21 22:55:39 +08:00
|
|
|
virtual bool directSubmissionRelaxedOrderingEnabled() const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2023-06-13 22:37:41 +08:00
|
|
|
virtual bool isKmdWaitOnTaskCountAllowed() const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2023-07-05 16:55:12 +08:00
|
|
|
virtual void stopDirectSubmission(bool blocking) {}
|
2021-07-30 17:56:58 +08:00
|
|
|
|
2024-03-22 19:18:35 +08:00
|
|
|
virtual QueueThrottle getLastDirectSubmissionThrottle() = 0;
|
|
|
|
|
2021-02-19 18:37:39 +08:00
|
|
|
bool isStaticWorkPartitioningEnabled() const {
|
|
|
|
return staticWorkPartitioningEnabled;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint64_t getWorkPartitionAllocationGpuAddress() const;
|
|
|
|
|
2022-01-13 00:57:42 +08:00
|
|
|
MOCKABLE_VIRTUAL bool isRcs() const;
|
2020-03-19 22:15:51 +08:00
|
|
|
|
2020-09-05 07:18:12 +08:00
|
|
|
virtual void initializeDefaultsForInternalEngine(){};
|
|
|
|
|
2020-11-19 07:58:42 +08:00
|
|
|
virtual GraphicsAllocation *getClearColorAllocation() = 0;
|
|
|
|
|
2021-05-20 05:41:59 +08:00
|
|
|
virtual void postInitFlagsSetup() = 0;
|
|
|
|
|
2021-06-17 19:55:28 +08:00
|
|
|
bool isUsedNotifyEnableForPostSync() const {
|
|
|
|
return useNotifyEnableForPostSync;
|
|
|
|
}
|
|
|
|
|
2021-08-27 23:23:29 +08:00
|
|
|
NEO::StreamProperties &getStreamProperties() {
|
|
|
|
return this->streamProperties;
|
|
|
|
}
|
|
|
|
|
2021-09-17 21:05:26 +08:00
|
|
|
inline void setActivePartitions(uint32_t newPartitionCount) {
|
|
|
|
activePartitions = newPartitionCount;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline uint32_t getActivePartitions() const {
|
|
|
|
return activePartitions;
|
|
|
|
}
|
|
|
|
|
2021-11-20 05:58:46 +08:00
|
|
|
bool skipResourceCleanup() const;
|
|
|
|
|
2021-11-18 03:51:43 +08:00
|
|
|
inline bool isProgramActivePartitionConfigRequired() const {
|
|
|
|
return this->isDirectSubmissionEnabled() ? false : this->activePartitionsConfig != this->activePartitions;
|
|
|
|
}
|
|
|
|
|
2021-09-29 23:59:41 +08:00
|
|
|
std::unique_ptr<GmmPageTableMngr> pageTableManager;
|
|
|
|
|
2023-06-06 23:11:09 +08:00
|
|
|
inline uint32_t getImmWritePostSyncWriteOffset() const {
|
|
|
|
return immWritePostSyncWriteOffset;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline uint32_t getTimeStampPostSyncWriteOffset() const {
|
|
|
|
return timeStampPostSyncWriteOffset;
|
2021-11-30 22:41:26 +08:00
|
|
|
}
|
|
|
|
|
2021-12-11 05:31:34 +08:00
|
|
|
inline bool isMultiTileOperationEnabled() const {
|
|
|
|
return (activePartitions > 1) && staticWorkPartitioningEnabled;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void programComputeBarrierCommand(LinearStream &cmdStream) = 0;
|
|
|
|
virtual size_t getCmdsSizeForComputeBarrierCommand() const = 0;
|
|
|
|
|
2023-09-12 22:17:52 +08:00
|
|
|
virtual void programStallingCommandsForBarrier(LinearStream &cmdStream, TimestampPacketContainer *barrierTimestampPacketNodes, const bool isDcFlushRequired) = 0;
|
|
|
|
|
2022-01-12 03:41:57 +08:00
|
|
|
const HardwareInfo &peekHwInfo() const;
|
2022-04-19 22:44:06 +08:00
|
|
|
const RootDeviceEnvironment &peekRootDeviceEnvironment() const;
|
2022-01-12 03:41:57 +08:00
|
|
|
|
2022-12-09 22:37:32 +08:00
|
|
|
const GfxCoreHelper &getGfxCoreHelper() const;
|
2022-12-15 20:13:57 +08:00
|
|
|
const ProductHelper &getProductHelper() const;
|
2023-05-12 22:49:39 +08:00
|
|
|
const ReleaseHelper *getReleaseHelper() const;
|
2022-12-09 22:37:32 +08:00
|
|
|
|
2022-02-16 18:22:03 +08:00
|
|
|
MOCKABLE_VIRTUAL bool isGpuHangDetected() const;
|
2022-09-19 18:20:14 +08:00
|
|
|
MOCKABLE_VIRTUAL bool checkGpuHangDetected(TimeType currentTime, TimeType &lastHangCheckTime) const;
|
2022-02-16 18:22:03 +08:00
|
|
|
|
2022-12-06 15:32:34 +08:00
|
|
|
uint64_t getCompletionAddress() const;
|
2022-03-30 20:40:09 +08:00
|
|
|
|
2022-11-22 21:53:59 +08:00
|
|
|
TaskCountType getCompletionValue(const GraphicsAllocation &gfxAllocation);
|
2022-04-28 18:33:22 +08:00
|
|
|
DispatchMode getDispatchMode() const {
|
|
|
|
return this->dispatchMode;
|
|
|
|
}
|
2022-03-30 20:40:09 +08:00
|
|
|
|
2022-07-26 21:54:00 +08:00
|
|
|
bool getPreambleSetFlag() const {
|
|
|
|
return isPreambleSent;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setPreambleSetFlag(bool value) {
|
|
|
|
isPreambleSent = value;
|
|
|
|
}
|
|
|
|
|
2023-07-06 22:12:49 +08:00
|
|
|
bool getSipSentFlag() const {
|
|
|
|
return isStateSipSent;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setSipSentFlag(bool value) {
|
|
|
|
isStateSipSent = value;
|
|
|
|
}
|
|
|
|
|
2022-07-27 23:35:15 +08:00
|
|
|
PreemptionMode getPreemptionMode() const {
|
|
|
|
return lastPreemptionMode;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setPreemptionMode(PreemptionMode value) {
|
|
|
|
lastPreemptionMode = value;
|
|
|
|
}
|
2024-07-02 03:50:09 +08:00
|
|
|
bool csrSurfaceProgrammed() const {
|
|
|
|
return csrSurfaceProgrammingDone;
|
|
|
|
}
|
|
|
|
void setCsrSurfaceProgrammed(bool value) {
|
|
|
|
csrSurfaceProgrammingDone = value;
|
|
|
|
}
|
2022-07-27 23:35:15 +08:00
|
|
|
|
2024-03-08 00:50:57 +08:00
|
|
|
virtual SubmissionStatus initializeDeviceWithFirstSubmission(Device &device) = 0;
|
2022-09-19 21:34:14 +08:00
|
|
|
|
2023-03-09 21:22:23 +08:00
|
|
|
uint32_t getNumClients() const {
|
2022-10-06 20:21:52 +08:00
|
|
|
return this->numClients.load();
|
|
|
|
}
|
2023-09-25 15:58:39 +08:00
|
|
|
void registerClient(void *client);
|
|
|
|
void unregisterClient(void *client);
|
2022-10-06 20:21:52 +08:00
|
|
|
|
2022-10-11 18:37:19 +08:00
|
|
|
bool getDcFlushSupport() const {
|
|
|
|
return dcFlushSupport;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool getDcFlushRequired(bool externalCondition) const {
|
|
|
|
return externalCondition ? dcFlushSupport : false;
|
|
|
|
}
|
|
|
|
|
2022-12-22 19:31:28 +08:00
|
|
|
bool isTbxMode() const;
|
2023-01-13 18:36:23 +08:00
|
|
|
bool ensureTagAllocationForRootDeviceIndex(uint32_t rootDeviceIndex);
|
2022-11-26 00:51:17 +08:00
|
|
|
|
2023-02-25 00:55:21 +08:00
|
|
|
L1CachePolicy *getStoredL1CachePolicy() {
|
|
|
|
return &l1CachePolicyData;
|
|
|
|
}
|
2023-03-07 04:33:50 +08:00
|
|
|
void createGlobalStatelessHeap();
|
|
|
|
IndirectHeap *getGlobalStatelessHeap() {
|
2024-05-07 03:17:52 +08:00
|
|
|
if (primaryCsr) {
|
|
|
|
return primaryCsr->getGlobalStatelessHeap();
|
|
|
|
}
|
2023-03-07 04:33:50 +08:00
|
|
|
return globalStatelessHeap.get();
|
|
|
|
}
|
2023-02-25 00:55:21 +08:00
|
|
|
|
2023-03-15 20:57:15 +08:00
|
|
|
bool isRecyclingTagForHeapStorageRequired() const { return heapStorageRequiresRecyclingTag; }
|
|
|
|
|
2024-12-02 22:34:42 +08:00
|
|
|
virtual bool waitUserFenceSupported() { return false; }
|
2024-05-07 19:47:34 +08:00
|
|
|
virtual bool waitUserFence(TaskCountType waitValue, uint64_t hostAddress, int64_t timeout, bool userInterrupt, uint32_t externalInterruptId, GraphicsAllocation *allocForInterruptWait) { return false; }
|
2024-05-07 03:17:52 +08:00
|
|
|
void setPrimaryCsr(CommandStreamReceiver *primaryCsr) {
|
|
|
|
this->primaryCsr = primaryCsr;
|
|
|
|
}
|
2024-08-09 21:13:51 +08:00
|
|
|
CommandStreamReceiver *getPrimaryCsr() const { return primaryCsr; }
|
2023-07-25 22:09:20 +08:00
|
|
|
|
2023-10-27 23:54:45 +08:00
|
|
|
void requestPreallocation();
|
|
|
|
void releasePreallocationRequest();
|
2023-11-17 20:14:15 +08:00
|
|
|
void preallocateAllocation(AllocationType type, size_t size);
|
2023-10-27 23:54:45 +08:00
|
|
|
void preallocateCommandBuffer();
|
2023-11-17 20:14:15 +08:00
|
|
|
void preallocateInternalHeap();
|
2023-10-27 23:54:45 +08:00
|
|
|
|
2023-11-15 17:01:43 +08:00
|
|
|
bool isInitialized() const {
|
|
|
|
return this->resourcesInitialized;
|
|
|
|
}
|
|
|
|
|
2024-03-22 19:18:35 +08:00
|
|
|
MOCKABLE_VIRTUAL bool getAcLineConnected(bool updateStatus) const {
|
|
|
|
if (updateStatus) {
|
|
|
|
this->kmdNotifyHelper->updateAcLineStatus();
|
|
|
|
}
|
|
|
|
return this->kmdNotifyHelper->getAcLineConnected();
|
|
|
|
}
|
|
|
|
|
2024-01-23 22:32:18 +08:00
|
|
|
uint32_t getRequiredScratchSlot0Size() { return requiredScratchSlot0Size; }
|
|
|
|
uint32_t getRequiredScratchSlot1Size() { return requiredScratchSlot1Size; }
|
2024-05-09 19:17:06 +08:00
|
|
|
virtual bool submitDependencyUpdate(TagNodeBase *tag) = 0;
|
2024-01-23 22:32:18 +08:00
|
|
|
|
2024-10-22 19:41:19 +08:00
|
|
|
MOCKABLE_VIRTUAL bool isBusy() {
|
2024-07-19 18:25:15 +08:00
|
|
|
return !testTaskCountReady(getTagAddress(), this->taskCount);
|
|
|
|
}
|
|
|
|
|
2024-10-30 22:02:28 +08:00
|
|
|
bool isBusyWithoutHang(TimeType &lastHangCheckTime) {
|
|
|
|
return isBusy() && !this->checkGpuHangDetected(std::chrono::high_resolution_clock::now(), lastHangCheckTime);
|
|
|
|
}
|
|
|
|
|
2024-09-18 19:20:14 +08:00
|
|
|
bool canUse4GbHeaps() const {
|
|
|
|
return this->use4GbHeaps;
|
|
|
|
}
|
|
|
|
|
2024-08-02 03:44:16 +08:00
|
|
|
void ensurePrimaryCsrInitialized(Device &device);
|
|
|
|
|
2024-08-07 00:13:06 +08:00
|
|
|
bool enqueueWaitForPagingFence(uint64_t pagingFenceValue);
|
|
|
|
virtual void unblockPagingFenceSemaphore(uint64_t pagingFenceValue) {}
|
2024-08-29 23:38:06 +08:00
|
|
|
MOCKABLE_VIRTUAL void drainPagingFenceQueue();
|
2024-08-07 00:13:06 +08:00
|
|
|
|
2019-01-30 17:57:42 +08:00
|
|
|
protected:
|
|
|
|
void cleanupResources();
|
2020-04-30 19:24:34 +08:00
|
|
|
void printDeviceIndex();
|
2024-07-30 14:31:25 +08:00
|
|
|
void checkForNewResources(TaskCountType submittedTaskCount, TaskCountType allocationTaskCount, GraphicsAllocation &gfxAllocation);
|
2020-09-22 22:29:34 +08:00
|
|
|
bool checkImplicitFlushForGpuIdle();
|
2022-11-22 21:53:59 +08:00
|
|
|
void downloadTagAllocation(TaskCountType taskCountToWait);
|
|
|
|
void printTagAddressContent(TaskCountType taskCountToWait, int64_t waitTimeout, bool start);
|
2024-08-22 18:25:49 +08:00
|
|
|
virtual void addToEvictionContainer(GraphicsAllocation &gfxAllocation);
|
|
|
|
|
2022-09-01 23:54:57 +08:00
|
|
|
[[nodiscard]] MOCKABLE_VIRTUAL std::unique_lock<MutexType> obtainHostPtrSurfaceCreationLock();
|
2019-01-30 17:57:42 +08:00
|
|
|
|
2023-09-25 15:58:39 +08:00
|
|
|
std::vector<void *> registeredClients;
|
|
|
|
|
2018-11-05 18:52:19 +08:00
|
|
|
std::unique_ptr<FlushStampTracker> flushStamp;
|
|
|
|
std::unique_ptr<SubmissionAggregator> submissionAggregator;
|
|
|
|
std::unique_ptr<FlatBatchBufferHelper> flatBatchBufferHelper;
|
|
|
|
std::unique_ptr<InternalAllocationStorage> internalAllocationStorage;
|
2023-10-27 23:54:45 +08:00
|
|
|
std::atomic<uint32_t> preallocatedAmount{0};
|
|
|
|
std::atomic<uint32_t> requestedPreallocationsAmount{0};
|
|
|
|
|
2018-11-05 18:52:19 +08:00
|
|
|
std::unique_ptr<KmdNotifyHelper> kmdNotifyHelper;
|
2018-11-22 22:16:20 +08:00
|
|
|
std::unique_ptr<ScratchSpaceController> scratchSpaceController;
|
2021-03-25 02:21:13 +08:00
|
|
|
std::unique_ptr<TagAllocatorBase> profilingTimeStampAllocator;
|
|
|
|
std::unique_ptr<TagAllocatorBase> perfCounterAllocator;
|
|
|
|
std::unique_ptr<TagAllocatorBase> timestampPacketAllocator;
|
2020-10-28 23:08:37 +08:00
|
|
|
std::unique_ptr<Thread> userPauseConfirmation;
|
2023-03-07 04:33:50 +08:00
|
|
|
std::unique_ptr<IndirectHeap> globalStatelessHeap;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2018-11-05 18:52:19 +08:00
|
|
|
ResidencyContainer residencyAllocations;
|
|
|
|
ResidencyContainer evictionAllocations;
|
2023-09-04 17:42:02 +08:00
|
|
|
PrivateAllocsToReuseContainer ownedPrivateAllocations;
|
2023-08-10 23:40:21 +08:00
|
|
|
|
2018-11-05 18:52:19 +08:00
|
|
|
MutexType ownershipMutex;
|
2021-10-07 01:34:44 +08:00
|
|
|
MutexType hostPtrSurfaceCreationMutex;
|
2023-09-25 15:58:39 +08:00
|
|
|
MutexType registeredClientsMutex;
|
2018-11-05 18:52:19 +08:00
|
|
|
ExecutionEnvironment &executionEnvironment;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2018-11-05 18:52:19 +08:00
|
|
|
LinearStream commandStream;
|
2021-09-17 21:05:26 +08:00
|
|
|
StreamProperties streamProperties{};
|
2022-09-21 00:46:15 +08:00
|
|
|
FrontEndPropertiesSupport feSupportFlags{};
|
2022-09-22 09:44:06 +08:00
|
|
|
PipelineSelectPropertiesSupport pipelineSupportFlags{};
|
2023-02-03 02:57:24 +08:00
|
|
|
StateBaseAddressPropertiesSupport sbaSupportFlags{};
|
2023-02-25 00:55:21 +08:00
|
|
|
L1CachePolicy l1CachePolicyData{};
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2020-10-28 23:08:37 +08:00
|
|
|
uint64_t totalMemoryUsed = 0u;
|
2020-04-30 23:12:01 +08:00
|
|
|
|
2022-11-22 21:53:59 +08:00
|
|
|
volatile TagAddressType *tagAddress = nullptr;
|
2023-02-06 18:12:34 +08:00
|
|
|
volatile TagAddressType *barrierCountTagAddress = nullptr;
|
2021-08-31 19:37:13 +08:00
|
|
|
volatile DebugPauseState *debugPauseStateAddress = nullptr;
|
2020-11-06 20:01:29 +08:00
|
|
|
SpinLock debugPauseStateLock;
|
2020-06-17 17:31:08 +08:00
|
|
|
static void *asyncDebugBreakConfirmation(void *arg);
|
2023-01-18 01:04:14 +08:00
|
|
|
static std::function<void()> debugConfirmationFunction;
|
2022-03-29 23:31:51 +08:00
|
|
|
std::function<void(GraphicsAllocation &)> downloadAllocationImpl;
|
2018-11-05 18:52:19 +08:00
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
GraphicsAllocation *tagAllocation = nullptr;
|
2020-02-06 03:00:08 +08:00
|
|
|
GraphicsAllocation *globalFenceAllocation = nullptr;
|
2019-06-28 03:33:05 +08:00
|
|
|
GraphicsAllocation *preemptionAllocation = nullptr;
|
2018-11-05 18:52:19 +08:00
|
|
|
GraphicsAllocation *debugSurface = nullptr;
|
2019-09-04 22:44:27 +08:00
|
|
|
GraphicsAllocation *perDssBackedBuffer = nullptr;
|
2020-11-19 07:58:42 +08:00
|
|
|
GraphicsAllocation *clearColorAllocation = nullptr;
|
2021-02-17 01:04:00 +08:00
|
|
|
GraphicsAllocation *workPartitionAllocation = nullptr;
|
2023-03-07 04:33:50 +08:00
|
|
|
GraphicsAllocation *globalStatelessHeapAllocation = nullptr;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2021-02-25 16:38:48 +08:00
|
|
|
MultiGraphicsAllocation *tagsMultiAllocation = nullptr;
|
|
|
|
|
2023-12-14 00:09:52 +08:00
|
|
|
IndirectHeap *indirectHeap[IndirectHeapType::numTypes];
|
2020-10-28 23:08:37 +08:00
|
|
|
OsContext *osContext = nullptr;
|
2024-05-07 03:17:52 +08:00
|
|
|
CommandStreamReceiver *primaryCsr = nullptr;
|
2022-11-22 21:53:59 +08:00
|
|
|
TaskCountType *completionFenceValuePointer = nullptr;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2023-02-06 18:12:34 +08:00
|
|
|
std::atomic<TaskCountType> barrierCount{0};
|
2018-11-05 18:52:19 +08:00
|
|
|
// current taskLevel. Used for determining if a PIPE_CONTROL is needed.
|
2022-11-22 21:53:59 +08:00
|
|
|
std::atomic<TaskCountType> taskLevel{0};
|
|
|
|
std::atomic<TaskCountType> latestSentTaskCount{0};
|
|
|
|
std::atomic<TaskCountType> latestFlushedTaskCount{0};
|
2020-10-28 23:08:37 +08:00
|
|
|
// taskCount - # of tasks submitted
|
2022-11-22 21:53:59 +08:00
|
|
|
std::atomic<TaskCountType> taskCount{0};
|
2018-11-05 18:52:19 +08:00
|
|
|
|
2022-10-06 20:21:52 +08:00
|
|
|
std::atomic<uint32_t> numClients = 0u;
|
|
|
|
|
2023-12-13 17:17:24 +08:00
|
|
|
DispatchMode dispatchMode = DispatchMode::immediateDispatch;
|
2018-11-05 18:52:19 +08:00
|
|
|
SamplerCacheFlushState samplerCacheFlushRequired = SamplerCacheFlushState::samplerCacheFlushNotRequired;
|
2018-02-08 20:41:02 +08:00
|
|
|
PreemptionMode lastPreemptionMode = PreemptionMode::Initial;
|
2020-04-30 23:12:01 +08:00
|
|
|
|
2022-01-21 00:56:19 +08:00
|
|
|
std::chrono::microseconds gpuHangCheckPeriod{500'000};
|
2018-11-05 18:52:19 +08:00
|
|
|
uint32_t lastSentL3Config = 0;
|
2024-05-27 17:27:22 +08:00
|
|
|
uint32_t latestSentStatelessMocsConfig = CacheSettings::unknownMocs;
|
2019-08-21 18:50:47 +08:00
|
|
|
uint64_t lastSentSliceCount = QueueSliceCount::defaultSliceCount;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2024-01-23 18:41:31 +08:00
|
|
|
uint32_t requiredScratchSlot0Size = 0;
|
|
|
|
uint32_t requiredScratchSlot1Size = 0;
|
2023-11-30 18:36:43 +08:00
|
|
|
uint32_t lastAdditionalKernelExecInfo = AdditionalKernelExecInfo::notSet;
|
|
|
|
KernelExecutionType lastKernelExecutionType = KernelExecutionType::defaultType;
|
|
|
|
MemoryCompressionState lastMemoryCompressionState = MemoryCompressionState::notApplicable;
|
2021-09-17 21:05:26 +08:00
|
|
|
uint32_t activePartitions = 1;
|
2021-09-24 02:13:37 +08:00
|
|
|
uint32_t activePartitionsConfig = 1;
|
2023-06-06 23:11:09 +08:00
|
|
|
uint32_t immWritePostSyncWriteOffset = 0;
|
|
|
|
uint32_t timeStampPostSyncWriteOffset = 0;
|
2022-11-22 21:53:59 +08:00
|
|
|
TaskCountType completionFenceValue = 0;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2019-10-29 15:01:53 +08:00
|
|
|
const uint32_t rootDeviceIndex;
|
2020-10-29 22:33:35 +08:00
|
|
|
const DeviceBitfield deviceBitfield;
|
2019-10-29 15:01:53 +08:00
|
|
|
|
2018-11-05 18:52:19 +08:00
|
|
|
int8_t lastMediaSamplerConfig = -1;
|
2018-09-13 21:49:38 +08:00
|
|
|
|
2018-11-05 18:52:19 +08:00
|
|
|
bool isPreambleSent = false;
|
|
|
|
bool isStateSipSent = false;
|
2020-02-03 17:24:43 +08:00
|
|
|
bool isEnginePrologueSent = false;
|
2020-11-27 03:02:18 +08:00
|
|
|
bool isPerDssBackedBufferSent = false;
|
2023-04-28 17:38:31 +08:00
|
|
|
bool gsbaFor32BitProgrammed = false;
|
|
|
|
bool gsbaStateDirty = true;
|
2019-04-26 23:04:03 +08:00
|
|
|
bool bindingTableBaseAddressRequired = false;
|
2023-02-08 01:23:45 +08:00
|
|
|
bool heapStorageRequiresRecyclingTag = false;
|
2018-11-05 18:52:19 +08:00
|
|
|
bool mediaVfeStateDirty = true;
|
2023-03-10 21:20:23 +08:00
|
|
|
bool stateComputeModeDirty = true;
|
2023-03-31 04:03:12 +08:00
|
|
|
bool btdCommandDirty = true;
|
2018-11-05 18:52:19 +08:00
|
|
|
bool lastVmeSubslicesConfig = false;
|
|
|
|
bool timestampPacketWriteEnabled = false;
|
2021-02-17 01:04:00 +08:00
|
|
|
bool staticWorkPartitioningEnabled = false;
|
2018-11-05 18:52:19 +08:00
|
|
|
bool nTo1SubmissionModelEnabled = false;
|
2022-08-31 21:26:29 +08:00
|
|
|
bool lastSystolicPipelineSelectMode = false;
|
2019-08-28 01:14:24 +08:00
|
|
|
bool requiresInstructionCacheFlush = false;
|
2024-06-21 20:00:59 +08:00
|
|
|
bool requiresDcFlush = false;
|
2019-09-20 03:09:44 +08:00
|
|
|
|
|
|
|
bool localMemoryEnabled = false;
|
2019-12-31 17:45:14 +08:00
|
|
|
bool pageTableManagerInitialized = false;
|
2020-09-22 22:29:34 +08:00
|
|
|
|
|
|
|
bool useNewResourceImplicitFlush = false;
|
|
|
|
bool newResources = false;
|
|
|
|
bool useGpuIdleImplicitFlush = false;
|
2021-06-17 19:55:28 +08:00
|
|
|
bool useNotifyEnableForPostSync = false;
|
2022-10-11 18:37:19 +08:00
|
|
|
bool dcFlushSupport = false;
|
2022-10-26 19:31:37 +08:00
|
|
|
bool forceSkipResourceCleanupRequired = false;
|
2024-09-18 18:30:54 +08:00
|
|
|
bool resourcesInitialized = false;
|
|
|
|
bool heaplessStateInitialized = false;
|
2023-02-23 05:30:40 +08:00
|
|
|
bool doubleSbaWa = false;
|
2023-06-05 21:29:53 +08:00
|
|
|
bool dshSupported = false;
|
2023-11-23 21:58:58 +08:00
|
|
|
bool heaplessModeEnabled = false;
|
2024-09-18 19:20:14 +08:00
|
|
|
bool use4GbHeaps = true;
|
|
|
|
bool csrSurfaceProgrammingDone = false;
|
2017-12-21 07:45:38 +08:00
|
|
|
};
|
|
|
|
|
2020-10-29 22:33:35 +08:00
|
|
|
typedef CommandStreamReceiver *(*CommandStreamReceiverCreateFunc)(bool withAubDump,
|
|
|
|
ExecutionEnvironment &executionEnvironment,
|
|
|
|
uint32_t rootDeviceIndex,
|
|
|
|
const DeviceBitfield deviceBitfield);
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|