2021-05-18 10:46:21 +08:00
|
|
|
/*
|
2022-02-11 07:33:40 +08:00
|
|
|
* Copyright (C) 2021-2022 Intel Corporation
|
2021-05-18 10:46:21 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "shared/source/command_stream/stream_properties.h"
|
|
|
|
|
2022-03-08 04:29:02 +08:00
|
|
|
#include "shared/source/command_stream/thread_arbitration_policy.h"
|
2022-05-18 03:04:23 +08:00
|
|
|
#include "shared/source/debug_settings/debug_settings_manager.h"
|
2022-11-10 17:37:42 +08:00
|
|
|
#include "shared/source/helpers/hw_helper.h"
|
2021-07-07 21:34:46 +08:00
|
|
|
#include "shared/source/kernel/grf_config.h"
|
2022-04-26 22:28:18 +08:00
|
|
|
#include "shared/source/os_interface/hw_info_config.h"
|
2021-07-07 21:34:46 +08:00
|
|
|
|
2021-05-18 10:46:21 +08:00
|
|
|
using namespace NEO;
|
|
|
|
|
2022-06-23 23:25:10 +08:00
|
|
|
void StateComputeModeProperties::setProperties(bool requiresCoherency, uint32_t numGrfRequired, int32_t threadArbitrationPolicy, PreemptionMode devicePreemptionMode,
|
2022-03-08 04:29:02 +08:00
|
|
|
const HardwareInfo &hwInfo) {
|
2022-04-26 22:28:18 +08:00
|
|
|
|
2022-08-23 12:02:33 +08:00
|
|
|
if (this->propertiesSupportLoaded == false) {
|
2022-12-13 00:43:41 +08:00
|
|
|
auto &productHelper = *ProductHelper::get(hwInfo.platform.eProductFamily);
|
|
|
|
productHelper.fillScmPropertiesSupportStructure(this->scmPropertiesSupport);
|
2022-08-23 12:02:33 +08:00
|
|
|
this->propertiesSupportLoaded = true;
|
|
|
|
}
|
|
|
|
|
2022-12-08 20:22:35 +08:00
|
|
|
auto &gfxCoreHelper = GfxCoreHelper::get(hwInfo.platform.eRenderCoreFamily);
|
2021-05-26 21:51:11 +08:00
|
|
|
clearIsDirty();
|
2021-05-18 10:46:21 +08:00
|
|
|
|
2022-08-23 12:02:33 +08:00
|
|
|
if (this->scmPropertiesSupport.coherencyRequired) {
|
|
|
|
int32_t isCoherencyRequired = (requiresCoherency ? 1 : 0);
|
|
|
|
this->isCoherencyRequired.set(isCoherencyRequired);
|
|
|
|
}
|
2021-07-07 21:34:46 +08:00
|
|
|
|
2022-08-23 12:02:33 +08:00
|
|
|
if (this->scmPropertiesSupport.largeGrfMode &&
|
2022-08-23 12:02:33 +08:00
|
|
|
(this->largeGrfMode.value == -1 || numGrfRequired != GrfConfig::NotApplicable)) {
|
2022-03-15 00:40:32 +08:00
|
|
|
int32_t largeGrfMode = (numGrfRequired == GrfConfig::LargeGrfNumber ? 1 : 0);
|
|
|
|
this->largeGrfMode.set(largeGrfMode);
|
|
|
|
}
|
2021-11-19 21:38:23 +08:00
|
|
|
|
|
|
|
int32_t zPassAsyncComputeThreadLimit = -1;
|
|
|
|
if (DebugManager.flags.ForceZPassAsyncComputeThreadLimit.get() != -1) {
|
|
|
|
zPassAsyncComputeThreadLimit = DebugManager.flags.ForceZPassAsyncComputeThreadLimit.get();
|
|
|
|
}
|
2022-08-23 12:02:33 +08:00
|
|
|
if (zPassAsyncComputeThreadLimit != -1 && this->scmPropertiesSupport.zPassAsyncComputeThreadLimit) {
|
|
|
|
this->zPassAsyncComputeThreadLimit.set(zPassAsyncComputeThreadLimit);
|
|
|
|
}
|
2021-11-19 21:38:23 +08:00
|
|
|
|
|
|
|
int32_t pixelAsyncComputeThreadLimit = -1;
|
|
|
|
if (DebugManager.flags.ForcePixelAsyncComputeThreadLimit.get() != -1) {
|
|
|
|
pixelAsyncComputeThreadLimit = DebugManager.flags.ForcePixelAsyncComputeThreadLimit.get();
|
|
|
|
}
|
2022-08-23 12:02:33 +08:00
|
|
|
if (pixelAsyncComputeThreadLimit != -1 && this->scmPropertiesSupport.pixelAsyncComputeThreadLimit) {
|
|
|
|
this->pixelAsyncComputeThreadLimit.set(pixelAsyncComputeThreadLimit);
|
|
|
|
}
|
2021-12-07 19:46:24 +08:00
|
|
|
|
2022-03-08 04:29:02 +08:00
|
|
|
bool setDefaultThreadArbitrationPolicy = (threadArbitrationPolicy == ThreadArbitrationPolicy::NotPresent) &&
|
|
|
|
(NEO::DebugManager.flags.ForceDefaultThreadArbitrationPolicyIfNotSpecified.get() ||
|
|
|
|
(this->threadArbitrationPolicy.value == ThreadArbitrationPolicy::NotPresent));
|
|
|
|
if (setDefaultThreadArbitrationPolicy) {
|
2022-12-08 20:22:35 +08:00
|
|
|
threadArbitrationPolicy = gfxCoreHelper.getDefaultThreadArbitrationPolicy();
|
2022-03-08 04:29:02 +08:00
|
|
|
}
|
2021-12-07 19:46:24 +08:00
|
|
|
if (DebugManager.flags.OverrideThreadArbitrationPolicy.get() != -1) {
|
2022-03-08 04:29:02 +08:00
|
|
|
threadArbitrationPolicy = DebugManager.flags.OverrideThreadArbitrationPolicy.get();
|
2021-12-07 19:46:24 +08:00
|
|
|
}
|
2022-08-23 12:02:33 +08:00
|
|
|
if (this->scmPropertiesSupport.threadArbitrationPolicy) {
|
2022-05-17 04:34:53 +08:00
|
|
|
this->threadArbitrationPolicy.set(threadArbitrationPolicy);
|
|
|
|
}
|
2022-03-08 21:46:04 +08:00
|
|
|
|
2022-08-23 12:02:33 +08:00
|
|
|
if (this->scmPropertiesSupport.devicePreemptionMode) {
|
2022-06-23 23:25:10 +08:00
|
|
|
this->devicePreemptionMode.set(static_cast<int32_t>(devicePreemptionMode));
|
|
|
|
}
|
|
|
|
|
2022-08-23 12:02:33 +08:00
|
|
|
setPropertiesExtra();
|
2021-05-18 10:46:21 +08:00
|
|
|
}
|
|
|
|
|
2021-05-26 21:51:11 +08:00
|
|
|
void StateComputeModeProperties::setProperties(const StateComputeModeProperties &properties) {
|
|
|
|
clearIsDirty();
|
2021-05-18 10:46:21 +08:00
|
|
|
|
2021-05-26 21:51:11 +08:00
|
|
|
isCoherencyRequired.set(properties.isCoherencyRequired.value);
|
2021-07-07 21:34:46 +08:00
|
|
|
largeGrfMode.set(properties.largeGrfMode.value);
|
2021-11-19 21:38:23 +08:00
|
|
|
zPassAsyncComputeThreadLimit.set(properties.zPassAsyncComputeThreadLimit.value);
|
|
|
|
pixelAsyncComputeThreadLimit.set(properties.pixelAsyncComputeThreadLimit.value);
|
2021-12-07 19:46:24 +08:00
|
|
|
threadArbitrationPolicy.set(properties.threadArbitrationPolicy.value);
|
2022-06-23 23:25:10 +08:00
|
|
|
devicePreemptionMode.set(properties.devicePreemptionMode.value);
|
2022-03-08 21:46:04 +08:00
|
|
|
|
|
|
|
setPropertiesExtra(properties);
|
2021-05-18 10:46:21 +08:00
|
|
|
}
|
|
|
|
|
2021-12-09 19:01:40 +08:00
|
|
|
bool StateComputeModeProperties::isDirty() const {
|
2021-11-19 21:38:23 +08:00
|
|
|
return isCoherencyRequired.isDirty || largeGrfMode.isDirty || zPassAsyncComputeThreadLimit.isDirty ||
|
2022-06-23 23:25:10 +08:00
|
|
|
pixelAsyncComputeThreadLimit.isDirty || threadArbitrationPolicy.isDirty || devicePreemptionMode.isDirty || isDirtyExtra();
|
2021-05-18 10:46:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void StateComputeModeProperties::clearIsDirty() {
|
|
|
|
isCoherencyRequired.isDirty = false;
|
2021-07-07 21:34:46 +08:00
|
|
|
largeGrfMode.isDirty = false;
|
2021-11-19 21:38:23 +08:00
|
|
|
zPassAsyncComputeThreadLimit.isDirty = false;
|
|
|
|
pixelAsyncComputeThreadLimit.isDirty = false;
|
2021-12-07 19:46:24 +08:00
|
|
|
threadArbitrationPolicy.isDirty = false;
|
2022-06-23 23:25:10 +08:00
|
|
|
devicePreemptionMode.isDirty = false;
|
2022-03-08 21:46:04 +08:00
|
|
|
|
|
|
|
clearIsDirtyExtra();
|
2021-05-18 10:46:21 +08:00
|
|
|
}
|
2021-05-26 21:51:11 +08:00
|
|
|
|
2022-08-30 04:06:04 +08:00
|
|
|
void FrontEndProperties::setProperties(bool isCooperativeKernel, bool disableEUFusion, bool disableOverdispatch, int32_t engineInstancedDevice, const HardwareInfo &hwInfo) {
|
|
|
|
if (this->propertiesSupportLoaded == false) {
|
2022-12-13 00:43:41 +08:00
|
|
|
auto &productHelper = *ProductHelper::get(hwInfo.platform.eProductFamily);
|
|
|
|
productHelper.fillFrontEndPropertiesSupportStructure(this->frontEndPropertiesSupport, hwInfo);
|
2022-08-30 04:06:04 +08:00
|
|
|
this->propertiesSupportLoaded = true;
|
|
|
|
}
|
|
|
|
|
2021-07-29 01:17:51 +08:00
|
|
|
clearIsDirty();
|
|
|
|
|
2022-08-30 04:06:04 +08:00
|
|
|
if (this->frontEndPropertiesSupport.computeDispatchAllWalker) {
|
|
|
|
this->computeDispatchAllWalkerEnable.set(isCooperativeKernel);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this->frontEndPropertiesSupport.disableEuFusion) {
|
|
|
|
this->disableEUFusion.set(disableEUFusion);
|
|
|
|
}
|
|
|
|
|
2022-09-13 03:11:56 +08:00
|
|
|
if (this->frontEndPropertiesSupport.disableOverdispatch) {
|
2022-08-30 04:06:04 +08:00
|
|
|
this->disableOverdispatch.set(disableOverdispatch);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this->frontEndPropertiesSupport.singleSliceDispatchCcsMode) {
|
|
|
|
this->singleSliceDispatchCcsMode.set(engineInstancedDevice);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void FrontEndProperties::setPropertySingleSliceDispatchCcsMode(int32_t engineInstancedDevice, const HardwareInfo &hwInfo) {
|
|
|
|
if (this->propertiesSupportLoaded == false) {
|
2022-12-13 00:43:41 +08:00
|
|
|
auto &productHelper = *ProductHelper::get(hwInfo.platform.eProductFamily);
|
|
|
|
productHelper.fillFrontEndPropertiesSupportStructure(this->frontEndPropertiesSupport, hwInfo);
|
2022-08-30 04:06:04 +08:00
|
|
|
this->propertiesSupportLoaded = true;
|
|
|
|
}
|
|
|
|
this->singleSliceDispatchCcsMode.isDirty = false;
|
|
|
|
if (this->frontEndPropertiesSupport.singleSliceDispatchCcsMode) {
|
|
|
|
this->singleSliceDispatchCcsMode.set(engineInstancedDevice);
|
|
|
|
}
|
2021-05-26 21:51:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void FrontEndProperties::setProperties(const FrontEndProperties &properties) {
|
2021-07-29 01:17:51 +08:00
|
|
|
clearIsDirty();
|
|
|
|
|
|
|
|
disableOverdispatch.set(properties.disableOverdispatch.value);
|
2022-02-11 07:33:40 +08:00
|
|
|
disableEUFusion.set(properties.disableEUFusion.value);
|
2021-08-13 22:48:13 +08:00
|
|
|
singleSliceDispatchCcsMode.set(properties.singleSliceDispatchCcsMode.value);
|
2021-12-07 19:46:24 +08:00
|
|
|
computeDispatchAllWalkerEnable.set(properties.computeDispatchAllWalkerEnable.value);
|
2021-05-26 21:51:11 +08:00
|
|
|
}
|
|
|
|
|
2021-12-09 19:01:40 +08:00
|
|
|
bool FrontEndProperties::isDirty() const {
|
2022-03-08 21:46:04 +08:00
|
|
|
return disableOverdispatch.isDirty || disableEUFusion.isDirty || singleSliceDispatchCcsMode.isDirty ||
|
|
|
|
computeDispatchAllWalkerEnable.isDirty;
|
2021-05-26 21:51:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void FrontEndProperties::clearIsDirty() {
|
2022-02-11 07:33:40 +08:00
|
|
|
disableEUFusion.isDirty = false;
|
2021-07-29 01:17:51 +08:00
|
|
|
disableOverdispatch.isDirty = false;
|
2021-08-13 22:48:13 +08:00
|
|
|
singleSliceDispatchCcsMode.isDirty = false;
|
2021-12-07 19:46:24 +08:00
|
|
|
computeDispatchAllWalkerEnable.isDirty = false;
|
2021-05-26 21:51:11 +08:00
|
|
|
}
|
2022-09-13 03:11:56 +08:00
|
|
|
|
|
|
|
void PipelineSelectProperties::setProperties(bool modeSelected, bool mediaSamplerDopClockGate, bool systolicMode, const HardwareInfo &hwInfo) {
|
|
|
|
if (this->propertiesSupportLoaded == false) {
|
2022-12-13 00:43:41 +08:00
|
|
|
auto &productHelper = *ProductHelper::get(hwInfo.platform.eProductFamily);
|
|
|
|
productHelper.fillPipelineSelectPropertiesSupportStructure(this->pipelineSelectPropertiesSupport, hwInfo);
|
2022-09-13 03:11:56 +08:00
|
|
|
this->propertiesSupportLoaded = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
clearIsDirty();
|
|
|
|
|
|
|
|
if (this->pipelineSelectPropertiesSupport.modeSelected) {
|
|
|
|
this->modeSelected.set(modeSelected);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this->pipelineSelectPropertiesSupport.mediaSamplerDopClockGate) {
|
|
|
|
this->mediaSamplerDopClockGate.set(mediaSamplerDopClockGate);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this->pipelineSelectPropertiesSupport.systolicMode) {
|
|
|
|
this->systolicMode.set(systolicMode);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void PipelineSelectProperties::setProperties(const PipelineSelectProperties &properties) {
|
|
|
|
clearIsDirty();
|
|
|
|
|
|
|
|
modeSelected.set(properties.modeSelected.value);
|
|
|
|
mediaSamplerDopClockGate.set(properties.mediaSamplerDopClockGate.value);
|
|
|
|
systolicMode.set(properties.systolicMode.value);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool PipelineSelectProperties::isDirty() const {
|
|
|
|
return modeSelected.isDirty || mediaSamplerDopClockGate.isDirty || systolicMode.isDirty;
|
|
|
|
}
|
|
|
|
|
|
|
|
void PipelineSelectProperties::clearIsDirty() {
|
|
|
|
modeSelected.isDirty = false;
|
|
|
|
mediaSamplerDopClockGate.isDirty = false;
|
|
|
|
systolicMode.isDirty = false;
|
|
|
|
}
|
2022-11-23 01:17:04 +08:00
|
|
|
|
|
|
|
void StateBaseAddressProperties::setProperties(bool globalAtomics, int32_t statelessMocs, int64_t bindingTablePoolBaseAddress,
|
|
|
|
int64_t surfaceStateBaseAddress, size_t surfaceStateSize,
|
|
|
|
int64_t dynamicStateBaseAddress, size_t dynamicStateSize,
|
|
|
|
int64_t indirectObjectBaseAddress, size_t indirectObjectSize, const HardwareInfo &hwInfo) {
|
|
|
|
if (this->propertiesSupportLoaded == false) {
|
2022-12-13 00:43:41 +08:00
|
|
|
auto &productHelper = *ProductHelper::get(hwInfo.platform.eProductFamily);
|
|
|
|
productHelper.fillStateBaseAddressPropertiesSupportStructure(this->stateBaseAddressPropertiesSupport, hwInfo);
|
2022-11-23 01:17:04 +08:00
|
|
|
this->propertiesSupportLoaded = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
clearIsDirty();
|
|
|
|
|
|
|
|
if (this->stateBaseAddressPropertiesSupport.globalAtomics) {
|
|
|
|
this->globalAtomics.set(globalAtomics);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this->stateBaseAddressPropertiesSupport.statelessMocs) {
|
|
|
|
this->statelessMocs.set(statelessMocs);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this->stateBaseAddressPropertiesSupport.bindingTablePoolBaseAddress) {
|
|
|
|
this->bindingTablePoolBaseAddress.set(bindingTablePoolBaseAddress);
|
|
|
|
}
|
|
|
|
|
|
|
|
this->surfaceStateBaseAddress.set(surfaceStateBaseAddress);
|
|
|
|
this->surfaceStateSize.set(surfaceStateSize);
|
|
|
|
this->dynamicStateBaseAddress.set(dynamicStateBaseAddress);
|
|
|
|
this->dynamicStateSize.set(dynamicStateSize);
|
|
|
|
this->indirectObjectBaseAddress.set(indirectObjectBaseAddress);
|
|
|
|
this->indirectObjectSize.set(indirectObjectSize);
|
|
|
|
}
|
|
|
|
|
|
|
|
void StateBaseAddressProperties::setProperties(const StateBaseAddressProperties &properties) {
|
|
|
|
clearIsDirty();
|
|
|
|
|
|
|
|
globalAtomics.set(properties.globalAtomics.value);
|
|
|
|
statelessMocs.set(properties.statelessMocs.value);
|
|
|
|
bindingTablePoolBaseAddress.set(properties.bindingTablePoolBaseAddress.value);
|
|
|
|
|
|
|
|
surfaceStateBaseAddress.set(properties.surfaceStateBaseAddress.value);
|
|
|
|
surfaceStateSize.set(properties.surfaceStateSize.value);
|
|
|
|
dynamicStateBaseAddress.set(properties.dynamicStateBaseAddress.value);
|
|
|
|
dynamicStateSize.set(properties.dynamicStateSize.value);
|
|
|
|
indirectObjectBaseAddress.set(properties.indirectObjectBaseAddress.value);
|
|
|
|
indirectObjectSize.set(properties.indirectObjectSize.value);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool StateBaseAddressProperties::isDirty() const {
|
|
|
|
return globalAtomics.isDirty || statelessMocs.isDirty || bindingTablePoolBaseAddress.isDirty ||
|
|
|
|
surfaceStateBaseAddress.isDirty || surfaceStateSize.isDirty ||
|
|
|
|
dynamicStateBaseAddress.isDirty || dynamicStateSize.isDirty ||
|
|
|
|
indirectObjectBaseAddress.isDirty || indirectObjectSize.isDirty;
|
|
|
|
}
|
|
|
|
|
|
|
|
void StateBaseAddressProperties::clearIsDirty() {
|
|
|
|
globalAtomics.isDirty = false;
|
|
|
|
statelessMocs.isDirty = false;
|
|
|
|
bindingTablePoolBaseAddress.isDirty = false;
|
|
|
|
surfaceStateBaseAddress.isDirty = false;
|
|
|
|
surfaceStateSize.isDirty = false;
|
|
|
|
dynamicStateBaseAddress.isDirty = false;
|
|
|
|
dynamicStateSize.isDirty = false;
|
|
|
|
indirectObjectBaseAddress.isDirty = false;
|
|
|
|
indirectObjectSize.isDirty = false;
|
|
|
|
}
|