2020-01-15 17:02:47 +01:00
|
|
|
/*
|
2023-01-20 03:04:15 +00:00
|
|
|
* Copyright (C) 2020-2023 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"
|
2023-02-01 16:23:01 +00:00
|
|
|
#include "shared/source/helpers/gfx_core_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,
|
2023-01-25 19:28:09 +00:00
|
|
|
const RootDeviceEnvironment &rootDeviceEnvironment,
|
2021-09-27 23:27:46 +00:00
|
|
|
bool useNotifyEnable,
|
2022-10-11 18:47:13 +00:00
|
|
|
bool partitionedWorkload,
|
|
|
|
|
bool dcFlushRequired) {
|
2021-12-20 21:37:45 +00:00
|
|
|
PipeControlArgs args;
|
2022-10-11 18:47:13 +00:00
|
|
|
args.dcFlushEnable = dcFlushRequired;
|
2021-09-27 23:27:46 +00:00
|
|
|
args.workloadPartitionOffset = partitionedWorkload;
|
2021-12-22 19:28:02 +00:00
|
|
|
args.notifyEnable = useNotifyEnable;
|
2023-07-31 16:34:45 +00:00
|
|
|
args.tlbInvalidation = true;
|
2023-08-07 10:49:03 +00:00
|
|
|
args.textureCacheInvalidationEnable = true;
|
2023-01-25 19:28:09 +00:00
|
|
|
|
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,
|
2023-01-26 03:58:18 +00:00
|
|
|
rootDeviceEnvironment,
|
2020-04-26 21:48:59 +02:00
|
|
|
args);
|
2020-01-15 17:02:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
2023-01-26 03:58:18 +00:00
|
|
|
inline size_t RenderDispatcher<GfxFamily>::getSizeMonitorFence(const RootDeviceEnvironment &rootDeviceEnvironment) {
|
|
|
|
|
return MemorySynchronizationCommands<GfxFamily>::getSizeForBarrierWithPostSyncOperation(rootDeviceEnvironment, false);
|
2020-01-15 17:02:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
2023-01-20 03:04:15 +00:00
|
|
|
inline void RenderDispatcher<GfxFamily>::dispatchCacheFlush(LinearStream &cmdBuffer, const RootDeviceEnvironment &rootDeviceEnvironment, uint64_t address) {
|
|
|
|
|
MemorySynchronizationCommands<GfxFamily>::addFullCacheFlush(cmdBuffer, rootDeviceEnvironment);
|
2020-01-15 17:02:47 +01:00
|
|
|
}
|
|
|
|
|
|
2021-04-14 14:40:23 +00:00
|
|
|
template <typename GfxFamily>
|
2023-03-06 12:42:09 +00:00
|
|
|
inline void RenderDispatcher<GfxFamily>::dispatchTlbFlush(LinearStream &cmdBuffer, uint64_t address, const RootDeviceEnvironment &rootDeviceEnvironment) {
|
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>
|
2023-03-06 12:42:09 +00:00
|
|
|
inline size_t RenderDispatcher<GfxFamily>::getSizeCacheFlush(const RootDeviceEnvironment &rootDeviceEnvironment) {
|
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>
|
2023-03-06 12:42:09 +00:00
|
|
|
inline size_t RenderDispatcher<GfxFamily>::getSizeTlbFlush(const RootDeviceEnvironment &rootDeviceEnvironment) {
|
2022-08-19 15:56:22 +00:00
|
|
|
return MemorySynchronizationCommands<GfxFamily>::getSizeForSingleBarrier(true);
|
2021-04-14 14:40:23 +00:00
|
|
|
}
|
|
|
|
|
|
2020-01-15 17:02:47 +01:00
|
|
|
} // namespace NEO
|