Cleanup: updateStreamProperties(), SBA tracking

Fixes found out while working on the StateBaseAddress adaptation to
StreamProperties. Removing unused parameters, improving code reuse
(further improvements come with following commits).

Related-To: NEO-6774
Signed-off-by: Maciej Bielski <maciej.bielski@intel.com>
This commit is contained in:
Maciej Bielski
2022-09-07 14:27:09 +00:00
committed by Compute-Runtime-Automation
parent f6ecb1bc0c
commit e1b80ba1a8
18 changed files with 104 additions and 72 deletions

View File

@@ -125,9 +125,9 @@ struct CommandQueueHw : public CommandQueueImp {
inline void allocateTagsManagerHeapsAndMakeThemResidentIfSWTagsEnabled(NEO::LinearStream &commandStream);
inline void makeSbaTrackingBufferResidentIfL0DebuggerEnabled(bool isDebugEnabled);
inline void programCommandQueueDebugCmdsForSourceLevelOrL0DebuggerIfEnabled(bool isDebugEnabled, NEO::LinearStream &commandStream);
inline void programSbaWithUpdatedGsbaIfDirty(CommandListExecutionContext &ctx,
ze_command_list_handle_t hCommandList,
NEO::LinearStream &commandStream);
inline void programStateBaseAddressWithGsbaIfDirty(CommandListExecutionContext &ctx,
ze_command_list_handle_t hCommandList,
NEO::LinearStream &commandStream);
inline void programCsrBaseAddressIfPreemptionModeInitial(bool isPreemptionModeInitial, NEO::LinearStream &commandStream);
inline void programStateSip(bool isStateSipRequired, NEO::LinearStream &commandStream);
inline void updateOneCmdListPreemptionModeAndCtxStatePreemption(CommandListExecutionContext &ctx,

View File

@@ -144,7 +144,7 @@ ze_result_t CommandQueueHw<gfxCoreFamily>::executeCommandListsRegular(
this->programPipelineSelectIfGpgpuDisabled(child);
this->programCommandQueueDebugCmdsForSourceLevelOrL0DebuggerIfEnabled(ctx.isDebugEnabled, child);
this->programSbaWithUpdatedGsbaIfDirty(ctx, phCommandLists[0], child);
this->programStateBaseAddressWithGsbaIfDirty(ctx, phCommandLists[0], child);
this->programCsrBaseAddressIfPreemptionModeInitial(ctx.isPreemptionModeInitial, child);
this->programStateSip(ctx.stateSipRequired, child);
this->makePreemptionAllocationResidentForModeMidThread(ctx.isDevicePreemptionModeMidThread);
@@ -716,7 +716,7 @@ void CommandQueueHw<gfxCoreFamily>::programCommandQueueDebugCmdsForSourceLevelOr
}
template <GFXCORE_FAMILY gfxCoreFamily>
void CommandQueueHw<gfxCoreFamily>::programSbaWithUpdatedGsbaIfDirty(
void CommandQueueHw<gfxCoreFamily>::programStateBaseAddressWithGsbaIfDirty(
CommandListExecutionContext &ctx,
ze_command_list_handle_t hCommandList,
NEO::LinearStream &cmdStream) {

View File

@@ -79,17 +79,13 @@ void CommandQueueHw<gfxCoreFamily>::programStateBaseAddress(uint64_t gsba, bool
NEO::StateBaseAddressHelper<GfxFamily>::programStateBaseAddress(stateBaseAddressHelperArgs);
*sbaCmdBuf = sbaCmd;
csr->setGSBAStateDirty(false);
if (NEO::Debugger::isDebugEnabled(internalUsage) && device->getL0Debugger()) {
NEO::Debugger::SbaAddresses sbaAddresses = {};
NEO::EncodeStateBaseAddress<GfxFamily>::setSbaAddressesForDebugger(sbaAddresses, sbaCmd);
device->getL0Debugger()->programSbaTrackingCommands(commandStream, sbaAddresses);
}
bool sbaTrackingEnabled = (NEO::Debugger::isDebugEnabled(this->internalUsage) && device->getL0Debugger());
NEO::EncodeStateBaseAddress<GfxFamily>::setSbaTrackingForL0DebuggerIfEnabled(sbaTrackingEnabled, *neoDevice, commandStream, sbaCmd, true);
NEO::EncodeWA<GfxFamily>::encodeAdditionalPipelineSelect(commandStream, {}, false, hwInfo, isRcs);
csr->setGSBAStateDirty(false);
}
template <GFXCORE_FAMILY gfxCoreFamily>

View File

@@ -5,6 +5,7 @@
*
*/
#include "shared/source/command_container/command_encoder.h"
#include "shared/source/command_container/implicit_scaling.h"
#include "shared/source/command_stream/csr_definitions.h"
#include "shared/source/command_stream/scratch_space_controller.h"
@@ -76,13 +77,12 @@ void CommandQueueHw<gfxCoreFamily>::programStateBaseAddress(uint64_t gsba, bool
*sbaCmdBuf = sbaCmd;
}
if (NEO::Debugger::isDebugEnabled(internalUsage) && device->getL0Debugger()) {
NEO::Debugger::SbaAddresses sbaAddresses = {};
NEO::EncodeStateBaseAddress<GfxFamily>::setSbaAddressesForDebugger(sbaAddresses, sbaCmd);
device->getL0Debugger()->programSbaTrackingCommands(commandStream, sbaAddresses);
}
bool sbaTrackingEnabled = (NEO::Debugger::isDebugEnabled(this->internalUsage) && device->getL0Debugger());
NEO::EncodeStateBaseAddress<GfxFamily>::setSbaTrackingForL0DebuggerIfEnabled(sbaTrackingEnabled,
*neoDevice,
commandStream,
sbaCmd,
true);
auto heap = neoDevice->getBindlessHeapsHelper()->getHeap(NEO::BindlessHeapsHelper::GLOBAL_SSH);
NEO::StateBaseAddressHelper<GfxFamily>::programBindingTableBaseAddress(