mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 05:24:02 +08:00
L3 programming refactor 1/n
- Clean up size estimation functions - Make some tests gen specific Change-Id: If9c15f311306282ba035b380e6d4cadc17584815
This commit is contained in:
committed by
sys_ocldev
parent
588d982989
commit
1392b79b58
@@ -80,8 +80,7 @@ inline void CommandStreamReceiverHw<GfxFamily>::alignToCacheLine(LinearStream &c
|
||||
|
||||
template <typename GfxFamily>
|
||||
size_t getSizeRequiredPreambleCS(const Device &device) {
|
||||
return sizeof(typename GfxFamily::MI_LOAD_REGISTER_IMM) +
|
||||
sizeof(typename GfxFamily::PIPE_CONTROL) +
|
||||
return sizeof(typename GfxFamily::PIPE_CONTROL) +
|
||||
sizeof(typename GfxFamily::MEDIA_VFE_STATE) + PreambleHelper<GfxFamily>::getAdditionalCommandsSize(device);
|
||||
}
|
||||
|
||||
@@ -102,6 +101,14 @@ void CommandStreamReceiverHw<GfxFamily>::programPipelineSelect(LinearStream &com
|
||||
}
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
inline size_t CommandStreamReceiverHw<GfxFamily>::getCmdSizeForPipelineSelect() const {
|
||||
if (csrSizeRequestFlags.mediaSamplerConfigChanged || !isPreambleSent) {
|
||||
return sizeof(typename GfxFamily::PIPELINE_SELECT);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
|
||||
LinearStream &commandStreamTask,
|
||||
@@ -540,16 +547,13 @@ size_t CommandStreamReceiverHw<GfxFamily>::getRequiredCmdStreamSize(const Dispat
|
||||
sizeof(PIPE_CONTROL) +
|
||||
getRequiredPipeControlSize() +
|
||||
sizeof(typename GfxFamily::MI_BATCH_BUFFER_START);
|
||||
if (csrSizeRequestFlags.mediaSamplerConfigChanged || !isPreambleSent) {
|
||||
size += sizeof(typename GfxFamily::PIPELINE_SELECT);
|
||||
}
|
||||
if (csrSizeRequestFlags.l3ConfigChanged && this->isPreambleSent) {
|
||||
size += sizeof(typename GfxFamily::PIPE_CONTROL);
|
||||
}
|
||||
|
||||
size += getCmdSizeForL3Config();
|
||||
size += getCmdSizeForCoherency();
|
||||
size += getCmdSizeForMediaSampler(dispatchFlags.mediaSamplerRequired);
|
||||
size += getCmdSizeForPipelineSelect();
|
||||
size += getCmdSizeForPreemption(dispatchFlags);
|
||||
|
||||
size += PreemptionHelper::getRequiredCmdStreamSize<GfxFamily>(dispatchFlags.preemptionMode, this->lastPreemptionMode);
|
||||
if (getMemoryManager()->device->getWaTable()->waSamplerCacheFlushBetweenRedescribedSurfaceReads) {
|
||||
if (this->samplerCacheFlushRequired != SamplerCacheFlushState::samplerCacheFlushNotRequired) {
|
||||
size += sizeof(typename GfxFamily::PIPE_CONTROL);
|
||||
@@ -591,6 +595,11 @@ inline void CommandStreamReceiverHw<GfxFamily>::programPreemption(LinearStream &
|
||||
this->lastPreemptionMode = dispatchFlags.preemptionMode;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
inline size_t CommandStreamReceiverHw<GfxFamily>::getCmdSizeForPreemption(const DispatchFlags &dispatchFlags) const {
|
||||
return PreemptionHelper::getRequiredCmdStreamSize<GfxFamily>(dispatchFlags.preemptionMode, this->lastPreemptionMode);
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
inline void CommandStreamReceiverHw<GfxFamily>::programL3(LinearStream &csr, DispatchFlags &dispatchFlags, uint32_t &newL3Config) {
|
||||
typedef typename GfxFamily::PIPE_CONTROL PIPE_CONTROL;
|
||||
@@ -606,6 +615,16 @@ inline void CommandStreamReceiverHw<GfxFamily>::programL3(LinearStream &csr, Dis
|
||||
}
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
inline size_t CommandStreamReceiverHw<GfxFamily>::getCmdSizeForL3Config() const {
|
||||
if (!this->isPreambleSent) {
|
||||
return sizeof(typename GfxFamily::MI_LOAD_REGISTER_IMM);
|
||||
} else if (csrSizeRequestFlags.l3ConfigChanged) {
|
||||
return sizeof(typename GfxFamily::MI_LOAD_REGISTER_IMM) + sizeof(typename GfxFamily::PIPE_CONTROL);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
inline void CommandStreamReceiverHw<GfxFamily>::programPreamble(LinearStream &csr, DispatchFlags &dispatchFlags, uint32_t &newL3Config) {
|
||||
if (!this->isPreambleSent) {
|
||||
|
||||
Reference in New Issue
Block a user