mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Reuse common logic of programming SCM fields for gen 9 and gen 11
Logic related to programming non coherent and thread arbitration policy for gens 9 and 11 has been moved to EncodeComputeMode object, where similar logic for gens gen12lp and newer is located. Functions PreambleHelper::programThreadArbitration and PreambleHelper::getThreadArbitrationCommandsSize have been removed. Redundant setForceNonCoherent call has been removed from XE HPG Related-To: NEO-6728 Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
5d90e2ab1d
commit
cd95572443
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
* Copyright (C) 2020-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -31,6 +31,29 @@ void EncodeSurfaceState<Family>::setFlagsForMediaCompression(R_SURFACE_STATE *su
|
||||
surfaceState->setAuxiliarySurfaceMode(Family::RENDER_SURFACE_STATE::AUXILIARY_SURFACE_MODE::AUXILIARY_SURFACE_MODE_AUX_NONE);
|
||||
}
|
||||
}
|
||||
template <typename Family>
|
||||
size_t EncodeComputeMode<Family>::getCmdSizeForComputeMode(const HardwareInfo &hwInfo, bool hasSharedHandles, bool isRcs) {
|
||||
return sizeof(typename Family::PIPE_CONTROL) + sizeof(typename Family::MI_LOAD_REGISTER_IMM);
|
||||
}
|
||||
|
||||
template <typename Family>
|
||||
void EncodeComputeMode<Family>::programComputeModeCommand(LinearStream &csr, StateComputeModeProperties &properties,
|
||||
const HardwareInfo &hwInfo) {
|
||||
using PIPE_CONTROL = typename Family::PIPE_CONTROL;
|
||||
UNRECOVERABLE_IF(properties.threadArbitrationPolicy.value == ThreadArbitrationPolicy::NotPresent);
|
||||
|
||||
if (properties.threadArbitrationPolicy.isDirty) {
|
||||
auto pipeControl = csr.getSpaceForCmd<PIPE_CONTROL>();
|
||||
PIPE_CONTROL cmd = SKLFamily::cmdInitPipeControl;
|
||||
cmd.setCommandStreamerStallEnable(true);
|
||||
*pipeControl = cmd;
|
||||
|
||||
LriHelper<SKLFamily>::program(&csr,
|
||||
DebugControlReg2::address,
|
||||
DebugControlReg2::getRegData(properties.threadArbitrationPolicy.value),
|
||||
false);
|
||||
}
|
||||
}
|
||||
|
||||
template struct EncodeDispatchKernel<Family>;
|
||||
template struct EncodeStates<Family>;
|
||||
|
||||
@@ -15,10 +15,6 @@ namespace NEO {
|
||||
typedef SKLFamily Family;
|
||||
static auto gfxCore = IGFX_GEN9_CORE;
|
||||
|
||||
template <>
|
||||
void CommandStreamReceiverHw<Family>::programComputeMode(LinearStream &stream, DispatchFlags &dispatchFlags, const HardwareInfo &hwInfo) {
|
||||
}
|
||||
|
||||
template <>
|
||||
void populateFactoryTable<CommandStreamReceiverHw<Family>>() {
|
||||
extern CommandStreamReceiverCreateFunc commandStreamReceiverFactory[2 * IGFX_MAX_CORE];
|
||||
|
||||
@@ -63,26 +63,6 @@ void PreambleHelper<SKLFamily>::addPipeControlBeforeVfeCmd(LinearStream *pComman
|
||||
*pipeControl = cmd;
|
||||
}
|
||||
|
||||
template <>
|
||||
void PreambleHelper<SKLFamily>::programThreadArbitration(LinearStream *pCommandStream, int32_t requiredThreadArbitrationPolicy) {
|
||||
UNRECOVERABLE_IF(requiredThreadArbitrationPolicy == ThreadArbitrationPolicy::NotPresent);
|
||||
|
||||
auto pipeControl = pCommandStream->getSpaceForCmd<PIPE_CONTROL>();
|
||||
PIPE_CONTROL cmd = SKLFamily::cmdInitPipeControl;
|
||||
cmd.setCommandStreamerStallEnable(true);
|
||||
*pipeControl = cmd;
|
||||
|
||||
LriHelper<SKLFamily>::program(pCommandStream,
|
||||
DebugControlReg2::address,
|
||||
DebugControlReg2::getRegData(requiredThreadArbitrationPolicy),
|
||||
false);
|
||||
}
|
||||
|
||||
template <>
|
||||
size_t PreambleHelper<SKLFamily>::getThreadArbitrationCommandsSize() {
|
||||
return sizeof(MI_LOAD_REGISTER_IMM) + sizeof(PIPE_CONTROL);
|
||||
}
|
||||
|
||||
template <>
|
||||
std::vector<int32_t> PreambleHelper<SKLFamily>::getSupportedThreadArbitrationPolicies() {
|
||||
std::vector<int32_t> retVal;
|
||||
|
||||
Reference in New Issue
Block a user