2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2022-01-07 22:53:31 +08:00
|
|
|
* Copyright (C) 2018-2022 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +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_hw.h"
|
2022-02-22 20:51:29 +08:00
|
|
|
#include "shared/source/command_stream/wait_status.h"
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/device/device.h"
|
|
|
|
#include "shared/source/direct_submission/direct_submission_hw.h"
|
|
|
|
#include "shared/source/execution_environment/execution_environment.h"
|
2020-11-02 22:54:01 +08:00
|
|
|
#include "shared/source/memory_manager/os_agnostic_memory_manager.h"
|
2022-01-26 20:35:24 +08:00
|
|
|
#include "shared/source/memory_manager/surface.h"
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/os_interface/os_context.h"
|
2021-01-21 20:10:13 +08:00
|
|
|
#include "shared/test/common/helpers/dispatch_flags_helper.h"
|
|
|
|
#include "shared/test/common/helpers/ult_hw_config.h"
|
2021-05-21 18:22:13 +08:00
|
|
|
#include "shared/test/common/mocks/mock_experimental_command_buffer.h"
|
2020-02-22 16:28:27 +08:00
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
#include <map>
|
2018-11-16 16:11:52 +08:00
|
|
|
#include <memory>
|
2022-01-21 00:56:19 +08:00
|
|
|
#include <optional>
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2018-08-17 19:38:09 +08:00
|
|
|
class GmmPageTableMngr;
|
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
template <typename GfxFamily>
|
2018-11-16 16:11:52 +08:00
|
|
|
class UltCommandStreamReceiver : public CommandStreamReceiverHw<GfxFamily>, public NonCopyableOrMovableClass {
|
2017-12-21 07:45:38 +08:00
|
|
|
using BaseClass = CommandStreamReceiverHw<GfxFamily>;
|
|
|
|
|
|
|
|
public:
|
2020-10-19 21:36:57 +08:00
|
|
|
using BaseClass::blitterDirectSubmission;
|
2020-09-22 22:29:34 +08:00
|
|
|
using BaseClass::checkPlatformSupportsGpuIdleImplicitFlush;
|
|
|
|
using BaseClass::checkPlatformSupportsNewResourceImplicitFlush;
|
2020-10-19 21:36:57 +08:00
|
|
|
using BaseClass::directSubmission;
|
2017-12-21 07:45:38 +08:00
|
|
|
using BaseClass::dshState;
|
2020-02-03 17:24:43 +08:00
|
|
|
using BaseClass::getCmdSizeForPrologue;
|
2018-09-12 22:32:42 +08:00
|
|
|
using BaseClass::getScratchPatchAddress;
|
2019-05-21 23:25:05 +08:00
|
|
|
using BaseClass::getScratchSpaceController;
|
2018-04-26 16:01:01 +08:00
|
|
|
using BaseClass::indirectHeap;
|
2017-12-21 07:45:38 +08:00
|
|
|
using BaseClass::iohState;
|
2020-03-27 03:13:10 +08:00
|
|
|
using BaseClass::isBlitterDirectSubmissionEnabled;
|
2020-01-16 00:02:47 +08:00
|
|
|
using BaseClass::isDirectSubmissionEnabled;
|
2020-11-27 03:02:18 +08:00
|
|
|
using BaseClass::isPerDssBackedBufferSent;
|
2021-05-15 00:46:50 +08:00
|
|
|
using BaseClass::makeResident;
|
2019-09-04 22:44:27 +08:00
|
|
|
using BaseClass::perDssBackedBuffer;
|
2021-05-20 05:41:59 +08:00
|
|
|
using BaseClass::postInitFlagsSetup;
|
2021-09-24 02:13:37 +08:00
|
|
|
using BaseClass::programActivePartitionConfig;
|
2020-02-03 17:24:43 +08:00
|
|
|
using BaseClass::programEnginePrologue;
|
2020-11-27 03:02:18 +08:00
|
|
|
using BaseClass::programPerDssBackedBuffer;
|
2018-04-26 16:01:01 +08:00
|
|
|
using BaseClass::programPreamble;
|
2021-12-10 03:31:27 +08:00
|
|
|
using BaseClass::programStallingCommandsForBarrier;
|
2021-11-06 09:42:54 +08:00
|
|
|
using BaseClass::programStallingNoPostSyncCommandsForBarrier;
|
2021-12-10 03:31:27 +08:00
|
|
|
using BaseClass::programStallingPostSyncCommandsForBarrier;
|
2018-11-05 18:52:19 +08:00
|
|
|
using BaseClass::programStateSip;
|
2021-08-13 22:48:13 +08:00
|
|
|
using BaseClass::programVFEState;
|
2019-08-28 01:14:24 +08:00
|
|
|
using BaseClass::requiresInstructionCacheFlush;
|
2019-10-22 16:26:23 +08:00
|
|
|
using BaseClass::rootDeviceIndex;
|
2017-12-21 07:45:38 +08:00
|
|
|
using BaseClass::sshState;
|
2021-02-17 01:04:00 +08:00
|
|
|
using BaseClass::staticWorkPartitioningEnabled;
|
2021-12-09 19:01:40 +08:00
|
|
|
using BaseClass::streamProperties;
|
2020-11-18 21:56:18 +08:00
|
|
|
using BaseClass::wasSubmittedToSingleSubdevice;
|
2021-09-17 21:05:26 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::activePartitions;
|
2021-09-24 02:13:37 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::activePartitionsConfig;
|
2021-10-08 02:09:36 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::baseWaitFunction;
|
2019-04-26 23:04:03 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::bindingTableBaseAddressRequired;
|
2021-04-01 04:21:59 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::canUse4GbHeaps;
|
2020-09-22 22:29:34 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::checkForNewResources;
|
|
|
|
using BaseClass::CommandStreamReceiver::checkImplicitFlushForGpuIdle;
|
2018-10-19 16:49:25 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::cleanupResources;
|
2020-11-19 07:58:42 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::clearColorAllocation;
|
2017-12-21 07:45:38 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::commandStream;
|
2020-04-30 23:12:01 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::debugConfirmationFunction;
|
|
|
|
using BaseClass::CommandStreamReceiver::debugPauseStateAddress;
|
2020-10-28 23:08:37 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::deviceBitfield;
|
2017-12-21 07:45:38 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::dispatchMode;
|
2018-08-08 19:49:09 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::executionEnvironment;
|
2018-07-05 17:23:28 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::experimentalCmdBuffer;
|
2017-12-21 07:45:38 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::flushStamp;
|
2020-02-06 03:00:08 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::globalFenceAllocation;
|
2022-01-21 00:56:19 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::gpuHangCheckPeriod;
|
2018-11-16 16:11:52 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::GSBAFor32BitProgrammed;
|
2020-01-16 00:02:47 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::initDirectSubmission;
|
2019-05-10 18:59:39 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::internalAllocationStorage;
|
2020-03-27 03:13:10 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::isBlitterDirectSubmissionEnabled;
|
2020-01-16 00:02:47 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::isDirectSubmissionEnabled;
|
2020-02-03 17:24:43 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::isEnginePrologueSent;
|
2017-12-21 07:45:38 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::isPreambleSent;
|
2018-11-05 18:52:19 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::isStateSipSent;
|
2020-11-17 18:42:29 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::lastKernelExecutionType;
|
2018-02-16 16:15:36 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::lastMediaSamplerConfig;
|
2020-12-17 08:36:45 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::lastMemoryCompressionState;
|
2018-02-16 16:15:36 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::lastPreemptionMode;
|
2017-12-21 07:45:38 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::lastSentL3Config;
|
2021-03-03 20:25:26 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::lastSentUseGlobalAtomics;
|
2021-09-29 18:28:33 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::lastSpecialPipelineSelectMode;
|
2018-02-16 16:15:36 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::lastVmeSubslicesConfig;
|
2018-01-12 23:41:45 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::latestFlushedTaskCount;
|
2017-12-21 07:45:38 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::latestSentStatelessMocsConfig;
|
2019-04-15 14:54:38 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::latestSentTaskCount;
|
2018-08-10 21:23:11 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::mediaVfeStateDirty;
|
2020-09-22 22:29:34 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::newResources;
|
2019-09-04 17:34:23 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::osContext;
|
2019-04-18 18:25:29 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::perfCounterAllocator;
|
2021-11-30 22:41:26 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::postSyncWriteOffset;
|
2019-04-18 18:25:29 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::profilingTimeStampAllocator;
|
2019-06-28 15:37:04 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::requiredPrivateScratchSize;
|
2018-09-12 22:32:42 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::requiredScratchSize;
|
2018-11-16 16:11:52 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::samplerCacheFlushRequired;
|
2019-06-28 15:37:04 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::scratchSpaceController;
|
2021-11-06 09:42:54 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::stallingCommandsOnNextFlushRequired;
|
2018-08-10 21:23:11 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::submissionAggregator;
|
2021-09-07 06:29:47 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::tagAddress;
|
2017-12-21 07:45:38 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::taskCount;
|
|
|
|
using BaseClass::CommandStreamReceiver::taskLevel;
|
2018-11-27 20:07:41 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::timestampPacketAllocator;
|
2018-09-06 15:03:07 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::timestampPacketWriteEnabled;
|
2020-09-22 22:29:34 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::useGpuIdleImplicitFlush;
|
|
|
|
using BaseClass::CommandStreamReceiver::useNewResourceImplicitFlush;
|
2022-03-17 17:43:17 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::useNotifyEnableForPostSync;
|
2020-04-30 23:12:01 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::userPauseConfirmation;
|
2018-10-09 17:50:58 +08:00
|
|
|
using BaseClass::CommandStreamReceiver::waitForTaskCountAndCleanAllocationList;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2020-10-28 23:08:37 +08:00
|
|
|
UltCommandStreamReceiver(ExecutionEnvironment &executionEnvironment,
|
|
|
|
uint32_t rootDeviceIndex,
|
2020-10-29 22:33:35 +08:00
|
|
|
const DeviceBitfield deviceBitfield)
|
|
|
|
: BaseClass(executionEnvironment, rootDeviceIndex, deviceBitfield), recursiveLockCounter(0),
|
2022-01-21 00:56:19 +08:00
|
|
|
recordedDispatchFlags(DispatchFlagsHelper::createDefaultDispatchFlags()) {
|
|
|
|
}
|
2020-10-28 23:08:37 +08:00
|
|
|
static CommandStreamReceiver *create(bool withAubDump,
|
|
|
|
ExecutionEnvironment &executionEnvironment,
|
|
|
|
uint32_t rootDeviceIndex,
|
2020-10-29 22:33:35 +08:00
|
|
|
const DeviceBitfield deviceBitfield) {
|
2020-10-28 23:08:37 +08:00
|
|
|
return new UltCommandStreamReceiver<GfxFamily>(executionEnvironment, rootDeviceIndex, deviceBitfield);
|
2018-11-16 16:11:52 +08:00
|
|
|
}
|
|
|
|
|
2020-03-10 22:21:12 +08:00
|
|
|
GmmPageTableMngr *createPageTableManager() override {
|
2018-08-17 19:38:09 +08:00
|
|
|
createPageTableManagerCalled = true;
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2019-04-15 14:54:38 +08:00
|
|
|
void makeSurfacePackNonResident(ResidencyContainer &allocationsForResidency) override {
|
|
|
|
makeSurfacePackNonResidentCalled++;
|
|
|
|
BaseClass::makeSurfacePackNonResident(allocationsForResidency);
|
|
|
|
}
|
|
|
|
|
2022-01-07 22:53:31 +08:00
|
|
|
NEO::SubmissionStatus flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) override {
|
2019-04-15 14:54:38 +08:00
|
|
|
if (recordFlusheBatchBuffer) {
|
|
|
|
latestFlushedBatchBuffer = batchBuffer;
|
|
|
|
}
|
2019-04-16 19:02:34 +08:00
|
|
|
latestSentTaskCountValueDuringFlush = latestSentTaskCount;
|
2019-04-15 14:54:38 +08:00
|
|
|
return BaseClass::flush(batchBuffer, allocationsForResidency);
|
|
|
|
}
|
|
|
|
|
2019-02-18 22:23:15 +08:00
|
|
|
CompletionStamp flushTask(LinearStream &commandStream, size_t commandStreamStart,
|
|
|
|
const IndirectHeap &dsh, const IndirectHeap &ioh, const IndirectHeap &ssh,
|
|
|
|
uint32_t taskLevel, DispatchFlags &dispatchFlags, Device &device) override {
|
2019-08-26 23:03:13 +08:00
|
|
|
recordedDispatchFlags = dispatchFlags;
|
2019-02-18 22:23:15 +08:00
|
|
|
this->lastFlushedCommandStream = &commandStream;
|
|
|
|
return BaseClass::flushTask(commandStream, commandStreamStart, dsh, ioh, ssh, taskLevel, dispatchFlags, device);
|
|
|
|
}
|
|
|
|
|
2018-11-15 21:47:52 +08:00
|
|
|
size_t getPreferredTagPoolSize() const override {
|
|
|
|
return BaseClass::getPreferredTagPoolSize() + 1;
|
|
|
|
}
|
2019-06-28 03:33:05 +08:00
|
|
|
void setPreemptionAllocation(GraphicsAllocation *allocation) { this->preemptionAllocation = allocation; }
|
2018-11-15 21:47:52 +08:00
|
|
|
|
2020-05-13 17:25:29 +08:00
|
|
|
void downloadAllocations() override {
|
2019-12-13 23:46:52 +08:00
|
|
|
downloadAllocationCalled = true;
|
|
|
|
}
|
|
|
|
|
2021-12-27 18:43:20 +08:00
|
|
|
void downloadAllocation(GraphicsAllocation &gfxAllocation) override {
|
|
|
|
downloadAllocationCalled = true;
|
|
|
|
}
|
|
|
|
|
2022-03-23 22:36:07 +08:00
|
|
|
WaitStatus waitForCompletionWithTimeout(const WaitParams ¶ms, uint32_t taskCountToWait) override {
|
2019-04-15 14:54:38 +08:00
|
|
|
latestWaitForCompletionWithTimeoutTaskCount.store(taskCountToWait);
|
2021-09-07 06:29:47 +08:00
|
|
|
waitForCompletionWithTimeoutTaskCountCalled++;
|
|
|
|
if (callBaseWaitForCompletionWithTimeout) {
|
2022-03-23 22:36:07 +08:00
|
|
|
return BaseClass::waitForCompletionWithTimeout(params, taskCountToWait);
|
2021-09-07 06:29:47 +08:00
|
|
|
}
|
|
|
|
return returnWaitForCompletionWithTimeout;
|
|
|
|
}
|
2022-03-23 22:36:07 +08:00
|
|
|
WaitStatus waitForCompletionWithTimeout(bool enableTimeout, int64_t timeoutMicroseconds, uint32_t taskCountToWait) {
|
|
|
|
return waitForCompletionWithTimeout(WaitParams{false, enableTimeout, timeoutMicroseconds}, taskCountToWait);
|
|
|
|
}
|
2021-09-07 06:29:47 +08:00
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
void overrideCsrSizeReqFlags(CsrSizeRequestFlags &flags) { this->csrSizeRequestFlags = flags; }
|
2019-06-28 03:33:05 +08:00
|
|
|
GraphicsAllocation *getPreemptionAllocation() const { return this->preemptionAllocation; }
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2018-02-16 16:15:36 +08:00
|
|
|
void makeResident(GraphicsAllocation &gfxAllocation) override {
|
|
|
|
if (storeMakeResidentAllocations) {
|
|
|
|
std::map<GraphicsAllocation *, uint32_t>::iterator it = makeResidentAllocations.find(&gfxAllocation);
|
|
|
|
if (it == makeResidentAllocations.end()) {
|
|
|
|
std::pair<std::map<GraphicsAllocation *, uint32_t>::iterator, bool> result;
|
|
|
|
result = makeResidentAllocations.insert(std::pair<GraphicsAllocation *, uint32_t>(&gfxAllocation, 1));
|
|
|
|
DEBUG_BREAK_IF(!result.second);
|
|
|
|
} else {
|
|
|
|
makeResidentAllocations[&gfxAllocation]++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
BaseClass::makeResident(gfxAllocation);
|
|
|
|
}
|
|
|
|
|
2018-11-27 20:07:41 +08:00
|
|
|
bool isMadeResident(GraphicsAllocation *graphicsAllocation) const {
|
2018-03-27 15:24:26 +08:00
|
|
|
return makeResidentAllocations.find(graphicsAllocation) != makeResidentAllocations.end();
|
|
|
|
}
|
|
|
|
|
2019-09-04 17:34:23 +08:00
|
|
|
bool isMadeResident(GraphicsAllocation *graphicsAllocation, uint32_t taskCount) const {
|
|
|
|
auto it = makeResidentAllocations.find(graphicsAllocation);
|
|
|
|
if (it == makeResidentAllocations.end()) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return (it->first->getTaskCount(osContext->getContextId()) == taskCount);
|
|
|
|
}
|
|
|
|
|
2018-02-16 16:15:36 +08:00
|
|
|
std::map<GraphicsAllocation *, uint32_t> makeResidentAllocations;
|
2018-11-16 16:11:52 +08:00
|
|
|
bool storeMakeResidentAllocations = false;
|
2018-02-16 16:15:36 +08:00
|
|
|
|
2021-09-23 03:25:21 +08:00
|
|
|
AubSubCaptureStatus checkAndActivateAubSubCapture(const std::string &kernelName) override {
|
|
|
|
auto status = CommandStreamReceiverHw<GfxFamily>::checkAndActivateAubSubCapture(kernelName);
|
2019-06-03 15:57:27 +08:00
|
|
|
checkAndActivateAubSubCaptureCalled = true;
|
|
|
|
return status;
|
2018-06-13 02:33:03 +08:00
|
|
|
}
|
2019-04-01 15:33:19 +08:00
|
|
|
void addAubComment(const char *message) override {
|
|
|
|
CommandStreamReceiverHw<GfxFamily>::addAubComment(message);
|
2019-05-06 22:22:51 +08:00
|
|
|
aubCommentMessages.push_back(message);
|
2019-04-01 15:33:19 +08:00
|
|
|
addAubCommentCalled = true;
|
|
|
|
}
|
2019-11-24 21:50:41 +08:00
|
|
|
bool flushBatchedSubmissions() override {
|
2018-06-13 02:33:03 +08:00
|
|
|
flushBatchedSubmissionsCalled = true;
|
2022-01-21 00:56:19 +08:00
|
|
|
|
|
|
|
if (shouldFailFlushBatchedSubmissions) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2022-02-28 18:24:05 +08:00
|
|
|
if (shouldFlushBatchedSubmissionsReturnSuccess) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2019-11-24 21:50:41 +08:00
|
|
|
return CommandStreamReceiverHw<GfxFamily>::flushBatchedSubmissions();
|
2018-06-13 02:33:03 +08:00
|
|
|
}
|
|
|
|
void initProgrammingFlags() override {
|
|
|
|
CommandStreamReceiverHw<GfxFamily>::initProgrammingFlags();
|
|
|
|
initProgrammingFlagsCalled = true;
|
|
|
|
}
|
|
|
|
|
2019-02-13 15:27:05 +08:00
|
|
|
std::unique_lock<CommandStreamReceiver::MutexType> obtainUniqueOwnership() override {
|
|
|
|
recursiveLockCounter++;
|
|
|
|
return CommandStreamReceiverHw<GfxFamily>::obtainUniqueOwnership();
|
|
|
|
}
|
|
|
|
|
2022-02-03 21:29:48 +08:00
|
|
|
uint32_t flushBcsTask(const BlitPropertiesContainer &blitPropertiesContainer, bool blocking, bool profilingEnabled, Device &device) override {
|
2019-05-16 23:48:29 +08:00
|
|
|
blitBufferCalled++;
|
2021-07-29 19:45:53 +08:00
|
|
|
receivedBlitProperties = blitPropertiesContainer;
|
2022-02-03 21:29:48 +08:00
|
|
|
return CommandStreamReceiverHw<GfxFamily>::flushBcsTask(blitPropertiesContainer, blocking, profilingEnabled, device);
|
2019-04-16 21:42:23 +08:00
|
|
|
}
|
|
|
|
|
2019-09-04 22:44:27 +08:00
|
|
|
bool createPerDssBackedBuffer(Device &device) override {
|
|
|
|
createPerDssBackedBufferCalled++;
|
|
|
|
bool result = BaseClass::createPerDssBackedBuffer(device);
|
|
|
|
if (!perDssBackedBuffer) {
|
2022-02-04 21:59:01 +08:00
|
|
|
AllocationProperties properties{device.getRootDeviceIndex(), MemoryConstants::pageSize, AllocationType::INTERNAL_HEAP, device.getDeviceBitfield()};
|
2019-09-04 22:44:27 +08:00
|
|
|
perDssBackedBuffer = executionEnvironment.memoryManager->allocateGraphicsMemoryWithProperties(properties);
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2019-09-12 23:30:13 +08:00
|
|
|
bool isMultiOsContextCapable() const override {
|
2020-10-28 23:08:37 +08:00
|
|
|
if (callBaseIsMultiOsContextCapable) {
|
|
|
|
return BaseClass::isMultiOsContextCapable();
|
|
|
|
}
|
2019-09-12 23:30:13 +08:00
|
|
|
return multiOsContextCapable;
|
|
|
|
}
|
|
|
|
|
2020-01-16 00:02:47 +08:00
|
|
|
bool initDirectSubmission(Device &device, OsContext &osContext) override {
|
|
|
|
if (ultHwConfig.csrFailInitDirectSubmission) {
|
|
|
|
return false;
|
|
|
|
}
|
2021-10-12 18:08:17 +08:00
|
|
|
initDirectSubmissionCalled++;
|
2020-01-16 00:02:47 +08:00
|
|
|
return BaseClass::CommandStreamReceiver::initDirectSubmission(device, osContext);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool isDirectSubmissionEnabled() const override {
|
|
|
|
if (ultHwConfig.csrBaseCallDirectSubmissionAvailable) {
|
|
|
|
return BaseClass::isDirectSubmissionEnabled();
|
|
|
|
}
|
|
|
|
if (ultHwConfig.csrSuperBaseCallDirectSubmissionAvailable) {
|
|
|
|
return BaseClass::CommandStreamReceiver::isDirectSubmissionEnabled();
|
|
|
|
}
|
|
|
|
return directSubmissionAvailable;
|
|
|
|
}
|
2020-03-27 03:13:10 +08:00
|
|
|
|
|
|
|
bool isBlitterDirectSubmissionEnabled() const override {
|
|
|
|
if (ultHwConfig.csrBaseCallBlitterDirectSubmissionAvailable) {
|
|
|
|
return BaseClass::isBlitterDirectSubmissionEnabled();
|
|
|
|
}
|
|
|
|
if (ultHwConfig.csrSuperBaseCallBlitterDirectSubmissionAvailable) {
|
|
|
|
return BaseClass::CommandStreamReceiver::isBlitterDirectSubmissionEnabled();
|
|
|
|
}
|
|
|
|
return blitterDirectSubmissionAvailable;
|
|
|
|
}
|
|
|
|
|
2021-10-18 23:07:01 +08:00
|
|
|
bool createAllocationForHostSurface(HostPtrSurface &surface, bool requiresL3Flush) override {
|
|
|
|
createAllocationForHostSurfaceCalled++;
|
2022-01-26 20:35:24 +08:00
|
|
|
cpuCopyForHostPtrSurfaceAllowed = surface.peekIsPtrCopyAllowed();
|
2021-10-18 23:07:01 +08:00
|
|
|
return BaseClass::createAllocationForHostSurface(surface, requiresL3Flush);
|
|
|
|
}
|
|
|
|
|
2020-09-30 22:58:20 +08:00
|
|
|
void ensureCommandBufferAllocation(LinearStream &commandStream, size_t minimumRequiredSize, size_t additionalAllocationSize) override {
|
|
|
|
ensureCommandBufferAllocationCalled++;
|
|
|
|
BaseClass::ensureCommandBufferAllocation(commandStream, minimumRequiredSize, additionalAllocationSize);
|
|
|
|
}
|
2021-10-08 02:09:36 +08:00
|
|
|
|
2020-10-28 23:08:37 +08:00
|
|
|
std::vector<std::string> aubCommentMessages;
|
|
|
|
|
|
|
|
BatchBuffer latestFlushedBatchBuffer = {};
|
2020-09-30 22:58:20 +08:00
|
|
|
|
2019-02-13 15:27:05 +08:00
|
|
|
std::atomic<uint32_t> recursiveLockCounter;
|
2020-10-28 23:08:37 +08:00
|
|
|
std::atomic<uint32_t> latestWaitForCompletionWithTimeoutTaskCount{0};
|
2021-09-07 06:29:47 +08:00
|
|
|
std::atomic<uint32_t> waitForCompletionWithTimeoutTaskCountCalled{0};
|
2020-10-28 23:08:37 +08:00
|
|
|
|
|
|
|
LinearStream *lastFlushedCommandStream = nullptr;
|
|
|
|
|
|
|
|
uint32_t makeSurfacePackNonResidentCalled = false;
|
|
|
|
uint32_t latestSentTaskCountValueDuringFlush = 0;
|
|
|
|
uint32_t blitBufferCalled = 0;
|
|
|
|
uint32_t createPerDssBackedBufferCalled = 0;
|
2021-10-12 18:08:17 +08:00
|
|
|
uint32_t initDirectSubmissionCalled = 0;
|
2020-10-28 23:08:37 +08:00
|
|
|
int ensureCommandBufferAllocationCalled = 0;
|
|
|
|
DispatchFlags recordedDispatchFlags;
|
2021-07-29 19:45:53 +08:00
|
|
|
BlitPropertiesContainer receivedBlitProperties = {};
|
2021-10-18 23:07:01 +08:00
|
|
|
uint32_t createAllocationForHostSurfaceCalled = 0;
|
2022-01-26 20:35:24 +08:00
|
|
|
bool cpuCopyForHostPtrSurfaceAllowed = false;
|
2020-10-28 23:08:37 +08:00
|
|
|
|
2018-08-17 19:38:09 +08:00
|
|
|
bool createPageTableManagerCalled = false;
|
2019-04-15 14:54:38 +08:00
|
|
|
bool recordFlusheBatchBuffer = false;
|
2019-06-03 15:57:27 +08:00
|
|
|
bool checkAndActivateAubSubCaptureCalled = false;
|
2019-04-01 15:33:19 +08:00
|
|
|
bool addAubCommentCalled = false;
|
2019-12-13 23:46:52 +08:00
|
|
|
bool downloadAllocationCalled = false;
|
2018-06-13 02:33:03 +08:00
|
|
|
bool flushBatchedSubmissionsCalled = false;
|
|
|
|
bool initProgrammingFlagsCalled = false;
|
2019-09-12 23:30:13 +08:00
|
|
|
bool multiOsContextCapable = false;
|
2020-12-17 08:36:45 +08:00
|
|
|
bool memoryCompressionEnabled = false;
|
2020-01-16 00:02:47 +08:00
|
|
|
bool directSubmissionAvailable = false;
|
2020-03-27 03:13:10 +08:00
|
|
|
bool blitterDirectSubmissionAvailable = false;
|
2020-10-28 23:08:37 +08:00
|
|
|
bool callBaseIsMultiOsContextCapable = false;
|
2021-09-07 06:29:47 +08:00
|
|
|
bool callBaseWaitForCompletionWithTimeout = true;
|
2022-01-21 00:56:19 +08:00
|
|
|
bool shouldFailFlushBatchedSubmissions = false;
|
2022-02-28 18:24:05 +08:00
|
|
|
bool shouldFlushBatchedSubmissionsReturnSuccess = false;
|
2022-01-21 00:56:19 +08:00
|
|
|
WaitStatus returnWaitForCompletionWithTimeout = WaitStatus::Ready;
|
2017-12-21 07:45:38 +08:00
|
|
|
};
|
2019-10-22 17:25:14 +08:00
|
|
|
} // namespace NEO
|