2020-01-15 17:02:47 +01:00
|
|
|
/*
|
2022-07-21 14:28:10 +00:00
|
|
|
* Copyright (C) 2020-2022 Intel Corporation
|
2020-01-15 17:02:47 +01:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/command_stream/linear_stream.h"
|
|
|
|
|
#include "shared/source/command_stream/preemption.h"
|
|
|
|
|
#include "shared/source/direct_submission/dispatchers/render_dispatcher.h"
|
|
|
|
|
#include "shared/source/helpers/hw_helper.h"
|
2021-12-22 14:11:05 +00:00
|
|
|
#include "shared/source/helpers/pipe_control_args.h"
|
2020-04-26 21:48:59 +02:00
|
|
|
|
2020-01-15 17:02:47 +01:00
|
|
|
namespace NEO {
|
|
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
2020-03-03 23:33:31 +01:00
|
|
|
inline void RenderDispatcher<GfxFamily>::dispatchPreemption(LinearStream &cmdBuffer) {
|
2020-01-15 17:02:47 +01:00
|
|
|
PreemptionHelper::programCmdStream<GfxFamily>(cmdBuffer, PreemptionMode::MidBatch, PreemptionMode::Disabled, nullptr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
2020-03-03 23:33:31 +01:00
|
|
|
inline size_t RenderDispatcher<GfxFamily>::getSizePreemption() {
|
2020-01-15 17:02:47 +01:00
|
|
|
size_t size = PreemptionHelper::getRequiredCmdStreamSize<GfxFamily>(PreemptionMode::MidBatch, PreemptionMode::Disabled);
|
|
|
|
|
return size;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
2020-03-03 23:33:31 +01:00
|
|
|
inline void RenderDispatcher<GfxFamily>::dispatchMonitorFence(LinearStream &cmdBuffer,
|
|
|
|
|
uint64_t gpuAddress,
|
|
|
|
|
uint64_t immediateData,
|
2021-06-17 11:55:28 +00:00
|
|
|
const HardwareInfo &hwInfo,
|
2021-09-27 23:27:46 +00:00
|
|
|
bool useNotifyEnable,
|
|
|
|
|
bool partitionedWorkload) {
|
2021-12-20 21:37:45 +00:00
|
|
|
PipeControlArgs args;
|
2021-12-22 14:25:58 +00:00
|
|
|
args.dcFlushEnable = MemorySynchronizationCommands<GfxFamily>::getDcFlushEnable(true, hwInfo);
|
2021-09-27 23:27:46 +00:00
|
|
|
args.workloadPartitionOffset = partitionedWorkload;
|
2021-12-22 19:28:02 +00:00
|
|
|
args.notifyEnable = useNotifyEnable;
|
2022-07-21 14:28:10 +00:00
|
|
|
MemorySynchronizationCommands<GfxFamily>::addBarrierWithPostSyncOperation(
|
2020-01-15 17:02:47 +01:00
|
|
|
cmdBuffer,
|
2022-07-21 14:28:10 +00:00
|
|
|
PostSyncMode::ImmediateData,
|
2020-01-15 17:02:47 +01:00
|
|
|
gpuAddress,
|
|
|
|
|
immediateData,
|
2020-04-26 21:48:59 +02:00
|
|
|
hwInfo,
|
|
|
|
|
args);
|
2020-01-15 17:02:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
2020-03-03 23:33:31 +01:00
|
|
|
inline size_t RenderDispatcher<GfxFamily>::getSizeMonitorFence(const HardwareInfo &hwInfo) {
|
2022-07-21 14:28:10 +00:00
|
|
|
return MemorySynchronizationCommands<GfxFamily>::getSizeForBarrierWithPostSyncOperation(hwInfo);
|
2020-01-15 17:02:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
2021-07-29 06:40:42 +00:00
|
|
|
inline void RenderDispatcher<GfxFamily>::dispatchCacheFlush(LinearStream &cmdBuffer, const HardwareInfo &hwInfo, uint64_t address) {
|
2021-12-20 14:37:33 +00:00
|
|
|
MemorySynchronizationCommands<GfxFamily>::addFullCacheFlush(cmdBuffer, hwInfo);
|
2020-01-15 17:02:47 +01:00
|
|
|
}
|
|
|
|
|
|
2021-04-14 14:40:23 +00:00
|
|
|
template <typename GfxFamily>
|
2021-12-21 18:13:53 +00:00
|
|
|
inline void RenderDispatcher<GfxFamily>::dispatchTlbFlush(LinearStream &cmdBuffer, uint64_t address, const HardwareInfo &hwInfo) {
|
2021-12-20 21:37:45 +00:00
|
|
|
PipeControlArgs args;
|
2021-04-14 14:40:23 +00:00
|
|
|
args.tlbInvalidation = true;
|
|
|
|
|
args.pipeControlFlushEnable = true;
|
2021-04-26 09:52:45 +00:00
|
|
|
args.textureCacheInvalidationEnable = true;
|
|
|
|
|
|
2022-07-21 14:28:10 +00:00
|
|
|
MemorySynchronizationCommands<GfxFamily>::addSingleBarrier(cmdBuffer, args);
|
2021-04-14 14:40:23 +00:00
|
|
|
}
|
|
|
|
|
|
2020-01-15 17:02:47 +01:00
|
|
|
template <typename GfxFamily>
|
2020-03-03 23:33:31 +01:00
|
|
|
inline size_t RenderDispatcher<GfxFamily>::getSizeCacheFlush(const HardwareInfo &hwInfo) {
|
2020-01-15 17:02:47 +01:00
|
|
|
size_t size = MemorySynchronizationCommands<GfxFamily>::getSizeForFullCacheFlush();
|
|
|
|
|
return size;
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-14 14:40:23 +00:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
inline size_t RenderDispatcher<GfxFamily>::getSizeTlbFlush() {
|
2022-07-21 14:28:10 +00:00
|
|
|
return MemorySynchronizationCommands<GfxFamily>::getSizeForSingleBarrier();
|
2021-04-14 14:40:23 +00:00
|
|
|
}
|
|
|
|
|
|
2020-01-15 17:02:47 +01:00
|
|
|
} // namespace NEO
|