Store StreamProperties in CommandStreamReceiver

Move StreamProperties from CommandQueueHw.

Related-To: NEO-5995

Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
Filip Hazubski
2021-08-27 15:23:29 +00:00
committed by Compute-Runtime-Automation
parent c6477b1d7c
commit 741fa13507
5 changed files with 10 additions and 8 deletions

View File

@@ -8,7 +8,6 @@
#pragma once
#include "shared/source/command_stream/command_stream_receiver.h"
#include "shared/source/command_stream/scratch_space_controller.h"
#include "shared/source/command_stream/stream_properties.h"
#include "shared/source/command_stream/submissions_aggregator.h"
#include "shared/source/helpers/constants.h"
#include "shared/source/memory_manager/graphics_allocation.h"
@@ -53,8 +52,6 @@ struct CommandQueueHw : public CommandQueueImp {
bool getPreemptionCmdProgramming() override;
void patchCommands(CommandList &commandList, uint64_t scratchAddress);
NEO::StreamProperties streamProperties{};
};
} // namespace L0

View File

@@ -13,7 +13,6 @@
#include "shared/source/command_stream/command_stream_receiver_hw.h"
#include "shared/source/command_stream/linear_stream.h"
#include "shared/source/command_stream/preemption.h"
#include "shared/source/command_stream/stream_properties.h"
#include "shared/source/command_stream/thread_arbitration_policy.h"
#include "shared/source/device/device.h"
#include "shared/source/helpers/hw_helper.h"
@@ -308,6 +307,7 @@ ze_result_t CommandQueueHw<gfxCoreFamily>::executeCommandLists(
}
}
auto &streamProperties = csr->getStreamProperties();
for (auto i = 0u; i < numCommandLists; ++i) {
auto commandList = CommandList::fromHandle(phCommandLists[i]);
auto cmdBufferAllocations = commandList->commandContainer.getCmdBufferAllocations();
@@ -441,7 +441,7 @@ void CommandQueueHw<gfxCoreFamily>::programFrontEnd(uint64_t scratchAddress, uin
perThreadScratchSpaceSize,
scratchAddress,
device->getMaxNumHwThreads(),
streamProperties);
csr->getStreamProperties());
csr->setMediaVFEStateDirty(false);
}
@@ -455,7 +455,7 @@ template <GFXCORE_FAMILY gfxCoreFamily>
size_t CommandQueueHw<gfxCoreFamily>::estimateFrontEndCmdSizeForMultipleCommandLists(
bool isFrontEndStateDirty, uint32_t numCommandLists, ze_command_list_handle_t *phCommandLists) {
auto streamPropertiesCopy = streamProperties;
auto streamPropertiesCopy = csr->getStreamProperties();
auto singleFrontEndCmdSize = estimateFrontEndCmdSize();
size_t estimatedSize = 0;

View File

@@ -144,7 +144,7 @@ void CommandQueueHw<gfxCoreFamily>::patchCommands(CommandList &commandList, uint
cfeStateCmd = reinterpret_cast<CFE_STATE *>(commandToPatch.pCommand);
cfeStateCmd->setScratchSpaceBuffer(lowScratchAddress);
cfeStateCmd->setSingleSliceDispatchCcsMode(streamProperties.frontEndState.singleSliceDispatchCcsMode.value);
cfeStateCmd->setSingleSliceDispatchCcsMode(csr->getStreamProperties().frontEndState.singleSliceDispatchCcsMode.value);
*reinterpret_cast<CFE_STATE *>(commandToPatch.pDestination) = *cfeStateCmd;
break;

View File

@@ -10,6 +10,7 @@
#include "shared/source/command_stream/csr_definitions.h"
#include "shared/source/command_stream/csr_properties_flags.h"
#include "shared/source/command_stream/linear_stream.h"
#include "shared/source/command_stream/stream_properties.h"
#include "shared/source/command_stream/submissions_aggregator.h"
#include "shared/source/command_stream/thread_arbitration_policy.h"
#include "shared/source/helpers/aligned_memory.h"
@@ -261,6 +262,10 @@ class CommandStreamReceiver {
return useNotifyEnableForPostSync;
}
NEO::StreamProperties &getStreamProperties() {
return this->streamProperties;
}
protected:
void cleanupResources();
void printDeviceIndex();
@@ -332,6 +337,7 @@ class CommandStreamReceiver {
uint32_t lastAdditionalKernelExecInfo = AdditionalKernelExecInfo::NotSet;
KernelExecutionType lastKernelExecutionType = KernelExecutionType::Default;
MemoryCompressionState lastMemoryCompressionState = MemoryCompressionState::NotApplicable;
StreamProperties streamProperties{};
const uint32_t rootDeviceIndex;
const DeviceBitfield deviceBitfield;

View File

@@ -941,7 +941,6 @@ inline void CommandStreamReceiverHw<GfxFamily>::programVFEState(LinearStream &cs
auto pVfeState = PreambleHelper<GfxFamily>::getSpaceForVfeState(&csr, hwInfo, engineGroupType);
auto disableOverdispatch = hwHelper.isDisableOverdispatchAvailable(hwInfo) &&
(dispatchFlags.additionalKernelExecInfo != AdditionalKernelExecInfo::NotSet);
StreamProperties streamProperties{};
streamProperties.frontEndState.setProperties(lastKernelExecutionType == KernelExecutionType::Concurrent,
disableOverdispatch, osContext->isEngineInstanced(), hwInfo);
PreambleHelper<GfxFamily>::programVfeState(