mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 15:53:45 +08:00
refactor: don't use global ProductHelper getter 11/n
Related-To: NEO-6853 Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
fb8c844e00
commit
27393c76ea
@@ -529,7 +529,7 @@ bool DirectSubmissionHw<GfxFamily, Dispatcher>::stopRingBuffer() {
|
||||
if (disableMonitorFence) {
|
||||
TagData currentTagData = {};
|
||||
getTagAddressValue(currentTagData);
|
||||
Dispatcher::dispatchMonitorFence(ringCommandStream, currentTagData.tagAddress, currentTagData.tagValue, *hwInfo,
|
||||
Dispatcher::dispatchMonitorFence(ringCommandStream, currentTagData.tagAddress, currentTagData.tagValue, this->rootDeviceEnvironment,
|
||||
this->useNotifyForPostSync, this->partitionedMode, this->dcFlushRequired);
|
||||
}
|
||||
Dispatcher::dispatchStopCommandBuffer(ringCommandStream);
|
||||
@@ -604,7 +604,7 @@ inline void DirectSubmissionHw<GfxFamily, Dispatcher>::dispatchSwitchRingBufferS
|
||||
if (disableMonitorFence) {
|
||||
TagData currentTagData = {};
|
||||
getTagAddressValue(currentTagData);
|
||||
Dispatcher::dispatchMonitorFence(ringCommandStream, currentTagData.tagAddress, currentTagData.tagValue, *hwInfo,
|
||||
Dispatcher::dispatchMonitorFence(ringCommandStream, currentTagData.tagAddress, currentTagData.tagValue, this->rootDeviceEnvironment,
|
||||
this->useNotifyForPostSync, this->partitionedMode, this->dcFlushRequired);
|
||||
}
|
||||
Dispatcher::dispatchStartCommandBuffer(ringCommandStream, nextBufferGpuAddress);
|
||||
@@ -717,7 +717,7 @@ void *DirectSubmissionHw<GfxFamily, Dispatcher>::dispatchWorkloadSection(BatchBu
|
||||
if (!disableMonitorFence) {
|
||||
TagData currentTagData = {};
|
||||
getTagAddressValue(currentTagData);
|
||||
Dispatcher::dispatchMonitorFence(ringCommandStream, currentTagData.tagAddress, currentTagData.tagValue, *hwInfo,
|
||||
Dispatcher::dispatchMonitorFence(ringCommandStream, currentTagData.tagAddress, currentTagData.tagValue, this->rootDeviceEnvironment,
|
||||
this->useNotifyForPostSync, this->partitionedMode, this->dcFlushRequired);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
namespace NEO {
|
||||
|
||||
struct RootDeviceEnvironment;
|
||||
class ProductHelper;
|
||||
|
||||
template <typename GfxFamily>
|
||||
class BlitterDispatcher : public Dispatcher<GfxFamily> {
|
||||
@@ -21,14 +22,14 @@ class BlitterDispatcher : public Dispatcher<GfxFamily> {
|
||||
static void dispatchMonitorFence(LinearStream &cmdBuffer,
|
||||
uint64_t gpuAddress,
|
||||
uint64_t immediateData,
|
||||
const HardwareInfo &hwInfo,
|
||||
const RootDeviceEnvironment &rootDeviceEnvironment,
|
||||
bool useNotifyEnable,
|
||||
bool partitionedWorkload,
|
||||
bool dcFlushRequired);
|
||||
static size_t getSizeMonitorFence(const HardwareInfo &hwInfo);
|
||||
|
||||
static void dispatchCacheFlush(LinearStream &cmdBuffer, const RootDeviceEnvironment &rootDeviceEnvironment, uint64_t address);
|
||||
static void dispatchTlbFlush(LinearStream &cmdBuffer, uint64_t address, const HardwareInfo &hwInfo);
|
||||
static void dispatchTlbFlush(LinearStream &cmdBuffer, uint64_t address, const ProductHelper &productHelper);
|
||||
static size_t getSizeCacheFlush(const HardwareInfo &hwInfo);
|
||||
static size_t getSizeTlbFlush();
|
||||
static bool isMultiTileSynchronizationSupported() {
|
||||
|
||||
@@ -27,14 +27,15 @@ template <typename GfxFamily>
|
||||
inline void BlitterDispatcher<GfxFamily>::dispatchMonitorFence(LinearStream &cmdBuffer,
|
||||
uint64_t gpuAddress,
|
||||
uint64_t immediateData,
|
||||
const HardwareInfo &hwInfo,
|
||||
const RootDeviceEnvironment &rootDeviceEnvironment,
|
||||
bool useNotifyEnable,
|
||||
bool partitionedWorkload,
|
||||
bool dcFlushRequired) {
|
||||
MiFlushArgs args;
|
||||
args.commandWithPostSync = true;
|
||||
args.notifyEnable = useNotifyEnable;
|
||||
EncodeMiFlushDW<GfxFamily>::programMiFlushDw(cmdBuffer, gpuAddress, immediateData, args, hwInfo);
|
||||
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
|
||||
EncodeMiFlushDW<GfxFamily>::programMiFlushDw(cmdBuffer, gpuAddress, immediateData, args, productHelper);
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
@@ -45,17 +46,17 @@ inline size_t BlitterDispatcher<GfxFamily>::getSizeMonitorFence(const HardwareIn
|
||||
|
||||
template <typename GfxFamily>
|
||||
inline void BlitterDispatcher<GfxFamily>::dispatchCacheFlush(LinearStream &cmdBuffer, const RootDeviceEnvironment &rootDeviceEnvironment, uint64_t address) {
|
||||
auto &hwInfo = *rootDeviceEnvironment.getHardwareInfo();
|
||||
|
||||
dispatchTlbFlush(cmdBuffer, address, hwInfo);
|
||||
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
|
||||
dispatchTlbFlush(cmdBuffer, address, productHelper);
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
inline void BlitterDispatcher<GfxFamily>::dispatchTlbFlush(LinearStream &cmdBuffer, uint64_t address, const HardwareInfo &hwInfo) {
|
||||
inline void BlitterDispatcher<GfxFamily>::dispatchTlbFlush(LinearStream &cmdBuffer, uint64_t address, const ProductHelper &productHelper) {
|
||||
MiFlushArgs args;
|
||||
args.tlbFlush = true;
|
||||
args.commandWithPostSync = true;
|
||||
EncodeMiFlushDW<GfxFamily>::programMiFlushDw(cmdBuffer, address, 0ull, args, hwInfo);
|
||||
EncodeMiFlushDW<GfxFamily>::programMiFlushDw(cmdBuffer, address, 0ull, args, productHelper);
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
namespace NEO {
|
||||
|
||||
struct RootDeviceEnvironment;
|
||||
class ProductHelper;
|
||||
|
||||
template <typename GfxFamily>
|
||||
class RenderDispatcher : public Dispatcher<GfxFamily> {
|
||||
@@ -21,14 +22,14 @@ class RenderDispatcher : public Dispatcher<GfxFamily> {
|
||||
static void dispatchMonitorFence(LinearStream &cmdBuffer,
|
||||
uint64_t gpuAddress,
|
||||
uint64_t immediateData,
|
||||
const HardwareInfo &hwInfo,
|
||||
const RootDeviceEnvironment &rootDeviceEnvironment,
|
||||
bool useNotifyEnable,
|
||||
bool partitionedWorkload,
|
||||
bool dcFlushRequired);
|
||||
static size_t getSizeMonitorFence(const HardwareInfo &hwInfo);
|
||||
|
||||
static void dispatchCacheFlush(LinearStream &cmdBuffer, const RootDeviceEnvironment &rootDeviceEnvironment, uint64_t address);
|
||||
static void dispatchTlbFlush(LinearStream &cmdBuffer, uint64_t address, const HardwareInfo &hwInfo);
|
||||
static void dispatchTlbFlush(LinearStream &cmdBuffer, uint64_t address, const ProductHelper &productHelper);
|
||||
static size_t getSizeCacheFlush(const HardwareInfo &hwInfo);
|
||||
static size_t getSizeTlbFlush();
|
||||
static bool isMultiTileSynchronizationSupported() {
|
||||
|
||||
@@ -28,7 +28,7 @@ template <typename GfxFamily>
|
||||
inline void RenderDispatcher<GfxFamily>::dispatchMonitorFence(LinearStream &cmdBuffer,
|
||||
uint64_t gpuAddress,
|
||||
uint64_t immediateData,
|
||||
const HardwareInfo &hwInfo,
|
||||
const RootDeviceEnvironment &rootDeviceEnvironment,
|
||||
bool useNotifyEnable,
|
||||
bool partitionedWorkload,
|
||||
bool dcFlushRequired) {
|
||||
@@ -36,6 +36,8 @@ inline void RenderDispatcher<GfxFamily>::dispatchMonitorFence(LinearStream &cmdB
|
||||
args.dcFlushEnable = dcFlushRequired;
|
||||
args.workloadPartitionOffset = partitionedWorkload;
|
||||
args.notifyEnable = useNotifyEnable;
|
||||
|
||||
auto &hwInfo = *rootDeviceEnvironment.getHardwareInfo();
|
||||
MemorySynchronizationCommands<GfxFamily>::addBarrierWithPostSyncOperation(
|
||||
cmdBuffer,
|
||||
PostSyncMode::ImmediateData,
|
||||
@@ -56,7 +58,7 @@ inline void RenderDispatcher<GfxFamily>::dispatchCacheFlush(LinearStream &cmdBuf
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
inline void RenderDispatcher<GfxFamily>::dispatchTlbFlush(LinearStream &cmdBuffer, uint64_t address, const HardwareInfo &hwInfo) {
|
||||
inline void RenderDispatcher<GfxFamily>::dispatchTlbFlush(LinearStream &cmdBuffer, uint64_t address, const ProductHelper &productHelper) {
|
||||
PipeControlArgs args;
|
||||
args.tlbInvalidation = true;
|
||||
args.pipeControlFlushEnable = true;
|
||||
|
||||
@@ -179,7 +179,8 @@ void DrmDirectSubmission<GfxFamily, Dispatcher>::handleNewResourcesSubmission()
|
||||
auto osContextLinux = static_cast<OsContextLinux *>(&this->osContext);
|
||||
auto tlbFlushCounter = osContextLinux->peekTlbFlushCounter();
|
||||
|
||||
Dispatcher::dispatchTlbFlush(this->ringCommandStream, this->gpuVaForMiFlush, *this->hwInfo);
|
||||
auto &productHelper = this->rootDeviceEnvironment.template getHelper<ProductHelper>();
|
||||
Dispatcher::dispatchTlbFlush(this->ringCommandStream, this->gpuVaForMiFlush, productHelper);
|
||||
osContextLinux->setTlbFlushed(tlbFlushCounter);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user