Refactor LriHelper class

Related-To: NEO-4338

Change-Id: Ie6387ff5f35df569fe1d9492b35e2acbc93e0393
Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2020-04-28 16:48:23 +02:00
committed by sys_ocldev
parent 537ffbcb00
commit 1bb0134a6c
16 changed files with 83 additions and 32 deletions

View File

@@ -254,15 +254,7 @@ template <typename GfxFamily>
struct LriHelper {
using MI_LOAD_REGISTER_IMM = typename GfxFamily::MI_LOAD_REGISTER_IMM;
static MI_LOAD_REGISTER_IMM *program(LinearStream *cmdStream, uint32_t address, uint32_t value) {
MI_LOAD_REGISTER_IMM cmd = GfxFamily::cmdInitLoadRegisterImm;
cmd.setRegisterOffset(address);
cmd.setDataDword(value);
auto lri = cmdStream->getSpaceForCmd<MI_LOAD_REGISTER_IMM>();
*lri = cmd;
return lri;
}
static void program(LinearStream *cmdStream, uint32_t address, uint32_t value, bool remap);
};
template <typename GfxFamily>

View File

@@ -90,4 +90,15 @@ inline void MemorySynchronizationCommands<GfxFamily>::setCacheFlushExtraProperti
template <typename GfxFamily>
inline void MemorySynchronizationCommands<GfxFamily>::setPipeControlExtraProperties(typename GfxFamily::PIPE_CONTROL &pipeControl, PipeControlArgs &args) {
}
template <typename GfxFamily>
void LriHelper<GfxFamily>::program(LinearStream *cmdStream, uint32_t address, uint32_t value, bool remap) {
MI_LOAD_REGISTER_IMM cmd = GfxFamily::cmdInitLoadRegisterImm;
cmd.setRegisterOffset(address);
cmd.setDataDword(value);
auto lri = cmdStream->getSpaceForCmd<MI_LOAD_REGISTER_IMM>();
*lri = cmd;
}
} // namespace NEO

View File

@@ -16,4 +16,15 @@ inline bool HwHelperHw<Family>::isFusedEuDispatchEnabled(const HardwareInfo &hwI
return fusedEuDispatchEnabled;
}
template <>
void LriHelper<Family>::program(LinearStream *cmdStream, uint32_t address, uint32_t value, bool remap) {
MI_LOAD_REGISTER_IMM cmd = Family::cmdInitLoadRegisterImm;
cmd.setRegisterOffset(address);
cmd.setDataDword(value);
cmd.setMmioRemapEnable(remap);
auto lri = cmdStream->getSpaceForCmd<MI_LOAD_REGISTER_IMM>();
*lri = cmd;
}
} // namespace NEO

View File

@@ -88,10 +88,15 @@ void PreambleHelper<GfxFamily>::programPreemption(LinearStream *pCommandStream,
template <typename GfxFamily>
void PreambleHelper<GfxFamily>::programKernelDebugging(LinearStream *pCommandStream) {
LriHelper<GfxFamily>::program(pCommandStream, DebugModeRegisterOffset<GfxFamily>::registerOffset,
DebugModeRegisterOffset<GfxFamily>::debugEnabledValue);
LriHelper<GfxFamily>::program(pCommandStream, TdDebugControlRegisterOffset::registerOffset,
TdDebugControlRegisterOffset::debugEnabledValue);
LriHelper<GfxFamily>::program(pCommandStream,
DebugModeRegisterOffset<GfxFamily>::registerOffset,
DebugModeRegisterOffset<GfxFamily>::debugEnabledValue,
false);
LriHelper<GfxFamily>::program(pCommandStream,
TdDebugControlRegisterOffset::registerOffset,
TdDebugControlRegisterOffset::debugEnabledValue,
false);
}
template <typename GfxFamily>