Refactor state base address programing 3/n

This is small optimization to replace virtual call and retrieved struct with
cached value.

Related-To: NEO-5055

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2023-02-22 21:30:40 +00:00
committed by Compute-Runtime-Automation
parent 075c96267d
commit 3cb064fe95
25 changed files with 94 additions and 64 deletions

View File

@@ -39,7 +39,6 @@ struct StateBaseAddressHelperArgs {
const IndirectHeap *ioh = nullptr;
const IndirectHeap *ssh = nullptr;
GmmHelper *gmmHelper = nullptr;
const HardwareInfo *hwInfo = nullptr;
uint32_t statelessMocsIndex = 0;
MemoryCompressionState memoryCompressionState;
@@ -52,6 +51,7 @@ struct StateBaseAddressHelperArgs {
bool areMultipleSubDevicesInContext = false;
bool overrideSurfaceStateBaseAddress = false;
bool isDebuggerActive = false;
bool doubleSbaWa = false;
};
template <typename GfxFamily>

View File

@@ -24,8 +24,7 @@ void StateBaseAddressHelper<GfxFamily>::programStateBaseAddressIntoCommandStream
auto cmdSpace = StateBaseAddressHelper<GfxFamily>::getSpaceForSbaCmd(commandStream);
*cmdSpace = *args.stateBaseAddressCmd;
auto &productHelper = args.gmmHelper->getRootDeviceEnvironment().template getHelper<ProductHelper>();
if (productHelper.isAdditionalStateBaseAddressWARequired(*args.hwInfo)) {
if (args.doubleSbaWa) {
auto cmdSpace = StateBaseAddressHelper<GfxFamily>::getSpaceForSbaCmd(commandStream);
*cmdSpace = *args.stateBaseAddressCmd;
}