1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
/*
* Copyright (C) 2021-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/command_container/command_encoder.h"
#include "shared/source/helpers/hw_helper.h"
#include "shared/source/helpers/pipe_control_args.h"
namespace NEO {
template <typename GfxFamily>
inline void MemorySynchronizationCommands<GfxFamily>::setBarrierExtraProperties(void *barrierCmd, PipeControlArgs &args) {
auto &pipeControl = *reinterpret_cast<typename GfxFamily::PIPE_CONTROL *>(barrierCmd);
pipeControl.setHdcPipelineFlush(args.hdcPipelineFlush);
pipeControl.setUnTypedDataPortCacheFlush(args.unTypedDataPortCacheFlush);
pipeControl.setCompressionControlSurfaceCcsFlush(args.compressionControlSurfaceCcsFlush);
pipeControl.setWorkloadPartitionIdOffsetEnable(args.workloadPartitionOffset);
pipeControl.setAmfsFlushEnable(args.amfsFlushEnable);
if (DebugManager.flags.FlushAllCaches.get()) {
pipeControl.setHdcPipelineFlush(true);
pipeControl.setUnTypedDataPortCacheFlush(true);
pipeControl.setCompressionControlSurfaceCcsFlush(true);
}
if (DebugManager.flags.DoNotFlushCaches.get()) {
pipeControl.setHdcPipelineFlush(false);
pipeControl.setUnTypedDataPortCacheFlush(false);
pipeControl.setCompressionControlSurfaceCcsFlush(false);
}
}
template <typename GfxFamily>
inline void MemorySynchronizationCommands<GfxFamily>::setPostSyncExtraProperties(PipeControlArgs &args, const HardwareInfo &hwInfo) {
if (hwInfo.featureTable.flags.ftrLocalMemory) {
args.hdcPipelineFlush = true;
args.unTypedDataPortCacheFlush = true;
}
}
template <typename GfxFamily>
inline void MemorySynchronizationCommands<GfxFamily>::setCacheFlushExtraProperties(PipeControlArgs &args) {
args.hdcPipelineFlush = true;
args.unTypedDataPortCacheFlush = true;
}
template <typename GfxFamily>
void MemorySynchronizationCommands<GfxFamily>::setBarrierWaFlags(void *barrierCmd) {
auto &pipeControl = *reinterpret_cast<typename GfxFamily::PIPE_CONTROL *>(barrierCmd);
pipeControl.setCommandStreamerStallEnable(true);
pipeControl.setHdcPipelineFlush(true);
pipeControl.setUnTypedDataPortCacheFlush(true);
}
template <>
bool HwHelperHw<Family>::isUpdateTaskCountFromWaitSupported() const {
return true;
}
template <>
bool HwHelperHw<Family>::unTypedDataPortCacheFlushRequired() const {
return true;
}
} // namespace NEO
|