2017-12-21 00:45:38 +01:00
|
|
|
/*
|
2023-01-26 10:26:52 +00:00
|
|
|
* Copyright (C) 2018-2023 Intel Corporation
|
2018-09-18 09:11:08 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2017-12-21 00:45:38 +01:00
|
|
|
#pragma once
|
2022-12-22 11:31:28 +00:00
|
|
|
#include "shared/source/command_container/cmdcontainer.h"
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/command_stream/csr_definitions.h"
|
2023-01-26 10:26:52 +00:00
|
|
|
#include "shared/source/command_stream/task_count_helper.h"
|
2022-07-01 08:15:04 +00:00
|
|
|
#include "shared/source/helpers/pipe_control_args.h"
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/utilities/idlist.h"
|
2019-02-27 11:39:32 +01:00
|
|
|
|
2017-12-21 00:45:38 +01:00
|
|
|
#include <vector>
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2018-08-16 11:18:05 +02:00
|
|
|
class Device;
|
2017-12-21 00:45:38 +01:00
|
|
|
class Event;
|
|
|
|
|
class FlushStampTracker;
|
2018-07-13 18:50:55 +02:00
|
|
|
class GraphicsAllocation;
|
2018-01-29 11:18:34 +01:00
|
|
|
|
2017-12-21 00:45:38 +01:00
|
|
|
struct BatchBuffer {
|
|
|
|
|
BatchBuffer(GraphicsAllocation *commandBufferAllocation,
|
|
|
|
|
size_t startOffset,
|
2018-02-28 22:50:41 +01:00
|
|
|
size_t chainedBatchBufferStartOffset,
|
2022-11-18 21:02:29 +00:00
|
|
|
uint64_t taskStartAddress,
|
2018-02-28 22:50:41 +01:00
|
|
|
GraphicsAllocation *chainedBatchBuffer,
|
2017-12-21 00:45:38 +01:00
|
|
|
bool lowPriority,
|
2018-01-29 11:18:34 +01:00
|
|
|
QueueThrottle throttle,
|
2019-08-21 03:50:47 -07:00
|
|
|
uint64_t sliceCount,
|
2017-12-21 00:45:38 +01:00
|
|
|
size_t usedSize,
|
2020-01-15 17:02:47 +01:00
|
|
|
LinearStream *stream,
|
2020-11-18 13:56:18 +00:00
|
|
|
void *endCmdPtr,
|
2023-02-01 17:06:21 +00:00
|
|
|
uint32_t numCsrClients,
|
2022-11-26 20:10:32 +00:00
|
|
|
bool hasStallingCmds,
|
2023-09-20 11:04:00 +00:00
|
|
|
bool hasRelaxedOrderingDependencies,
|
|
|
|
|
bool dispatchMonitorFence);
|
2017-12-21 00:45:38 +01:00
|
|
|
BatchBuffer() {}
|
|
|
|
|
GraphicsAllocation *commandBufferAllocation = nullptr;
|
2023-11-17 13:14:41 +00:00
|
|
|
ResidencyContainer *allocationsForResidency = nullptr;
|
2017-12-21 00:45:38 +01:00
|
|
|
size_t startOffset = 0u;
|
2018-02-28 22:50:41 +01:00
|
|
|
size_t chainedBatchBufferStartOffset = 0u;
|
2022-11-18 21:02:29 +00:00
|
|
|
uint64_t taskStartAddress = 0; // if task not available, use CSR stream
|
|
|
|
|
|
2018-02-28 22:50:41 +01:00
|
|
|
GraphicsAllocation *chainedBatchBuffer = nullptr;
|
2023-04-28 09:38:31 +00:00
|
|
|
bool lowPriority = false;
|
2018-01-29 11:18:34 +01:00
|
|
|
QueueThrottle throttle = QueueThrottle::MEDIUM;
|
2019-08-21 03:50:47 -07:00
|
|
|
uint64_t sliceCount = QueueSliceCount::defaultSliceCount;
|
2017-12-21 00:45:38 +01:00
|
|
|
size_t usedSize = 0u;
|
|
|
|
|
|
2022-11-18 21:02:29 +00:00
|
|
|
// only used in drm csr in gem close worker active mode
|
2017-12-21 00:45:38 +01:00
|
|
|
LinearStream *stream = nullptr;
|
2020-01-15 17:02:47 +01:00
|
|
|
void *endCmdPtr = nullptr;
|
2023-02-01 17:06:21 +00:00
|
|
|
uint32_t numCsrClients = 0;
|
2020-11-18 13:56:18 +00:00
|
|
|
|
2022-11-19 18:25:04 +00:00
|
|
|
bool hasStallingCmds = false;
|
2022-11-26 20:10:32 +00:00
|
|
|
bool hasRelaxedOrderingDependencies = false;
|
2022-05-10 12:37:40 +00:00
|
|
|
bool ringBufferRestartRequest = false;
|
2023-06-19 14:02:37 +00:00
|
|
|
bool disableFlatRingBuffer = false;
|
2023-09-20 11:04:00 +00:00
|
|
|
bool dispatchMonitorFence = false;
|
2017-12-21 00:45:38 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct CommandBuffer : public IDNode<CommandBuffer> {
|
2018-12-04 15:11:29 +01:00
|
|
|
CommandBuffer(Device &device);
|
2023-11-24 12:20:27 +00:00
|
|
|
CommandBuffer &operator=(const CommandBuffer &) = delete;
|
|
|
|
|
CommandBuffer &operator=(CommandBuffer &&) = delete;
|
2023-10-20 14:34:45 +00:00
|
|
|
~CommandBuffer() override;
|
2017-12-21 00:45:38 +01:00
|
|
|
ResidencyContainer surfaces;
|
|
|
|
|
BatchBuffer batchBuffer;
|
|
|
|
|
void *batchBufferEndLocation = nullptr;
|
|
|
|
|
uint32_t inspectionId = 0;
|
2022-11-22 13:53:59 +00:00
|
|
|
TaskCountType taskCount = 0u;
|
2018-02-15 08:29:57 +01:00
|
|
|
void *pipeControlThatMayBeErasedLocation = nullptr;
|
|
|
|
|
void *epiloguePipeControlLocation = nullptr;
|
2022-07-01 08:15:04 +00:00
|
|
|
PipeControlArgs epiloguePipeControlArgs;
|
2017-12-21 00:45:38 +01:00
|
|
|
std::unique_ptr<FlushStampTracker> flushStamp;
|
2018-08-16 11:18:05 +02:00
|
|
|
Device &device;
|
2017-12-21 00:45:38 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct CommandBufferList : public IDList<CommandBuffer, false, true, false> {};
|
|
|
|
|
|
|
|
|
|
using ResourcePackage = StackVec<GraphicsAllocation *, 128>;
|
|
|
|
|
|
|
|
|
|
class SubmissionAggregator {
|
|
|
|
|
public:
|
|
|
|
|
void recordCommandBuffer(CommandBuffer *commandBuffer);
|
2018-12-04 15:11:29 +01:00
|
|
|
void aggregateCommandBuffers(ResourcePackage &resourcePackage, size_t &totalUsedSize, size_t totalMemoryBudget, uint32_t osContextId);
|
2017-12-21 00:45:38 +01:00
|
|
|
CommandBufferList &peekCmdBufferList() { return cmdBuffers; }
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
CommandBufferList cmdBuffers;
|
|
|
|
|
uint32_t inspectionId = 1;
|
|
|
|
|
};
|
2019-03-26 11:59:46 +01:00
|
|
|
} // namespace NEO
|