Remove HW types from synchronization interface

Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2022-07-21 14:28:10 +00:00
committed by Compute-Runtime-Automation
parent 975e2af781
commit a3903c385e
87 changed files with 459 additions and 502 deletions

View File

@@ -63,4 +63,10 @@ enum class CachePolicy : uint32_t {
WriteBack = 3,
};
enum class PostSyncMode : uint32_t {
NoWrite = 0,
Timestamp = 1,
ImmediateData = 2,
};
} // namespace NEO

View File

@@ -429,66 +429,43 @@ struct LriHelper {
template <typename GfxFamily>
struct MemorySynchronizationCommands {
using PIPE_CONTROL = typename GfxFamily::PIPE_CONTROL;
using POST_SYNC_OPERATION = typename GfxFamily::PIPE_CONTROL::POST_SYNC_OPERATION;
static void addSingleBarrier(LinearStream &commandStream, PostSyncMode postSyncMode, uint64_t gpuAddress, uint64_t immediateData, PipeControlArgs &args);
static void setSingleBarrier(void *commandsBuffer, PostSyncMode postSyncMode, uint64_t gpuAddress, uint64_t immediateData, PipeControlArgs &args);
static void addSingleBarrier(LinearStream &commandStream, PipeControlArgs &args);
static void setSingleBarrier(void *commandsBuffer, PipeControlArgs &args);
static void addPipeControlAndProgramPostSyncOperation(LinearStream &commandStream,
POST_SYNC_OPERATION operation,
uint64_t gpuAddress,
uint64_t immediateData,
const HardwareInfo &hwInfo,
PipeControlArgs &args);
static void setPipeControlAndProgramPostSyncOperation(void *&commandsBuffer,
POST_SYNC_OPERATION operation,
uint64_t gpuAddress,
uint64_t immediateData,
const HardwareInfo &hwInfo,
PipeControlArgs &args);
static void addPipeControlWithPostSync(LinearStream &commandStream,
POST_SYNC_OPERATION operation,
uint64_t gpuAddress,
uint64_t immediateData,
PipeControlArgs &args);
static void setPipeControlWithPostSync(void *&commandsBuffer,
POST_SYNC_OPERATION operation,
uint64_t gpuAddress,
uint64_t immediateData,
PipeControlArgs &args);
static void addBarrierWithPostSyncOperation(LinearStream &commandStream, PostSyncMode postSyncMode, uint64_t gpuAddress, uint64_t immediateData, const HardwareInfo &hwInfo, PipeControlArgs &args);
static void setBarrierWithPostSyncOperation(void *&commandsBuffer, PostSyncMode postSyncMode, uint64_t gpuAddress, uint64_t immediateData, const HardwareInfo &hwInfo, PipeControlArgs &args);
static void setPostSyncExtraProperties(PipeControlArgs &args, const HardwareInfo &hwInfo);
static void setPipeControlWAFlags(PIPE_CONTROL &pipeControl);
static void addPipeControlWA(LinearStream &commandStream, uint64_t gpuAddress, const HardwareInfo &hwInfo);
static void setPipeControlWA(void *&commandsBuffer, uint64_t gpuAddress, const HardwareInfo &hwInfo);
static void addBarrierWa(LinearStream &commandStream, uint64_t gpuAddress, const HardwareInfo &hwInfo);
static void setBarrierWa(void *&commandsBuffer, uint64_t gpuAddress, const HardwareInfo &hwInfo);
static void setBarrierWaFlags(void *barrierCmd);
static void addAdditionalSynchronizationForDirectSubmission(LinearStream &commandStream, uint64_t gpuAddress, bool acquire, const HardwareInfo &hwInfo);
static void addAdditionalSynchronization(LinearStream &commandStream, uint64_t gpuAddress, bool acquire, const HardwareInfo &hwInfo);
static void setAdditionalSynchronization(void *&commandsBuffer, uint64_t gpuAddress, bool acquire, const HardwareInfo &hwInfo);
static void addPipeControl(LinearStream &commandStream, PipeControlArgs &args);
static void setPipeControl(PIPE_CONTROL &pipeControl, PipeControlArgs &args);
static void addPipeControlWithCSStallOnly(LinearStream &commandStream);
static bool getDcFlushEnable(bool isFlushPreferred, const HardwareInfo &hwInfo);
static void addFullCacheFlush(LinearStream &commandStream, const HardwareInfo &hwInfo);
static void setCacheFlushExtraProperties(PipeControlArgs &args);
static size_t getSizeForPipeControlWithPostSyncOperation(const HardwareInfo &hwInfo);
static size_t getSizeForPipeControlWA(const HardwareInfo &hwInfo);
static size_t getSizeForSinglePipeControl();
static size_t getSizeForBarrierWithPostSyncOperation(const HardwareInfo &hwInfo);
static size_t getSizeForBarrierWa(const HardwareInfo &hwInfo);
static size_t getSizeForSingleBarrier();
static size_t getSizeForSingleAdditionalSynchronizationForDirectSubmission(const HardwareInfo &hwInfo);
static size_t getSizeForSingleAdditionalSynchronization(const HardwareInfo &hwInfo);
static size_t getSizeForAdditonalSynchronization(const HardwareInfo &hwInfo);
static size_t getSizeForFullCacheFlush();
static bool isPipeControlWArequired(const HardwareInfo &hwInfo);
static bool isPipeControlPriorToPipelineSelectWArequired(const HardwareInfo &hwInfo);
static bool isBarrierWaRequired(const HardwareInfo &hwInfo);
static bool isBarrierlPriorToPipelineSelectWaRequired(const HardwareInfo &hwInfo);
protected:
static void setPipeControlExtraProperties(PIPE_CONTROL &pipeControl, PipeControlArgs &args);
static void setBarrierExtraProperties(void *barrierCmd, PipeControlArgs &args);
};
union SURFACE_STATE_BUFFER_LENGTH {

View File

@@ -213,107 +213,62 @@ AuxTranslationMode HwHelperHw<Family>::getAuxTranslationMode(const HardwareInfo
}
template <typename GfxFamily>
void MemorySynchronizationCommands<GfxFamily>::addPipeControlAndProgramPostSyncOperation(
LinearStream &commandStream,
POST_SYNC_OPERATION operation,
uint64_t gpuAddress,
uint64_t immediateData,
const HardwareInfo &hwInfo,
PipeControlArgs &args) {
void MemorySynchronizationCommands<GfxFamily>::addBarrierWithPostSyncOperation(LinearStream &commandStream, PostSyncMode postSyncMode, uint64_t gpuAddress, uint64_t immediateData,
const HardwareInfo &hwInfo, PipeControlArgs &args) {
void *commandBuffer = commandStream.getSpace(
MemorySynchronizationCommands<GfxFamily>::getSizeForPipeControlWithPostSyncOperation(hwInfo));
void *commandBuffer = commandStream.getSpace(MemorySynchronizationCommands<GfxFamily>::getSizeForBarrierWithPostSyncOperation(hwInfo));
MemorySynchronizationCommands<GfxFamily>::setPipeControlAndProgramPostSyncOperation(
commandBuffer,
operation,
gpuAddress,
immediateData,
hwInfo,
args);
MemorySynchronizationCommands<GfxFamily>::setBarrierWithPostSyncOperation(commandBuffer, postSyncMode, gpuAddress, immediateData, hwInfo, args);
}
template <typename GfxFamily>
void MemorySynchronizationCommands<GfxFamily>::setPipeControlAndProgramPostSyncOperation(
void MemorySynchronizationCommands<GfxFamily>::setBarrierWithPostSyncOperation(
void *&commandsBuffer,
POST_SYNC_OPERATION operation,
PostSyncMode postSyncMode,
uint64_t gpuAddress,
uint64_t immediateData,
const HardwareInfo &hwInfo,
PipeControlArgs &args) {
MemorySynchronizationCommands<GfxFamily>::setPipeControlWA(commandsBuffer, gpuAddress, hwInfo);
MemorySynchronizationCommands<GfxFamily>::setBarrierWa(commandsBuffer, gpuAddress, hwInfo);
setPostSyncExtraProperties(args, hwInfo);
MemorySynchronizationCommands<GfxFamily>::setPipeControlWithPostSync(commandsBuffer, operation, gpuAddress, immediateData, args);
MemorySynchronizationCommands<GfxFamily>::setSingleBarrier(commandsBuffer, postSyncMode, gpuAddress, immediateData, args);
commandsBuffer = ptrOffset(commandsBuffer, getSizeForSingleBarrier());
MemorySynchronizationCommands<GfxFamily>::setAdditionalSynchronization(commandsBuffer, gpuAddress, false, hwInfo);
}
template <typename GfxFamily>
void MemorySynchronizationCommands<GfxFamily>::setPipeControlWithPostSync(void *&commandsBuffer,
POST_SYNC_OPERATION operation,
uint64_t gpuAddress,
uint64_t immediateData,
PipeControlArgs &args) {
void MemorySynchronizationCommands<GfxFamily>::addSingleBarrier(LinearStream &commandStream, PipeControlArgs &args) {
addSingleBarrier(commandStream, PostSyncMode::NoWrite, 0, 0, args);
}
template <typename GfxFamily>
void MemorySynchronizationCommands<GfxFamily>::setSingleBarrier(void *commandsBuffer, PipeControlArgs &args) {
setSingleBarrier(commandsBuffer, PostSyncMode::NoWrite, 0, 0, args);
}
template <typename GfxFamily>
void MemorySynchronizationCommands<GfxFamily>::addSingleBarrier(LinearStream &commandStream, PostSyncMode postSyncMode, uint64_t gpuAddress, uint64_t immediateData, PipeControlArgs &args) {
auto barrier = commandStream.getSpace(MemorySynchronizationCommands<GfxFamily>::getSizeForSingleBarrier());
setSingleBarrier(barrier, postSyncMode, gpuAddress, immediateData, args);
}
template <typename GfxFamily>
void MemorySynchronizationCommands<GfxFamily>::setSingleBarrier(void *commandsBuffer, PostSyncMode postSyncMode, uint64_t gpuAddress, uint64_t immediateData, PipeControlArgs &args) {
using PIPE_CONTROL = typename GfxFamily::PIPE_CONTROL;
PIPE_CONTROL pipeControl = GfxFamily::cmdInitPipeControl;
setPipeControl(pipeControl, args);
pipeControl.setPostSyncOperation(operation);
pipeControl.setAddress(static_cast<uint32_t>(gpuAddress & 0x0000FFFFFFFFULL));
pipeControl.setAddressHigh(static_cast<uint32_t>(gpuAddress >> 32));
if (operation == POST_SYNC_OPERATION::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA) {
pipeControl.setImmediateData(immediateData);
}
*reinterpret_cast<PIPE_CONTROL *>(commandsBuffer) = pipeControl;
commandsBuffer = ptrOffset(commandsBuffer, sizeof(PIPE_CONTROL));
}
template <typename GfxFamily>
void MemorySynchronizationCommands<GfxFamily>::addPipeControlWithPostSync(
LinearStream &commandStream,
POST_SYNC_OPERATION operation,
uint64_t gpuAddress,
uint64_t immediateData,
PipeControlArgs &args) {
void *pipeControl = commandStream.getSpace(sizeof(PIPE_CONTROL));
setPipeControlWithPostSync(pipeControl, operation, gpuAddress, immediateData, args);
}
template <typename GfxFamily>
void MemorySynchronizationCommands<GfxFamily>::addPipeControlWA(LinearStream &commandStream, uint64_t gpuAddress, const HardwareInfo &hwInfo) {
size_t requiredSize = MemorySynchronizationCommands<GfxFamily>::getSizeForPipeControlWA(hwInfo);
void *commandBuffer = commandStream.getSpace(requiredSize);
setPipeControlWA(commandBuffer, gpuAddress, hwInfo);
}
template <typename GfxFamily>
void MemorySynchronizationCommands<GfxFamily>::setPipeControlWA(void *&commandsBuffer, uint64_t gpuAddress, const HardwareInfo &hwInfo) {
if (MemorySynchronizationCommands<GfxFamily>::isPipeControlWArequired(hwInfo)) {
PIPE_CONTROL cmd = GfxFamily::cmdInitPipeControl;
MemorySynchronizationCommands<GfxFamily>::setPipeControlWAFlags(cmd);
*reinterpret_cast<PIPE_CONTROL *>(commandsBuffer) = cmd;
commandsBuffer = ptrOffset(commandsBuffer, sizeof(PIPE_CONTROL));
MemorySynchronizationCommands<GfxFamily>::setAdditionalSynchronization(commandsBuffer, gpuAddress, false, hwInfo);
}
}
template <typename GfxFamily>
void MemorySynchronizationCommands<GfxFamily>::addAdditionalSynchronization(LinearStream &commandStream, uint64_t gpuAddress, bool acquire, const HardwareInfo &hwInfo) {
size_t requiredSize = MemorySynchronizationCommands<GfxFamily>::getSizeForSingleAdditionalSynchronization(hwInfo);
void *commandBuffer = commandStream.getSpace(requiredSize);
setAdditionalSynchronization(commandBuffer, gpuAddress, acquire, hwInfo);
}
template <typename GfxFamily>
void MemorySynchronizationCommands<GfxFamily>::addAdditionalSynchronizationForDirectSubmission(LinearStream &commandStream, uint64_t gpuAddress, bool acquire, const HardwareInfo &hwInfo) {
MemorySynchronizationCommands<GfxFamily>::addAdditionalSynchronization(commandStream, gpuAddress, acquire, hwInfo);
}
template <typename GfxFamily>
void MemorySynchronizationCommands<GfxFamily>::setPipeControl(typename GfxFamily::PIPE_CONTROL &pipeControl, PipeControlArgs &args) {
pipeControl.setCommandStreamerStallEnable(true);
if (args.csStallOnly) {
*reinterpret_cast<PIPE_CONTROL *>(commandsBuffer) = pipeControl;
return;
}
pipeControl.setConstantCacheInvalidationEnable(args.constantCacheInvalidationEnable);
pipeControl.setInstructionCacheInvalidateEnable(args.instructionCacheInvalidateEnable);
pipeControl.setPipeControlFlushEnable(args.pipeControlFlushEnable);
@@ -331,7 +286,7 @@ void MemorySynchronizationCommands<GfxFamily>::setPipeControl(typename GfxFamily
if constexpr (GfxFamily::isUsingGenericMediaStateClear) {
pipeControl.setGenericMediaStateClear(args.genericMediaStateClear);
}
setPipeControlExtraProperties(pipeControl, args);
setBarrierExtraProperties(&pipeControl, args);
if (DebugManager.flags.FlushAllCaches.get()) {
pipeControl.setDcFlushEnable(true);
@@ -354,6 +309,53 @@ void MemorySynchronizationCommands<GfxFamily>::setPipeControl(typename GfxFamily
pipeControl.setConstantCacheInvalidationEnable(false);
pipeControl.setStateCacheInvalidationEnable(false);
}
if (postSyncMode != PostSyncMode::NoWrite) {
pipeControl.setAddress(static_cast<uint32_t>(gpuAddress & 0x0000FFFFFFFFULL));
pipeControl.setAddressHigh(static_cast<uint32_t>(gpuAddress >> 32));
}
if (postSyncMode == PostSyncMode::Timestamp) {
pipeControl.setPostSyncOperation(PIPE_CONTROL::POST_SYNC_OPERATION::POST_SYNC_OPERATION_WRITE_TIMESTAMP);
} else if (postSyncMode == PostSyncMode::ImmediateData) {
pipeControl.setPostSyncOperation(PIPE_CONTROL::POST_SYNC_OPERATION::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA);
pipeControl.setImmediateData(immediateData);
}
*reinterpret_cast<PIPE_CONTROL *>(commandsBuffer) = pipeControl;
}
template <typename GfxFamily>
void MemorySynchronizationCommands<GfxFamily>::addBarrierWa(LinearStream &commandStream, uint64_t gpuAddress, const HardwareInfo &hwInfo) {
size_t requiredSize = MemorySynchronizationCommands<GfxFamily>::getSizeForBarrierWa(hwInfo);
void *commandBuffer = commandStream.getSpace(requiredSize);
setBarrierWa(commandBuffer, gpuAddress, hwInfo);
}
template <typename GfxFamily>
void MemorySynchronizationCommands<GfxFamily>::setBarrierWa(void *&commandsBuffer, uint64_t gpuAddress, const HardwareInfo &hwInfo) {
using PIPE_CONTROL = typename GfxFamily::PIPE_CONTROL;
if (MemorySynchronizationCommands<GfxFamily>::isBarrierWaRequired(hwInfo)) {
PIPE_CONTROL cmd = GfxFamily::cmdInitPipeControl;
MemorySynchronizationCommands<GfxFamily>::setBarrierWaFlags(&cmd);
*reinterpret_cast<PIPE_CONTROL *>(commandsBuffer) = cmd;
commandsBuffer = ptrOffset(commandsBuffer, sizeof(PIPE_CONTROL));
MemorySynchronizationCommands<GfxFamily>::setAdditionalSynchronization(commandsBuffer, gpuAddress, false, hwInfo);
}
}
template <typename GfxFamily>
void MemorySynchronizationCommands<GfxFamily>::addAdditionalSynchronization(LinearStream &commandStream, uint64_t gpuAddress, bool acquire, const HardwareInfo &hwInfo) {
size_t requiredSize = MemorySynchronizationCommands<GfxFamily>::getSizeForSingleAdditionalSynchronization(hwInfo);
void *commandBuffer = commandStream.getSpace(requiredSize);
setAdditionalSynchronization(commandBuffer, gpuAddress, acquire, hwInfo);
}
template <typename GfxFamily>
void MemorySynchronizationCommands<GfxFamily>::addAdditionalSynchronizationForDirectSubmission(LinearStream &commandStream, uint64_t gpuAddress, bool acquire, const HardwareInfo &hwInfo) {
MemorySynchronizationCommands<GfxFamily>::addAdditionalSynchronization(commandStream, gpuAddress, acquire, hwInfo);
}
template <typename GfxFamily>
@@ -366,41 +368,23 @@ bool MemorySynchronizationCommands<GfxFamily>::getDcFlushEnable(bool isFlushPref
}
template <typename GfxFamily>
void MemorySynchronizationCommands<GfxFamily>::addPipeControl(LinearStream &commandStream, PipeControlArgs &args) {
using PIPE_CONTROL = typename GfxFamily::PIPE_CONTROL;
PIPE_CONTROL cmd = GfxFamily::cmdInitPipeControl;
MemorySynchronizationCommands<GfxFamily>::setPipeControl(cmd, args);
auto pipeControl = commandStream.getSpaceForCmd<PIPE_CONTROL>();
*pipeControl = cmd;
}
template <typename GfxFamily>
void MemorySynchronizationCommands<GfxFamily>::addPipeControlWithCSStallOnly(LinearStream &commandStream) {
using PIPE_CONTROL = typename GfxFamily::PIPE_CONTROL;
PIPE_CONTROL cmd = GfxFamily::cmdInitPipeControl;
cmd.setCommandStreamerStallEnable(true);
auto pipeControl = commandStream.getSpaceForCmd<PIPE_CONTROL>();
*pipeControl = cmd;
}
template <typename GfxFamily>
size_t MemorySynchronizationCommands<GfxFamily>::getSizeForSinglePipeControl() {
size_t MemorySynchronizationCommands<GfxFamily>::getSizeForSingleBarrier() {
return sizeof(typename GfxFamily::PIPE_CONTROL);
}
template <typename GfxFamily>
size_t MemorySynchronizationCommands<GfxFamily>::getSizeForPipeControlWithPostSyncOperation(const HardwareInfo &hwInfo) {
size_t size = getSizeForSinglePipeControl() +
getSizeForPipeControlWA(hwInfo) +
size_t MemorySynchronizationCommands<GfxFamily>::getSizeForBarrierWithPostSyncOperation(const HardwareInfo &hwInfo) {
size_t size = getSizeForSingleBarrier() +
getSizeForBarrierWa(hwInfo) +
getSizeForSingleAdditionalSynchronization(hwInfo);
return size;
}
template <typename GfxFamily>
size_t MemorySynchronizationCommands<GfxFamily>::getSizeForPipeControlWA(const HardwareInfo &hwInfo) {
size_t MemorySynchronizationCommands<GfxFamily>::getSizeForBarrierWa(const HardwareInfo &hwInfo) {
size_t size = 0;
if (MemorySynchronizationCommands<GfxFamily>::isPipeControlWArequired(hwInfo)) {
size = getSizeForSinglePipeControl() +
if (MemorySynchronizationCommands<GfxFamily>::isBarrierWaRequired(hwInfo)) {
size = getSizeForSingleBarrier() +
getSizeForSingleAdditionalSynchronization(hwInfo);
}
return size;
@@ -568,7 +552,7 @@ void MemorySynchronizationCommands<GfxFamily>::addFullCacheFlush(LinearStream &c
args.stateCacheInvalidationEnable = true;
args.tlbInvalidation = true;
MemorySynchronizationCommands<GfxFamily>::setCacheFlushExtraProperties(args);
MemorySynchronizationCommands<GfxFamily>::setPipeControl(cmd, args);
MemorySynchronizationCommands<GfxFamily>::setSingleBarrier(&cmd, args);
*pipeControl = cmd;
}
@@ -611,7 +595,7 @@ bool HwHelperHw<GfxFamily>::isCpuImageTransferPreferred(const HardwareInfo &hwIn
}
template <typename GfxFamily>
bool MemorySynchronizationCommands<GfxFamily>::isPipeControlPriorToPipelineSelectWArequired(const HardwareInfo &hwInfo) {
bool MemorySynchronizationCommands<GfxFamily>::isBarrierlPriorToPipelineSelectWaRequired(const HardwareInfo &hwInfo) {
return false;
}

View File

@@ -129,15 +129,15 @@ inline void MemorySynchronizationCommands<GfxFamily>::setCacheFlushExtraProperti
}
template <typename GfxFamily>
inline void MemorySynchronizationCommands<GfxFamily>::setPipeControlExtraProperties(typename GfxFamily::PIPE_CONTROL &pipeControl, PipeControlArgs &args) {
inline void MemorySynchronizationCommands<GfxFamily>::setBarrierExtraProperties(void *barrierCmd, PipeControlArgs &args) {
}
template <typename GfxFamily>
bool MemorySynchronizationCommands<GfxFamily>::isPipeControlWArequired(const HardwareInfo &hwInfo) { return false; }
bool MemorySynchronizationCommands<GfxFamily>::isBarrierWaRequired(const HardwareInfo &hwInfo) { return false; }
template <typename GfxFamily>
inline void MemorySynchronizationCommands<GfxFamily>::setPipeControlWAFlags(PIPE_CONTROL &pipeControl) {
pipeControl.setCommandStreamerStallEnable(true);
inline void MemorySynchronizationCommands<GfxFamily>::setBarrierWaFlags(void *barrierCmd) {
reinterpret_cast<typename GfxFamily::PIPE_CONTROL *>(barrierCmd)->setCommandStreamerStallEnable(true);
}
template <typename GfxFamily>

View File

@@ -12,7 +12,9 @@
namespace NEO {
template <typename GfxFamily>
inline void MemorySynchronizationCommands<GfxFamily>::setPipeControlExtraProperties(PIPE_CONTROL &pipeControl, PipeControlArgs &args) {
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);
@@ -46,7 +48,9 @@ inline void MemorySynchronizationCommands<GfxFamily>::setCacheFlushExtraProperti
}
template <typename GfxFamily>
void MemorySynchronizationCommands<GfxFamily>::setPipeControlWAFlags(PIPE_CONTROL &pipeControl) {
void MemorySynchronizationCommands<GfxFamily>::setBarrierWaFlags(void *barrierCmd) {
auto &pipeControl = *reinterpret_cast<typename GfxFamily::PIPE_CONTROL *>(barrierCmd);
pipeControl.setCommandStreamerStallEnable(true);
pipeControl.setHdcPipelineFlush(true);
pipeControl.setUnTypedDataPortCacheFlush(true);

View File

@@ -177,7 +177,7 @@ aub_stream::MMIOList HwHelperHw<GfxFamily>::getExtraMmioList(const HardwareInfo
}
template <typename GfxFamily>
bool MemorySynchronizationCommands<GfxFamily>::isPipeControlWArequired(const HardwareInfo &hwInfo) {
bool MemorySynchronizationCommands<GfxFamily>::isBarrierWaRequired(const HardwareInfo &hwInfo) {
if (DebugManager.flags.DisablePipeControlPrecedingPostSyncCommand.get() == 1) {
return hwInfo.featureTable.flags.ftrLocalMemory;
}

View File

@@ -12,6 +12,7 @@ namespace NEO {
struct PipeControlArgs {
PipeControlArgs() = default;
bool csStallOnly = false;
bool dcFlushEnable = false;
bool renderTargetCacheFlushEnable = false;
bool instructionCacheInvalidateEnable = false;

View File

@@ -57,7 +57,7 @@ size_t PreambleHelper<GfxFamily>::getCmdSizeForPipelineSelect(const HardwareInfo
size_t size = 0;
using PIPELINE_SELECT = typename GfxFamily::PIPELINE_SELECT;
size += sizeof(PIPELINE_SELECT);
if (MemorySynchronizationCommands<GfxFamily>::isPipeControlPriorToPipelineSelectWArequired(hwInfo)) {
if (MemorySynchronizationCommands<GfxFamily>::isBarrierlPriorToPipelineSelectWaRequired(hwInfo)) {
size += sizeof(PIPE_CONTROL);
}
return size;

View File

@@ -60,7 +60,7 @@ void PreambleHelper<Family>::programPipelineSelect(LinearStream *pCommandStream,
PipeControlArgs args = {};
args.stateCacheInvalidationEnable = true;
MemorySynchronizationCommands<Family>::addPipeControl(*pCommandStream, args);
MemorySynchronizationCommands<Family>::addSingleBarrier(*pCommandStream, args);
}
auto pCmd = pCommandStream->getSpaceForCmd<PIPELINE_SELECT>();
@@ -81,7 +81,7 @@ void PreambleHelper<Family>::programPipelineSelect(LinearStream *pCommandStream,
if (DebugManager.flags.CleanStateInPreamble.get()) {
PipeControlArgs args = {};
args.stateCacheInvalidationEnable = true;
MemorySynchronizationCommands<Family>::addPipeControl(*pCommandStream, args);
MemorySynchronizationCommands<Family>::addSingleBarrier(*pCommandStream, args);
}
}

View File

@@ -174,8 +174,8 @@ struct TimestampPacketHelper {
PipeControlArgs args;
args.dcFlushEnable = MemorySynchronizationCommands<GfxFamily>::getDcFlushEnable(true, hwInfo);
MemorySynchronizationCommands<GfxFamily>::addPipeControlAndProgramPostSyncOperation(
cmdStream, GfxFamily::PIPE_CONTROL::POST_SYNC_OPERATION::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA,
MemorySynchronizationCommands<GfxFamily>::addBarrierWithPostSyncOperation(
cmdStream, PostSyncMode::ImmediateData,
cacheFlushTimestampPacketGpuAddress, 0, hwInfo, args);
}
@@ -189,7 +189,7 @@ struct TimestampPacketHelper {
size_t size = count * TimestampPacketHelper::getRequiredCmdStreamSizeForNodeDependencyWithBlitEnqueue<GfxFamily>();
if (auxTranslationDirection == AuxTranslationDirection::NonAuxToAux && cacheFlushForBcsRequired) {
size += MemorySynchronizationCommands<GfxFamily>::getSizeForPipeControlWithPostSyncOperation(hwInfo);
size += MemorySynchronizationCommands<GfxFamily>::getSizeForBarrierWithPostSyncOperation(hwInfo);
}
return size;