|  | 
| 1 | 1 | /* | 
| 2 |  | - * Copyright (C) 2018-2023 Intel Corporation | 
|  | 2 | + * Copyright (C) 2018-2024 Intel Corporation | 
| 3 | 3 |  * | 
| 4 | 4 |  * SPDX-License-Identifier: MIT | 
| 5 | 5 |  * | 
|  | 
| 11 | 11 | #include "shared/source/command_stream/preemption_mode.h" | 
| 12 | 12 | #include "shared/source/device/device.h" | 
| 13 | 13 | #include "shared/source/execution_environment/execution_environment.h" | 
|  | 14 | +#include "shared/source/helpers/compiler_product_helper.h" | 
| 14 | 15 | #include "shared/source/helpers/gfx_core_helper.h" | 
| 15 | 16 | #include "shared/source/helpers/pipe_control_args.h" | 
| 16 | 17 | #include "shared/source/helpers/preamble.h" | 
| @@ -43,19 +44,28 @@ void PreemptionHelper::programStateSip(LinearStream &preambleCmdStream, Device & | 
| 43 | 44 |     bool debuggingEnabled = device.getDebugger() != nullptr; | 
| 44 | 45 |     bool isMidThreadPreemption = device.getPreemptionMode() == PreemptionMode::MidThread; | 
| 45 | 46 | 
 | 
|  | 47 | +    auto &compilerProductHelper = device.getCompilerProductHelper(); | 
|  | 48 | +    bool useFullAddress = compilerProductHelper.isHeaplessModeEnabled(); | 
|  | 49 | + | 
| 46 | 50 |     if (isMidThreadPreemption || debuggingEnabled) { | 
| 47 | 51 |         GraphicsAllocation *sipAllocation = SipKernel::getSipKernel(device, context).getSipAllocation(); | 
| 48 |  | -        programStateSipCmd<GfxFamily>(preambleCmdStream, sipAllocation); | 
|  | 52 | +        programStateSipCmd<GfxFamily>(preambleCmdStream, sipAllocation, useFullAddress); | 
| 49 | 53 |     } | 
| 50 | 54 | } | 
| 51 | 55 | 
 | 
| 52 | 56 | template <typename GfxFamily> | 
| 53 |  | -void PreemptionHelper::programStateSipCmd(LinearStream &preambleCmdStream, GraphicsAllocation *sipAllocation) { | 
|  | 57 | +void PreemptionHelper::programStateSipCmd(LinearStream &preambleCmdStream, GraphicsAllocation *sipAllocation, bool useFullAddress) { | 
| 54 | 58 |     using STATE_SIP = typename GfxFamily::STATE_SIP; | 
| 55 | 59 | 
 | 
| 56 | 60 |     auto sip = reinterpret_cast<STATE_SIP *>(preambleCmdStream.getSpace(sizeof(STATE_SIP))); | 
| 57 | 61 |     STATE_SIP cmd = GfxFamily::cmdInitStateSip; | 
| 58 |  | -    cmd.setSystemInstructionPointer(sipAllocation->getGpuAddressToPatch()); | 
|  | 62 | +    if (useFullAddress) { | 
|  | 63 | +        cmd.setSystemInstructionPointer(sipAllocation->getGpuAddress()); | 
|  | 64 | + | 
|  | 65 | +    } else { | 
|  | 66 | +        cmd.setSystemInstructionPointer(sipAllocation->getGpuAddressToPatch()); | 
|  | 67 | +    } | 
|  | 68 | + | 
| 59 | 69 |     *sip = cmd; | 
| 60 | 70 | } | 
| 61 | 71 | 
 | 
|  | 
0 commit comments