mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
Use LogicalStateHelper for SIP programming
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
e0c87435e1
commit
f4485ec541
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -30,7 +30,7 @@ void PreemptionHelper::programCsrBaseAddress(LinearStream &preambleCmdStream, De
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
void PreemptionHelper::programStateSip(LinearStream &preambleCmdStream, Device &device) {
|
||||
void PreemptionHelper::programStateSip(LinearStream &preambleCmdStream, Device &device, LogicalStateHelper *logicalStateHelper) {
|
||||
using STATE_SIP = typename GfxFamily::STATE_SIP;
|
||||
bool debuggingEnabled = device.getDebugger() != nullptr || device.isDebuggerActive();
|
||||
bool isMidThreadPreemption = device.getPreemptionMode() == PreemptionMode::MidThread;
|
||||
@@ -38,13 +38,20 @@ void PreemptionHelper::programStateSip(LinearStream &preambleCmdStream, Device &
|
||||
if (isMidThreadPreemption || debuggingEnabled) {
|
||||
auto sipAllocation = SipKernel::getSipKernel(device).getSipAllocation();
|
||||
|
||||
auto sip = reinterpret_cast<STATE_SIP *>(preambleCmdStream.getSpace(sizeof(STATE_SIP)));
|
||||
STATE_SIP cmd = GfxFamily::cmdInitStateSip;
|
||||
cmd.setSystemInstructionPointer(sipAllocation->getGpuAddressToPatch());
|
||||
*sip = cmd;
|
||||
programStateSipCmd<GfxFamily>(preambleCmdStream, sipAllocation, logicalStateHelper);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
void PreemptionHelper::programStateSipCmd(LinearStream &preambleCmdStream, GraphicsAllocation *sipAllocation, LogicalStateHelper *logicalStateHelper) {
|
||||
using STATE_SIP = typename GfxFamily::STATE_SIP;
|
||||
|
||||
auto sip = reinterpret_cast<STATE_SIP *>(preambleCmdStream.getSpace(sizeof(STATE_SIP)));
|
||||
STATE_SIP cmd = GfxFamily::cmdInitStateSip;
|
||||
cmd.setSystemInstructionPointer(sipAllocation->getGpuAddressToPatch());
|
||||
*sip = cmd;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
void PreemptionHelper::programStateSipEndWa(LinearStream &cmdStream, Device &device) {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user