|
6 | 6 | */ |
7 | 7 |
|
8 | 8 | #pragma once |
| 9 | +#include "shared/source/command_container/command_encoder.h" |
| 10 | +#include "shared/source/helpers/hw_helper.h" |
9 | 11 | #include "shared/source/helpers/pause_on_gpu_properties.h" |
10 | 12 | #include "shared/source/memory_manager/internal_allocation_storage.h" |
11 | 13 |
|
|
15 | 17 | #include "opencl/source/helpers/task_information.h" |
16 | 18 | #include "opencl/source/mem_obj/buffer.h" |
17 | 19 |
|
| 20 | +#include "pipe_control_args.h" |
| 21 | + |
18 | 22 | namespace NEO { |
19 | 23 |
|
20 | 24 | template <typename GfxFamily> |
@@ -297,27 +301,23 @@ inline void HardwareInterface<GfxFamily>::dispatchDebugPauseCommands( |
297 | 301 | using PIPE_CONTROL = typename GfxFamily::PIPE_CONTROL; |
298 | 302 | using POST_SYNC_OPERATION = typename PIPE_CONTROL::POST_SYNC_OPERATION; |
299 | 303 |
|
300 | | - auto pCmd = (PIPE_CONTROL *)commandStream->getSpace(sizeof(PIPE_CONTROL)); |
301 | | - *pCmd = GfxFamily::cmdInitPipeControl; |
302 | | - |
303 | | - pCmd->setCommandStreamerStallEnable(true); |
304 | | - pCmd->setDcFlushEnable(true); |
305 | | - pCmd->setAddress(static_cast<uint32_t>(address & 0x0000FFFFFFFFULL)); |
306 | | - pCmd->setAddressHigh(static_cast<uint32_t>(address >> 32)); |
307 | | - pCmd->setPostSyncOperation(POST_SYNC_OPERATION::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA); |
308 | | - pCmd->setImmediateData(static_cast<uint32_t>(confirmationTrigger)); |
| 304 | + PipeControlArgs args(true); |
| 305 | + MemorySynchronizationCommands<GfxFamily>::addPipeControlAndProgramPostSyncOperation( |
| 306 | + *commandStream, |
| 307 | + POST_SYNC_OPERATION::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA, |
| 308 | + address, |
| 309 | + static_cast<uint64_t>(confirmationTrigger), |
| 310 | + commandQueue.getDevice().getHardwareInfo(), |
| 311 | + args); |
309 | 312 | } |
310 | 313 |
|
311 | 314 | { |
312 | 315 | using MI_SEMAPHORE_WAIT = typename GfxFamily::MI_SEMAPHORE_WAIT; |
313 | | - |
314 | | - auto pCmd = (MI_SEMAPHORE_WAIT *)commandStream->getSpace(sizeof(MI_SEMAPHORE_WAIT)); |
315 | | - *pCmd = GfxFamily::cmdInitMiSemaphoreWait; |
316 | | - |
317 | | - pCmd->setCompareOperation(MI_SEMAPHORE_WAIT::COMPARE_OPERATION::COMPARE_OPERATION_SAD_EQUAL_SDD); |
318 | | - pCmd->setSemaphoreDataDword(static_cast<uint32_t>(waitCondition)); |
319 | | - pCmd->setSemaphoreGraphicsAddress(address); |
320 | | - pCmd->setWaitMode(MI_SEMAPHORE_WAIT::WAIT_MODE::WAIT_MODE_POLLING_MODE); |
| 316 | + using COMPARE_OPERATION = typename GfxFamily::MI_SEMAPHORE_WAIT::COMPARE_OPERATION; |
| 317 | + EncodeSempahore<GfxFamily>::addMiSemaphoreWaitCommand(*commandStream, |
| 318 | + address, |
| 319 | + static_cast<uint32_t>(waitCondition), |
| 320 | + COMPARE_OPERATION::COMPARE_OPERATION_SAD_EQUAL_SDD); |
321 | 321 | } |
322 | 322 | } |
323 | 323 | } |
|
0 commit comments