mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-01 04:23:00 +08:00
Add state properties for state base address command
Related-To: NEO-5019 Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
30a20236f0
commit
cd17c1e9d2
@@ -91,4 +91,35 @@ struct PipelineSelectProperties {
|
||||
bool propertiesSupportLoaded = false;
|
||||
};
|
||||
|
||||
struct StateBaseAddressPropertiesSupport {
|
||||
bool globalAtomics = false;
|
||||
bool statelessMocs = false;
|
||||
bool bindingTablePoolBaseAddress = false;
|
||||
};
|
||||
|
||||
struct StateBaseAddressProperties {
|
||||
StreamProperty64 bindingTablePoolBaseAddress{};
|
||||
StreamProperty64 surfaceStateBaseAddress{};
|
||||
StreamProperty64 dynamicStateBaseAddress{};
|
||||
StreamProperty64 indirectObjectBaseAddress{};
|
||||
StreamPropertySizeT surfaceStateSize{};
|
||||
StreamPropertySizeT dynamicStateSize{};
|
||||
StreamPropertySizeT indirectObjectSize{};
|
||||
StreamProperty globalAtomics{};
|
||||
StreamProperty statelessMocs{};
|
||||
|
||||
void 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);
|
||||
void setProperties(const StateBaseAddressProperties &properties);
|
||||
bool isDirty() const;
|
||||
|
||||
protected:
|
||||
void clearIsDirty();
|
||||
|
||||
StateBaseAddressPropertiesSupport stateBaseAddressPropertiesSupport = {};
|
||||
bool propertiesSupportLoaded = false;
|
||||
};
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -201,3 +201,69 @@ void PipelineSelectProperties::clearIsDirty() {
|
||||
mediaSamplerDopClockGate.isDirty = false;
|
||||
systolicMode.isDirty = false;
|
||||
}
|
||||
|
||||
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) {
|
||||
auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
|
||||
hwInfoConfig.fillStateBaseAddressPropertiesSupportStructure(this->stateBaseAddressPropertiesSupport, hwInfo);
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ struct StreamProperties {
|
||||
StateComputeModeProperties stateComputeMode{};
|
||||
FrontEndProperties frontEndState{};
|
||||
PipelineSelectProperties pipelineSelect{};
|
||||
StateBaseAddressProperties stateBaseAddress{};
|
||||
};
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -8,18 +8,28 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <stddef.h>
|
||||
|
||||
namespace NEO {
|
||||
|
||||
struct StreamProperty {
|
||||
int32_t value = -1;
|
||||
template <typename Type>
|
||||
struct StreamPropertyType {
|
||||
static constexpr Type initValue = static_cast<Type>(-1);
|
||||
|
||||
Type value = initValue;
|
||||
bool isDirty = false;
|
||||
void set(int32_t newValue) {
|
||||
if ((value != newValue) && (newValue != -1)) {
|
||||
void set(Type newValue) {
|
||||
if ((value != newValue) && (newValue != initValue)) {
|
||||
value = newValue;
|
||||
isDirty = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
using StreamProperty32 = StreamPropertyType<int32_t>;
|
||||
using StreamProperty64 = StreamPropertyType<int64_t>;
|
||||
using StreamPropertySizeT = StreamPropertyType<size_t>;
|
||||
|
||||
using StreamProperty = StreamProperty32;
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -47,6 +47,7 @@ struct Gen11 {
|
||||
struct StateBaseAddressStateSupport {
|
||||
static constexpr bool globalAtomics = false;
|
||||
static constexpr bool statelessMocs = true;
|
||||
static constexpr bool bindingTablePoolBaseAddress = false;
|
||||
};
|
||||
|
||||
struct PipelineSelectStateSupport {
|
||||
|
||||
@@ -49,6 +49,7 @@ struct Gen12Lp {
|
||||
struct StateBaseAddressStateSupport {
|
||||
static constexpr bool globalAtomics = false;
|
||||
static constexpr bool statelessMocs = true;
|
||||
static constexpr bool bindingTablePoolBaseAddress = false;
|
||||
};
|
||||
|
||||
struct PipelineSelectStateSupport {
|
||||
|
||||
@@ -49,6 +49,7 @@ struct Gen8 {
|
||||
struct StateBaseAddressStateSupport {
|
||||
static constexpr bool globalAtomics = false;
|
||||
static constexpr bool statelessMocs = true;
|
||||
static constexpr bool bindingTablePoolBaseAddress = false;
|
||||
};
|
||||
|
||||
struct PipelineSelectStateSupport {
|
||||
|
||||
@@ -48,6 +48,7 @@ struct Gen9 {
|
||||
struct StateBaseAddressStateSupport {
|
||||
static constexpr bool globalAtomics = false;
|
||||
static constexpr bool statelessMocs = true;
|
||||
static constexpr bool bindingTablePoolBaseAddress = false;
|
||||
};
|
||||
|
||||
struct PipelineSelectStateSupport {
|
||||
|
||||
@@ -29,6 +29,7 @@ struct FrontEndPropertiesSupport;
|
||||
struct HardwareInfo;
|
||||
struct PipelineSelectArgs;
|
||||
struct PipelineSelectPropertiesSupport;
|
||||
struct StateBaseAddressPropertiesSupport;
|
||||
struct StateComputeModeProperties;
|
||||
struct StateComputeModePropertiesSupport;
|
||||
class HwInfoConfig;
|
||||
@@ -163,8 +164,9 @@ class HwInfoConfig {
|
||||
virtual bool getScmPropertyLargeGrfModeSupport() const = 0;
|
||||
virtual bool getScmPropertyDevicePreemptionModeSupport() const = 0;
|
||||
|
||||
virtual bool getSbaPropertyGlobalAtomicsSupport() const = 0;
|
||||
virtual bool getSbaPropertyStatelessMocsSupport() const = 0;
|
||||
virtual bool getStateBaseAddressPropertyGlobalAtomicsSupport() const = 0;
|
||||
virtual bool getStateBaseAddressPropertyStatelessMocsSupport() const = 0;
|
||||
virtual bool getStateBaseAddressPropertyBindingTablePoolBaseAddressSupport() const = 0;
|
||||
|
||||
virtual bool getPreemptionDbgPropertyPreemptionModeSupport() const = 0;
|
||||
virtual bool getPreemptionDbgPropertyStateSipSupport() const = 0;
|
||||
@@ -177,6 +179,7 @@ class HwInfoConfig {
|
||||
virtual void fillScmPropertiesSupportStructure(StateComputeModePropertiesSupport &propertiesSupport) = 0;
|
||||
virtual void fillFrontEndPropertiesSupportStructure(FrontEndPropertiesSupport &propertiesSupport, const HardwareInfo &hwInfo) = 0;
|
||||
virtual void fillPipelineSelectPropertiesSupportStructure(PipelineSelectPropertiesSupport &propertiesSupport, const HardwareInfo &hwInfo) = 0;
|
||||
virtual void fillStateBaseAddressPropertiesSupportStructure(StateBaseAddressPropertiesSupport &propertiesSupport, const HardwareInfo &hwInfo) = 0;
|
||||
|
||||
MOCKABLE_VIRTUAL ~HwInfoConfig() = default;
|
||||
|
||||
@@ -301,8 +304,9 @@ class HwInfoConfigHw : public HwInfoConfig {
|
||||
bool getScmPropertyLargeGrfModeSupport() const override;
|
||||
bool getScmPropertyDevicePreemptionModeSupport() const override;
|
||||
|
||||
bool getSbaPropertyGlobalAtomicsSupport() const override;
|
||||
bool getSbaPropertyStatelessMocsSupport() const override;
|
||||
bool getStateBaseAddressPropertyGlobalAtomicsSupport() const override;
|
||||
bool getStateBaseAddressPropertyStatelessMocsSupport() const override;
|
||||
bool getStateBaseAddressPropertyBindingTablePoolBaseAddressSupport() const override;
|
||||
|
||||
bool getPreemptionDbgPropertyPreemptionModeSupport() const override;
|
||||
bool getPreemptionDbgPropertyStateSipSupport() const override;
|
||||
@@ -314,6 +318,8 @@ class HwInfoConfigHw : public HwInfoConfig {
|
||||
|
||||
void fillScmPropertiesSupportStructure(StateComputeModePropertiesSupport &propertiesSupport) override;
|
||||
void fillFrontEndPropertiesSupportStructure(FrontEndPropertiesSupport &propertiesSupport, const HardwareInfo &hwInfo) override;
|
||||
void fillPipelineSelectPropertiesSupportStructure(PipelineSelectPropertiesSupport &propertiesSupport, const HardwareInfo &hwInfo) override;
|
||||
void fillStateBaseAddressPropertiesSupportStructure(StateBaseAddressPropertiesSupport &propertiesSupport, const HardwareInfo &hwInfo) override;
|
||||
|
||||
protected:
|
||||
HwInfoConfigHw() = default;
|
||||
@@ -325,7 +331,6 @@ class HwInfoConfigHw : public HwInfoConfig {
|
||||
bool getHostMemCapabilitiesSupported(const HardwareInfo *hwInfo);
|
||||
LocalMemoryAccessMode getDefaultLocalMemoryAccessMode(const HardwareInfo &hwInfo) const override;
|
||||
void fillScmPropertiesSupportStructureBase(StateComputeModePropertiesSupport &propertiesSupport) override;
|
||||
void fillPipelineSelectPropertiesSupportStructure(PipelineSelectPropertiesSupport &propertiesSupport, const HardwareInfo &hwInfo) override;
|
||||
};
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
|
||||
@@ -568,17 +568,30 @@ bool HwInfoConfigHw<gfxProduct>::getScmPropertyDevicePreemptionModeSupport() con
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
bool HwInfoConfigHw<gfxProduct>::getSbaPropertyGlobalAtomicsSupport() const {
|
||||
bool HwInfoConfigHw<gfxProduct>::getStateBaseAddressPropertyGlobalAtomicsSupport() const {
|
||||
using GfxProduct = typename HwMapper<gfxProduct>::GfxProduct;
|
||||
return GfxProduct::StateBaseAddressStateSupport::globalAtomics;
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
bool HwInfoConfigHw<gfxProduct>::getSbaPropertyStatelessMocsSupport() const {
|
||||
bool HwInfoConfigHw<gfxProduct>::getStateBaseAddressPropertyStatelessMocsSupport() const {
|
||||
using GfxProduct = typename HwMapper<gfxProduct>::GfxProduct;
|
||||
return GfxProduct::StateBaseAddressStateSupport::statelessMocs;
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
bool HwInfoConfigHw<gfxProduct>::getStateBaseAddressPropertyBindingTablePoolBaseAddressSupport() const {
|
||||
using GfxProduct = typename HwMapper<gfxProduct>::GfxProduct;
|
||||
return GfxProduct::StateBaseAddressStateSupport::bindingTablePoolBaseAddress;
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
void HwInfoConfigHw<gfxProduct>::fillStateBaseAddressPropertiesSupportStructure(StateBaseAddressPropertiesSupport &propertiesSupport, const HardwareInfo &hwInfo) {
|
||||
propertiesSupport.globalAtomics = getStateBaseAddressPropertyGlobalAtomicsSupport();
|
||||
propertiesSupport.statelessMocs = getStateBaseAddressPropertyStatelessMocsSupport();
|
||||
propertiesSupport.bindingTablePoolBaseAddress = getStateBaseAddressPropertyBindingTablePoolBaseAddressSupport();
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
bool HwInfoConfigHw<gfxProduct>::getPreemptionDbgPropertyPreemptionModeSupport() const {
|
||||
using GfxProduct = typename HwMapper<gfxProduct>::GfxProduct;
|
||||
|
||||
@@ -55,6 +55,7 @@ struct XeHpCore {
|
||||
struct StateBaseAddressStateSupport {
|
||||
static constexpr bool globalAtomics = true;
|
||||
static constexpr bool statelessMocs = true;
|
||||
static constexpr bool bindingTablePoolBaseAddress = true;
|
||||
};
|
||||
|
||||
struct PipelineSelectStateSupport {
|
||||
|
||||
@@ -46,23 +46,6 @@ struct PVC : public XeHpcCoreFamily {
|
||||
static constexpr bool devicePreemptionMode = false;
|
||||
};
|
||||
|
||||
struct StateBaseAddressStateSupport {
|
||||
static constexpr bool globalAtomics = false;
|
||||
static constexpr bool statelessMocs = true;
|
||||
};
|
||||
|
||||
struct PipelineSelectStateSupport {
|
||||
static constexpr bool modeSelected = true;
|
||||
static constexpr bool mediaSamplerDopClockGate = false;
|
||||
static constexpr bool systolicMode = true;
|
||||
};
|
||||
|
||||
struct PreemptionDebugSupport {
|
||||
static constexpr bool preemptionMode = true;
|
||||
static constexpr bool stateSip = true;
|
||||
static constexpr bool csrSurface = false;
|
||||
};
|
||||
|
||||
static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig);
|
||||
static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo);
|
||||
static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable);
|
||||
|
||||
@@ -34,6 +34,24 @@ struct XeHpcCore {
|
||||
static constexpr bool isUsingMiMemFence = true;
|
||||
static constexpr bool isUsingMiSetPredicate = true;
|
||||
|
||||
struct StateBaseAddressStateSupport {
|
||||
static constexpr bool globalAtomics = false;
|
||||
static constexpr bool statelessMocs = true;
|
||||
static constexpr bool bindingTablePoolBaseAddress = true;
|
||||
};
|
||||
|
||||
struct PipelineSelectStateSupport {
|
||||
static constexpr bool modeSelected = true;
|
||||
static constexpr bool mediaSamplerDopClockGate = false;
|
||||
static constexpr bool systolicMode = true;
|
||||
};
|
||||
|
||||
struct PreemptionDebugSupport {
|
||||
static constexpr bool preemptionMode = true;
|
||||
static constexpr bool stateSip = true;
|
||||
static constexpr bool csrSurface = false;
|
||||
};
|
||||
|
||||
struct DataPortBindlessSurfaceExtendedMessageDescriptor {
|
||||
union {
|
||||
struct {
|
||||
|
||||
@@ -55,6 +55,7 @@ struct XeHpgCore {
|
||||
struct StateBaseAddressStateSupport {
|
||||
static constexpr bool globalAtomics = false;
|
||||
static constexpr bool statelessMocs = true;
|
||||
static constexpr bool bindingTablePoolBaseAddress = true;
|
||||
};
|
||||
|
||||
struct PipelineSelectStateSupport {
|
||||
|
||||
Reference in New Issue
Block a user