[perf] change stream properties interfaces allowing fine grain selective update

Related-To: NEO-5055

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2023-03-10 18:36:22 +00:00
committed by Compute-Runtime-Automation
parent 483f9fe340
commit 86c91847cc
10 changed files with 339 additions and 63 deletions

View File

@@ -481,8 +481,8 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
bindingTablePoolSize = surfaceStateSize;
}
this->streamProperties.stateBaseAddress.setPropertiesSurfaceState(bindingTablePoolBaseAddress, bindingTablePoolSize,
surfaceStateBaseAddress, surfaceStateSize);
this->streamProperties.stateBaseAddress.setPropertiesBindingTableSurfaceState(bindingTablePoolBaseAddress, bindingTablePoolSize,
surfaceStateBaseAddress, surfaceStateSize);
}
auto isStateBaseAddressDirty = dshDirty || iohDirty || sshDirty || stateBaseAddressDirty;

View File

@@ -32,9 +32,12 @@ struct StateComputeModeProperties {
void initSupport(const RootDeviceEnvironment &rootDeviceEnvironment);
void setPropertiesAll(bool requiresCoherency, uint32_t numGrfRequired, int32_t threadArbitrationPolicy, PreemptionMode devicePreemptionMode);
void setProperties(const StateComputeModeProperties &properties);
void setPropertiesGrfNumberThreadArbitration(uint32_t numGrfRequired, int32_t threadArbitrationPolicy);
void setPropertiesCoherencyDevicePreemption(bool requiresCoherency, PreemptionMode devicePreemptionMode, bool clearDirtyState);
void copyPropertiesAll(const StateComputeModeProperties &properties);
void copyPropertiesGrfNumberThreadArbitration(const StateComputeModeProperties &properties);
bool isDirty() const;
protected:
@@ -45,7 +48,8 @@ struct StateComputeModeProperties {
void setPropertiesExtraPerContext();
void setPropertiesExtraPerKernel();
void setPropertiesExtra(const StateComputeModeProperties &properties);
void copyPropertiesExtra(const StateComputeModeProperties &properties);
void setCoherencyProperty(bool requiresCoherency);
void setDevicePreemptionProperty(PreemptionMode devicePreemptionMode);
@@ -73,10 +77,13 @@ struct FrontEndProperties {
void initSupport(const RootDeviceEnvironment &rootDeviceEnvironment);
void setPropertiesAll(bool isCooperativeKernel, bool disableEuFusion, bool disableOverdispatch, int32_t engineInstancedDevice);
void setProperties(const FrontEndProperties &properties);
void setPropertySingleSliceDispatchCcsMode(int32_t engineInstancedDevice);
void setPropertiesDisableOverdispatchEngineInstanced(bool disableOverdispatch, int32_t engineInstancedDevice, bool clearDirtyState);
void setPropertiesComputeDispatchAllWalkerEnableDisableEuFusion(bool isCooperativeKernel, bool disableEuFusion);
void copyPropertiesAll(const FrontEndProperties &properties);
void copyPropertiesComputeDispatchAllWalkerEnableDisableEuFusion(const FrontEndProperties &properties);
bool isDirty() const;
protected:
@@ -99,9 +106,12 @@ struct PipelineSelectProperties {
void initSupport(const RootDeviceEnvironment &rootDeviceEnvironment);
void setPropertiesAll(bool modeSelected, bool mediaSamplerDopClockGate, bool systolicMode);
void setProperties(const PipelineSelectProperties &properties);
void setPropertiesModeSelectedMediaSamplerClockGate(bool modeSelected, bool mediaSamplerDopClockGate, bool clearDirtyState);
void setPropertySystolicMode(bool systolicMode);
void copyPropertiesAll(const PipelineSelectProperties &properties);
void copyPropertiesSystolicMode(const PipelineSelectProperties &properties);
bool isDirty() const;
protected:
@@ -135,13 +145,18 @@ struct StateBaseAddressProperties {
int64_t surfaceStateBaseAddress, size_t surfaceStateSize,
int64_t dynamicStateBaseAddress, size_t dynamicStateSize,
int64_t indirectObjectBaseAddress, size_t indirectObjectSize);
void setPropertiesSurfaceState(int64_t bindingTablePoolBaseAddress, size_t bindingTablePoolSize,
int64_t surfaceStateBaseAddress, size_t surfaceStateSize);
void setPropertiesBindingTableSurfaceState(int64_t bindingTablePoolBaseAddress, size_t bindingTablePoolSize,
int64_t surfaceStateBaseAddress, size_t surfaceStateSize);
void setPropertiesSurfaceState(int64_t surfaceStateBaseAddress, size_t surfaceStateSize);
void setPropertiesDynamicState(int64_t dynamicStateBaseAddress, size_t dynamicStateSize);
void setPropertiesIndirectState(int64_t indirectObjectBaseAddress, size_t indirectObjectSize);
void setPropertyStatelessMocs(int32_t statelessMocs);
void setPropertyGlobalAtomics(bool globalAtomics, bool clearDirtyState);
void setProperties(const StateBaseAddressProperties &properties);
void copyPropertiesAll(const StateBaseAddressProperties &properties);
void copyPropertiesStatelessMocs(const StateBaseAddressProperties &properties);
void copyPropertiesStatelessMocsIndirectState(const StateBaseAddressProperties &properties);
bool isDirty() const;
protected:

View File

@@ -45,7 +45,7 @@ void StateComputeModeProperties::setPropertiesAll(bool requiresCoherency, uint32
setPropertiesExtraPerKernel();
}
void StateComputeModeProperties::setProperties(const StateComputeModeProperties &properties) {
void StateComputeModeProperties::copyPropertiesAll(const StateComputeModeProperties &properties) {
clearIsDirty();
isCoherencyRequired.set(properties.isCoherencyRequired.value);
@@ -55,7 +55,19 @@ void StateComputeModeProperties::setProperties(const StateComputeModeProperties
threadArbitrationPolicy.set(properties.threadArbitrationPolicy.value);
devicePreemptionMode.set(properties.devicePreemptionMode.value);
setPropertiesExtra(properties);
copyPropertiesExtra(properties);
}
void StateComputeModeProperties::copyPropertiesGrfNumberThreadArbitration(const StateComputeModeProperties &properties) {
largeGrfMode.isDirty = false;
threadArbitrationPolicy.isDirty = false;
clearIsDirtyExtraPerKernel();
largeGrfMode.set(properties.largeGrfMode.value);
threadArbitrationPolicy.set(properties.threadArbitrationPolicy.value);
copyPropertiesExtra(properties);
}
bool StateComputeModeProperties::isDirty() const {
@@ -223,7 +235,7 @@ void FrontEndProperties::setPropertiesComputeDispatchAllWalkerEnableDisableEuFus
}
}
void FrontEndProperties::setProperties(const FrontEndProperties &properties) {
void FrontEndProperties::copyPropertiesAll(const FrontEndProperties &properties) {
clearIsDirty();
disableOverdispatch.set(properties.disableOverdispatch.value);
@@ -232,6 +244,14 @@ void FrontEndProperties::setProperties(const FrontEndProperties &properties) {
computeDispatchAllWalkerEnable.set(properties.computeDispatchAllWalkerEnable.value);
}
void FrontEndProperties::copyPropertiesComputeDispatchAllWalkerEnableDisableEuFusion(const FrontEndProperties &properties) {
this->computeDispatchAllWalkerEnable.isDirty = false;
this->disableEUFusion.isDirty = false;
this->disableEUFusion.set(properties.disableEUFusion.value);
this->computeDispatchAllWalkerEnable.set(properties.computeDispatchAllWalkerEnable.value);
}
bool FrontEndProperties::isDirty() const {
return disableOverdispatch.isDirty || disableEUFusion.isDirty || singleSliceDispatchCcsMode.isDirty ||
computeDispatchAllWalkerEnable.isDirty;
@@ -295,7 +315,7 @@ void PipelineSelectProperties::setPropertySystolicMode(bool systolicMode) {
}
}
void PipelineSelectProperties::setProperties(const PipelineSelectProperties &properties) {
void PipelineSelectProperties::copyPropertiesAll(const PipelineSelectProperties &properties) {
clearIsDirty();
modeSelected.set(properties.modeSelected.value);
@@ -303,6 +323,11 @@ void PipelineSelectProperties::setProperties(const PipelineSelectProperties &pro
systolicMode.set(properties.systolicMode.value);
}
void PipelineSelectProperties::copyPropertiesSystolicMode(const PipelineSelectProperties &properties) {
systolicMode.isDirty = false;
systolicMode.set(properties.systolicMode.value);
}
bool PipelineSelectProperties::isDirty() const {
return modeSelected.isDirty || mediaSamplerDopClockGate.isDirty || systolicMode.isDirty;
}
@@ -319,8 +344,8 @@ void StateBaseAddressProperties::initSupport(const RootDeviceEnvironment &rootDe
this->propertiesSupportLoaded = true;
}
void StateBaseAddressProperties::setPropertiesSurfaceState(int64_t bindingTablePoolBaseAddress, size_t bindingTablePoolSize,
int64_t surfaceStateBaseAddress, size_t surfaceStateSize) {
void StateBaseAddressProperties::setPropertiesBindingTableSurfaceState(int64_t bindingTablePoolBaseAddress, size_t bindingTablePoolSize,
int64_t surfaceStateBaseAddress, size_t surfaceStateSize) {
DEBUG_BREAK_IF(!this->propertiesSupportLoaded);
this->bindingTablePoolBaseAddress.isDirty = false;
@@ -336,6 +361,16 @@ void StateBaseAddressProperties::setPropertiesSurfaceState(int64_t bindingTableP
this->surfaceStateSize.set(surfaceStateSize);
}
void StateBaseAddressProperties::setPropertiesSurfaceState(int64_t surfaceStateBaseAddress, size_t surfaceStateSize) {
DEBUG_BREAK_IF(!this->propertiesSupportLoaded);
this->surfaceStateBaseAddress.isDirty = false;
this->surfaceStateSize.isDirty = false;
this->surfaceStateBaseAddress.set(surfaceStateBaseAddress);
this->surfaceStateSize.set(surfaceStateSize);
}
void StateBaseAddressProperties::setPropertiesDynamicState(int64_t dynamicStateBaseAddress, size_t dynamicStateSize) {
this->dynamicStateBaseAddress.isDirty = false;
this->dynamicStateSize.isDirty = false;
@@ -396,7 +431,7 @@ void StateBaseAddressProperties::setPropertiesAll(bool globalAtomics, int32_t st
this->indirectObjectSize.set(indirectObjectSize);
}
void StateBaseAddressProperties::setProperties(const StateBaseAddressProperties &properties) {
void StateBaseAddressProperties::copyPropertiesAll(const StateBaseAddressProperties &properties) {
clearIsDirty();
this->globalAtomics.set(properties.globalAtomics.value);
@@ -413,6 +448,22 @@ void StateBaseAddressProperties::setProperties(const StateBaseAddressProperties
this->indirectObjectSize.set(properties.indirectObjectSize.value);
}
void StateBaseAddressProperties::copyPropertiesStatelessMocs(const StateBaseAddressProperties &properties) {
this->statelessMocs.isDirty = false;
this->statelessMocs.set(properties.statelessMocs.value);
}
void StateBaseAddressProperties::copyPropertiesStatelessMocsIndirectState(const StateBaseAddressProperties &properties) {
this->statelessMocs.isDirty = false;
this->indirectObjectBaseAddress.isDirty = false;
this->indirectObjectSize.isDirty = false;
this->statelessMocs.set(properties.statelessMocs.value);
this->indirectObjectBaseAddress.set(properties.indirectObjectBaseAddress.value);
this->indirectObjectSize.set(properties.indirectObjectSize.value);
}
bool StateBaseAddressProperties::isDirty() const {
return globalAtomics.isDirty || statelessMocs.isDirty ||
bindingTablePoolBaseAddress.isDirty || bindingTablePoolSize.isDirty ||

View File

@@ -14,7 +14,7 @@ void StateComputeModeProperties::setPropertiesExtraPerContext() {
void StateComputeModeProperties::setPropertiesExtraPerKernel() {
}
void StateComputeModeProperties::setPropertiesExtra(const StateComputeModeProperties &properties) {
void StateComputeModeProperties::copyPropertiesExtra(const StateComputeModeProperties &properties) {
}
bool StateComputeModeProperties::isDirtyExtra() const {

View File

@@ -242,7 +242,7 @@ void verifySettingPropertiesFromOtherStruct() {
}
EXPECT_FALSE(propertiesSource.isDirty());
propertiesDestination.setProperties(propertiesSource);
propertiesDestination.copyPropertiesAll(propertiesSource);
EXPECT_EQ(!allPropertiesDestination.empty(), propertiesDestination.isDirty());
int expectedValue = 1;
@@ -252,7 +252,7 @@ void verifySettingPropertiesFromOtherStruct() {
expectedValue++;
}
propertiesDestination.setProperties(propertiesSource);
propertiesDestination.copyPropertiesAll(propertiesSource);
EXPECT_FALSE(propertiesDestination.isDirty());
expectedValue = 1;
@@ -376,6 +376,41 @@ TEST(StreamPropertiesTests, givenGrfNumberAndThreadArbitrationStateComputeModePr
EXPECT_EQ(threadArbitration, scmProperties.threadArbitrationPolicy.value);
}
TEST(StreamPropertiesTests, givenGrfNumberAndThreadArbitrationStateComputeModePropertiesWhenCopyingPropertyAndCheckIfDirtyThenExpectCorrectState) {
MockStateComputeModeProperties scmProperties{};
scmProperties.propertiesSupportLoaded = true;
scmProperties.scmPropertiesSupport.largeGrfMode = true;
scmProperties.scmPropertiesSupport.threadArbitrationPolicy = true;
int32_t grfNumber = 128;
int32_t threadArbitration = 1;
scmProperties.setPropertiesGrfNumberThreadArbitration(static_cast<uint32_t>(grfNumber), threadArbitration);
EXPECT_TRUE(scmProperties.isDirty());
EXPECT_EQ(0, scmProperties.largeGrfMode.value);
EXPECT_EQ(threadArbitration, scmProperties.threadArbitrationPolicy.value);
MockStateComputeModeProperties scmPropertiesCopy{};
scmPropertiesCopy.copyPropertiesGrfNumberThreadArbitration(scmProperties);
EXPECT_TRUE(scmPropertiesCopy.isDirty());
EXPECT_EQ(0, scmPropertiesCopy.largeGrfMode.value);
EXPECT_EQ(threadArbitration, scmPropertiesCopy.threadArbitrationPolicy.value);
scmPropertiesCopy.copyPropertiesGrfNumberThreadArbitration(scmProperties);
EXPECT_FALSE(scmPropertiesCopy.isDirty());
EXPECT_EQ(0, scmPropertiesCopy.largeGrfMode.value);
EXPECT_EQ(threadArbitration, scmPropertiesCopy.threadArbitrationPolicy.value);
grfNumber = 256;
threadArbitration = 2;
scmProperties.setPropertiesGrfNumberThreadArbitration(static_cast<uint32_t>(grfNumber), threadArbitration);
scmPropertiesCopy.copyPropertiesGrfNumberThreadArbitration(scmProperties);
EXPECT_TRUE(scmPropertiesCopy.isDirty());
EXPECT_EQ(1, scmPropertiesCopy.largeGrfMode.value);
EXPECT_EQ(threadArbitration, scmPropertiesCopy.threadArbitrationPolicy.value);
}
TEST(StreamPropertiesTests, givenForceDebugDefaultThreadArbitrationStateComputeModePropertyWhenSettingPropertyAndCheckIfSupportedThenExpectCorrectState) {
DebugManagerStateRestore restorer;
@@ -547,6 +582,41 @@ TEST(StreamPropertiesTests, givenComputeDispatchAllWalkerEnableAndDisableEuFusio
EXPECT_EQ(1, feProperties.computeDispatchAllWalkerEnable.value);
}
TEST(StreamPropertiesTests, givenComputeDispatchAllWalkerEnableAndDisableEuFusionFrontEndPropertiesWhenCopyingPropertiesAndCheckIfDirtyThenExpectCorrectState) {
MockFrontEndProperties feProperties{};
feProperties.propertiesSupportLoaded = true;
feProperties.frontEndPropertiesSupport.disableEuFusion = true;
feProperties.frontEndPropertiesSupport.computeDispatchAllWalker = true;
bool disableEuFusion = false;
bool isCooperativeKernel = false;
feProperties.setPropertiesComputeDispatchAllWalkerEnableDisableEuFusion(isCooperativeKernel, disableEuFusion);
EXPECT_TRUE(feProperties.isDirty());
EXPECT_EQ(0, feProperties.disableEUFusion.value);
EXPECT_EQ(0, feProperties.computeDispatchAllWalkerEnable.value);
MockFrontEndProperties fePropertiesCopy{};
fePropertiesCopy.copyPropertiesComputeDispatchAllWalkerEnableDisableEuFusion(feProperties);
EXPECT_TRUE(fePropertiesCopy.isDirty());
EXPECT_EQ(0, fePropertiesCopy.disableEUFusion.value);
EXPECT_EQ(0, fePropertiesCopy.computeDispatchAllWalkerEnable.value);
fePropertiesCopy.copyPropertiesComputeDispatchAllWalkerEnableDisableEuFusion(feProperties);
EXPECT_FALSE(fePropertiesCopy.isDirty());
EXPECT_EQ(0, fePropertiesCopy.disableEUFusion.value);
EXPECT_EQ(0, fePropertiesCopy.computeDispatchAllWalkerEnable.value);
disableEuFusion = true;
isCooperativeKernel = true;
feProperties.setPropertiesComputeDispatchAllWalkerEnableDisableEuFusion(isCooperativeKernel, disableEuFusion);
fePropertiesCopy.copyPropertiesComputeDispatchAllWalkerEnableDisableEuFusion(feProperties);
EXPECT_TRUE(fePropertiesCopy.isDirty());
EXPECT_EQ(1, fePropertiesCopy.disableEUFusion.value);
EXPECT_EQ(1, fePropertiesCopy.computeDispatchAllWalkerEnable.value);
}
TEST(StreamPropertiesTests, whenSettingPipelineSelectPropertiesThenCorrectValueIsSet) {
MockExecutionEnvironment mockExecutionEnvironment{};
auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<ProductHelper>();
@@ -628,6 +698,33 @@ TEST(StreamPropertiesTests, givenSystolicModePipelineSelectPropertyWhenSettingPr
EXPECT_EQ(1, pipeProperties.systolicMode.value);
}
TEST(StreamPropertiesTests, givenSystolicModePipelineSelectPropertyWhenCopyingPropertyAndCheckIfDirtyThenExpectCorrectState) {
MockPipelineSelectProperties pipeProperties{};
pipeProperties.propertiesSupportLoaded = true;
pipeProperties.pipelineSelectPropertiesSupport.systolicMode = true;
bool systolicMode = false;
pipeProperties.setPropertySystolicMode(systolicMode);
EXPECT_TRUE(pipeProperties.isDirty());
EXPECT_EQ(0, pipeProperties.systolicMode.value);
MockPipelineSelectProperties pipePropertiesCopy{};
pipePropertiesCopy.copyPropertiesSystolicMode(pipeProperties);
EXPECT_TRUE(pipePropertiesCopy.isDirty());
EXPECT_EQ(0, pipePropertiesCopy.systolicMode.value);
pipePropertiesCopy.copyPropertiesSystolicMode(pipeProperties);
EXPECT_FALSE(pipePropertiesCopy.isDirty());
EXPECT_EQ(0, pipePropertiesCopy.systolicMode.value);
systolicMode = true;
pipeProperties.setPropertySystolicMode(systolicMode);
pipePropertiesCopy.copyPropertiesSystolicMode(pipeProperties);
EXPECT_TRUE(pipePropertiesCopy.isDirty());
EXPECT_EQ(1, pipePropertiesCopy.systolicMode.value);
}
TEST(StreamPropertiesTests, givenModeSelectedMediaSamplerClockGatePipelineSelectPropertyWhenSettingPropertyAndCheckIfSupportedThenExpectCorrectState) {
bool clearDirtyState = false;
MockPipelineSelectProperties pipeProperties{};
@@ -759,7 +856,7 @@ TEST(StreamPropertiesTests, givenStateBaseAddressSupportFlagStateWhenSettingProp
MockStateBaseAddressProperties copySbaProperties{};
copySbaProperties.setProperties(sbaProperties);
copySbaProperties.copyPropertiesAll(sbaProperties);
EXPECT_TRUE(copySbaProperties.isDirty());
EXPECT_EQ(0, copySbaProperties.globalAtomics.value);
@@ -767,7 +864,7 @@ TEST(StreamPropertiesTests, givenStateBaseAddressSupportFlagStateWhenSettingProp
EXPECT_EQ(3, copySbaProperties.bindingTablePoolBaseAddress.value);
EXPECT_EQ(3u, copySbaProperties.bindingTablePoolSize.value);
sbaProperties.setProperties(copySbaProperties);
sbaProperties.copyPropertiesAll(copySbaProperties);
EXPECT_FALSE(sbaProperties.isDirty());
}
@@ -954,7 +1051,89 @@ TEST(StreamPropertiesTests, givenStatelessMocsStateBaseAddressPropertyWhenSettin
EXPECT_EQ(1, sbaProperties.statelessMocs.value);
}
TEST(StreamPropertiesTests, givenSurfaceStateBaseAddressStateBaseAddressPropertyWhenSettingPropertyAndCheckIfSupportedThenExpectCorrectState) {
TEST(StreamPropertiesTests, givenStatelessMocsStateBaseAddressPropertyWhenCopyingPropertyAndCheckIfDirtyThenExpectCorrectState) {
MockStateBaseAddressProperties sbaProperties{};
sbaProperties.propertiesSupportLoaded = true;
int32_t statelessMocs = 0;
sbaProperties.setPropertyStatelessMocs(statelessMocs);
EXPECT_TRUE(sbaProperties.isDirty());
EXPECT_EQ(0, sbaProperties.statelessMocs.value);
MockStateBaseAddressProperties sbaPropertiesCopy{};
sbaPropertiesCopy.copyPropertiesStatelessMocs(sbaProperties);
EXPECT_TRUE(sbaPropertiesCopy.isDirty());
EXPECT_EQ(0, sbaPropertiesCopy.statelessMocs.value);
sbaPropertiesCopy.copyPropertiesStatelessMocs(sbaProperties);
EXPECT_FALSE(sbaPropertiesCopy.isDirty());
EXPECT_EQ(0, sbaPropertiesCopy.statelessMocs.value);
statelessMocs = 1;
sbaProperties.setPropertyStatelessMocs(statelessMocs);
sbaPropertiesCopy.copyPropertiesStatelessMocs(sbaProperties);
EXPECT_TRUE(sbaPropertiesCopy.isDirty());
EXPECT_EQ(1, sbaPropertiesCopy.statelessMocs.value);
}
TEST(StreamPropertiesTests, givenIndirectHeapAndStatelessMocsStateBaseAddressPropertyWhenCopyingPropertyAndCheckIfDirtyThenExpectCorrectState) {
MockStateBaseAddressProperties sbaProperties{};
sbaProperties.propertiesSupportLoaded = true;
int32_t statelessMocs = 0;
int64_t indirectObjectBaseAddress = 1;
size_t indirectObjectSize = 1;
sbaProperties.setPropertyStatelessMocs(statelessMocs);
EXPECT_TRUE(sbaProperties.isDirty());
EXPECT_EQ(0, sbaProperties.statelessMocs.value);
sbaProperties.setPropertiesIndirectState(indirectObjectBaseAddress, indirectObjectSize);
EXPECT_TRUE(sbaProperties.isDirty());
EXPECT_EQ(1, sbaProperties.indirectObjectBaseAddress.value);
EXPECT_EQ(1u, sbaProperties.indirectObjectSize.value);
MockStateBaseAddressProperties sbaPropertiesCopy{};
sbaPropertiesCopy.copyPropertiesStatelessMocsIndirectState(sbaProperties);
EXPECT_TRUE(sbaPropertiesCopy.isDirty());
EXPECT_EQ(0, sbaPropertiesCopy.statelessMocs.value);
EXPECT_EQ(1, sbaPropertiesCopy.indirectObjectBaseAddress.value);
EXPECT_EQ(1u, sbaPropertiesCopy.indirectObjectSize.value);
sbaPropertiesCopy.copyPropertiesStatelessMocsIndirectState(sbaProperties);
EXPECT_FALSE(sbaPropertiesCopy.isDirty());
EXPECT_EQ(0, sbaPropertiesCopy.statelessMocs.value);
EXPECT_EQ(1, sbaPropertiesCopy.indirectObjectBaseAddress.value);
EXPECT_EQ(1u, sbaPropertiesCopy.indirectObjectSize.value);
statelessMocs = 1;
sbaProperties.setPropertyStatelessMocs(statelessMocs);
sbaPropertiesCopy.copyPropertiesStatelessMocsIndirectState(sbaProperties);
EXPECT_TRUE(sbaPropertiesCopy.isDirty());
EXPECT_EQ(1, sbaPropertiesCopy.statelessMocs.value);
EXPECT_EQ(1, sbaPropertiesCopy.indirectObjectBaseAddress.value);
EXPECT_EQ(1u, sbaPropertiesCopy.indirectObjectSize.value);
indirectObjectBaseAddress = 2;
sbaProperties.setPropertiesIndirectState(indirectObjectBaseAddress, indirectObjectSize);
sbaPropertiesCopy.copyPropertiesStatelessMocsIndirectState(sbaProperties);
EXPECT_TRUE(sbaPropertiesCopy.isDirty());
EXPECT_EQ(1, sbaPropertiesCopy.statelessMocs.value);
EXPECT_EQ(2, sbaPropertiesCopy.indirectObjectBaseAddress.value);
EXPECT_EQ(1u, sbaPropertiesCopy.indirectObjectSize.value);
indirectObjectSize = 2;
sbaProperties.setPropertiesIndirectState(indirectObjectBaseAddress, indirectObjectSize);
sbaPropertiesCopy.copyPropertiesStatelessMocsIndirectState(sbaProperties);
EXPECT_TRUE(sbaPropertiesCopy.isDirty());
EXPECT_EQ(1, sbaPropertiesCopy.statelessMocs.value);
EXPECT_EQ(2, sbaPropertiesCopy.indirectObjectBaseAddress.value);
EXPECT_EQ(2u, sbaPropertiesCopy.indirectObjectSize.value);
}
TEST(StreamPropertiesTests, givenBindingTableAndSurfaceStateBaseAddressStateBaseAddressPropertyWhenSettingPropertyAndCheckIfSupportedThenExpectCorrectState) {
int64_t bindingTablePoolBaseAddress = 0;
size_t bindingTablePoolSize = 0;
int64_t surfaceStateBaseAddress = 0;
@@ -963,14 +1142,14 @@ TEST(StreamPropertiesTests, givenSurfaceStateBaseAddressStateBaseAddressProperty
MockStateBaseAddressProperties sbaProperties{};
sbaProperties.propertiesSupportLoaded = true;
sbaProperties.stateBaseAddressPropertiesSupport.bindingTablePoolBaseAddress = false;
sbaProperties.setPropertiesSurfaceState(bindingTablePoolBaseAddress, bindingTablePoolSize, surfaceStateBaseAddress, surfaceStateSize);
sbaProperties.setPropertiesBindingTableSurfaceState(bindingTablePoolBaseAddress, bindingTablePoolSize, surfaceStateBaseAddress, surfaceStateSize);
EXPECT_TRUE(sbaProperties.isDirty());
EXPECT_EQ(-1, sbaProperties.bindingTablePoolBaseAddress.value);
EXPECT_EQ(static_cast<size_t>(-1), sbaProperties.bindingTablePoolSize.value);
EXPECT_EQ(0, sbaProperties.surfaceStateBaseAddress.value);
EXPECT_EQ(0u, sbaProperties.surfaceStateSize.value);
sbaProperties.setPropertiesSurfaceState(bindingTablePoolBaseAddress, bindingTablePoolSize, surfaceStateBaseAddress, surfaceStateSize);
sbaProperties.setPropertiesBindingTableSurfaceState(bindingTablePoolBaseAddress, bindingTablePoolSize, surfaceStateBaseAddress, surfaceStateSize);
EXPECT_FALSE(sbaProperties.isDirty());
EXPECT_EQ(-1, sbaProperties.bindingTablePoolBaseAddress.value);
EXPECT_EQ(static_cast<size_t>(-1), sbaProperties.bindingTablePoolSize.value);
@@ -978,14 +1157,14 @@ TEST(StreamPropertiesTests, givenSurfaceStateBaseAddressStateBaseAddressProperty
EXPECT_EQ(0u, sbaProperties.surfaceStateSize.value);
sbaProperties.stateBaseAddressPropertiesSupport.bindingTablePoolBaseAddress = true;
sbaProperties.setPropertiesSurfaceState(bindingTablePoolBaseAddress, bindingTablePoolSize, surfaceStateBaseAddress, surfaceStateSize);
sbaProperties.setPropertiesBindingTableSurfaceState(bindingTablePoolBaseAddress, bindingTablePoolSize, surfaceStateBaseAddress, surfaceStateSize);
EXPECT_TRUE(sbaProperties.isDirty());
EXPECT_EQ(0, sbaProperties.bindingTablePoolBaseAddress.value);
EXPECT_EQ(0u, sbaProperties.bindingTablePoolSize.value);
EXPECT_EQ(0, sbaProperties.surfaceStateBaseAddress.value);
EXPECT_EQ(0u, sbaProperties.surfaceStateSize.value);
sbaProperties.setPropertiesSurfaceState(bindingTablePoolBaseAddress, bindingTablePoolSize, surfaceStateBaseAddress, surfaceStateSize);
sbaProperties.setPropertiesBindingTableSurfaceState(bindingTablePoolBaseAddress, bindingTablePoolSize, surfaceStateBaseAddress, surfaceStateSize);
EXPECT_FALSE(sbaProperties.isDirty());
EXPECT_EQ(0, sbaProperties.bindingTablePoolBaseAddress.value);
EXPECT_EQ(0u, sbaProperties.bindingTablePoolSize.value);
@@ -996,21 +1175,21 @@ TEST(StreamPropertiesTests, givenSurfaceStateBaseAddressStateBaseAddressProperty
bindingTablePoolSize = 1;
surfaceStateBaseAddress = 1;
surfaceStateSize = 1;
sbaProperties.setPropertiesSurfaceState(bindingTablePoolBaseAddress, bindingTablePoolSize, surfaceStateBaseAddress, surfaceStateSize);
sbaProperties.setPropertiesBindingTableSurfaceState(bindingTablePoolBaseAddress, bindingTablePoolSize, surfaceStateBaseAddress, surfaceStateSize);
EXPECT_TRUE(sbaProperties.isDirty());
EXPECT_EQ(1, sbaProperties.bindingTablePoolBaseAddress.value);
EXPECT_EQ(1u, sbaProperties.bindingTablePoolSize.value);
EXPECT_EQ(1, sbaProperties.surfaceStateBaseAddress.value);
EXPECT_EQ(1u, sbaProperties.surfaceStateSize.value);
sbaProperties.setPropertiesSurfaceState(bindingTablePoolBaseAddress, bindingTablePoolSize, surfaceStateBaseAddress, surfaceStateSize);
sbaProperties.setPropertiesBindingTableSurfaceState(bindingTablePoolBaseAddress, bindingTablePoolSize, surfaceStateBaseAddress, surfaceStateSize);
EXPECT_FALSE(sbaProperties.isDirty());
EXPECT_EQ(1, sbaProperties.bindingTablePoolBaseAddress.value);
EXPECT_EQ(1u, sbaProperties.bindingTablePoolSize.value);
EXPECT_EQ(1, sbaProperties.surfaceStateBaseAddress.value);
EXPECT_EQ(1u, sbaProperties.surfaceStateSize.value);
sbaProperties.setPropertiesSurfaceState(bindingTablePoolBaseAddress, bindingTablePoolSize, surfaceStateBaseAddress, surfaceStateSize);
sbaProperties.setPropertiesBindingTableSurfaceState(bindingTablePoolBaseAddress, bindingTablePoolSize, surfaceStateBaseAddress, surfaceStateSize);
EXPECT_FALSE(sbaProperties.isDirty());
EXPECT_EQ(1, sbaProperties.bindingTablePoolBaseAddress.value);
EXPECT_EQ(1u, sbaProperties.bindingTablePoolSize.value);
@@ -1018,6 +1197,36 @@ TEST(StreamPropertiesTests, givenSurfaceStateBaseAddressStateBaseAddressProperty
EXPECT_EQ(1u, sbaProperties.surfaceStateSize.value);
}
TEST(StreamPropertiesTests, givenSurfaceStateBaseAddressStateBaseAddressPropertyWhenSettingPropertyAndCheckIfSupportedThenExpectCorrectState) {
int64_t surfaceStateBaseAddress = 0;
size_t surfaceStateSize = 0;
MockStateBaseAddressProperties sbaProperties{};
sbaProperties.propertiesSupportLoaded = true;
sbaProperties.setPropertiesSurfaceState(surfaceStateBaseAddress, surfaceStateSize);
EXPECT_TRUE(sbaProperties.isDirty());
EXPECT_EQ(0, sbaProperties.surfaceStateBaseAddress.value);
EXPECT_EQ(0u, sbaProperties.surfaceStateSize.value);
sbaProperties.setPropertiesSurfaceState(surfaceStateBaseAddress, surfaceStateSize);
EXPECT_FALSE(sbaProperties.isDirty());
EXPECT_EQ(0, sbaProperties.surfaceStateBaseAddress.value);
EXPECT_EQ(0u, sbaProperties.surfaceStateSize.value);
surfaceStateBaseAddress = 1;
surfaceStateSize = 1;
sbaProperties.setPropertiesSurfaceState(surfaceStateBaseAddress, surfaceStateSize);
EXPECT_TRUE(sbaProperties.isDirty());
EXPECT_EQ(1, sbaProperties.surfaceStateBaseAddress.value);
EXPECT_EQ(1u, sbaProperties.surfaceStateSize.value);
sbaProperties.setPropertiesSurfaceState(surfaceStateBaseAddress, surfaceStateSize);
EXPECT_FALSE(sbaProperties.isDirty());
EXPECT_EQ(1, sbaProperties.surfaceStateBaseAddress.value);
EXPECT_EQ(1u, sbaProperties.surfaceStateSize.value);
}
TEST(StreamPropertiesTests, givenDynamicStateBaseAddressStateBaseAddressPropertyWhenSettingPropertyAndCheckIfSupportedThenExpectCorrectState) {
int64_t dynamicStateBaseAddress = 0;
size_t dynamicStateSize = 0;

View File

@@ -521,7 +521,7 @@ HWTEST2_F(CommandEncodeStatesTest, givenSbaPropertiesWhenBindingBaseAddressSetTh
auto itorBindTablePoolCmd = find<_3DSTATE_BINDING_TABLE_POOL_ALLOC *>(commands.begin(), commands.end());
EXPECT_EQ(commands.end(), itorBindTablePoolCmd);
sbaProperties.setPropertiesSurfaceState(bindingTablePoolBaseAddress, bindingTablePoolSize, surfaceStateBaseAddress, surfaceStateSize);
sbaProperties.setPropertiesBindingTableSurfaceState(bindingTablePoolBaseAddress, bindingTablePoolSize, surfaceStateBaseAddress, surfaceStateSize);
EncodeStateBaseAddress<FamilyType>::encode(args);

View File

@@ -580,7 +580,7 @@ HWTEST_F(SbaTest, givenStateBaseAddressPropertiesWhenSettingDynamicStateSurfaceS
EXPECT_EQ(0u, sbaCmd.getStatelessDataPortAccessMemoryObjectControlState());
sbaProperties.setPropertiesSurfaceState(surfaceHeapBase, surfaceHeapSize, surfaceHeapBase, surfaceHeapSize);
sbaProperties.setPropertiesBindingTableSurfaceState(surfaceHeapBase, surfaceHeapSize, surfaceHeapBase, surfaceHeapSize);
sbaProperties.setPropertiesDynamicState(dynamicHeapBase, dynamicHeapSize);
sbaProperties.setPropertyStatelessMocs(mocsIndex);
@@ -703,7 +703,7 @@ HWTEST2_F(SbaTest, givenStateBaseAddressPropertiesWhenSettingBindlessSurfaceStat
EXPECT_EQ(0u, sbaCmd.getBindlessSurfaceStateBaseAddress());
EXPECT_FALSE(sbaCmd.getBindlessSurfaceStateBaseAddressModifyEnable());
sbaProperties.setPropertiesSurfaceState(surfaceHeapBase, surfaceHeapSize, surfaceHeapBase, surfaceHeapSize);
sbaProperties.setPropertiesBindingTableSurfaceState(surfaceHeapBase, surfaceHeapSize, surfaceHeapBase, surfaceHeapSize);
sbaCmd = FamilyType::cmdInitStateBaseAddress;