mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 05:56:36 +08:00
programStateBaseAddress: improve code reuse
Another step towards cleaner callers of StateBaseAddressHelper<>::programStateBaseAddress. Export programming state base address into a separate function to improve code reuse and reduce copy-pasted fragments, which make code modifications or maintenance more and more difficult over time. Use specialization for gen-specific variations. Related-To: NEO-6774 Signed-off-by: Maciej Bielski <maciej.bielski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
b24ff7ffbc
commit
56cb1f757b
@@ -14,6 +14,7 @@ using Family = NEO::XeHpgCoreFamily;
|
||||
#include "shared/source/command_stream/command_stream_receiver_hw_xehp_and_later.inl"
|
||||
#include "shared/source/helpers/blit_commands_helper_xehp_and_later.inl"
|
||||
#include "shared/source/helpers/populate_factory.h"
|
||||
#include "shared/source/helpers/state_base_address_xehp_and_later.inl"
|
||||
#include "shared/source/os_interface/hw_info_config.h"
|
||||
|
||||
namespace NEO {
|
||||
@@ -41,18 +42,6 @@ MemoryCompressionState CommandStreamReceiverHw<Family>::getMemoryCompressionStat
|
||||
return memoryCompressionState;
|
||||
}
|
||||
|
||||
template <>
|
||||
void CommandStreamReceiverHw<Family>::programAdditionalStateBaseAddress(LinearStream &csr, typename Family::STATE_BASE_ADDRESS &cmd, Device &device) {
|
||||
using STATE_BASE_ADDRESS = Family::STATE_BASE_ADDRESS;
|
||||
|
||||
auto &hwInfo = *device.getRootDeviceEnvironment().getHardwareInfo();
|
||||
auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
|
||||
if (hwInfoConfig.isAdditionalStateBaseAddressWARequired(hwInfo)) {
|
||||
auto cmdSpace = StateBaseAddressHelper<Family>::getSpaceForSbaCmd(csr);
|
||||
*cmdSpace = cmd;
|
||||
}
|
||||
}
|
||||
|
||||
template class CommandStreamReceiverHw<Family>;
|
||||
template struct BlitCommandsHelper<Family>;
|
||||
template void BlitCommandsHelper<Family>::appendColorDepth<typename Family::XY_BLOCK_COPY_BLT>(const BlitProperties &blitProperties, typename Family::XY_BLOCK_COPY_BLT &blitCmd);
|
||||
|
||||
Reference in New Issue
Block a user