composer: 2.4: vts: do not try to delay a config change outside a group
When switching to a new config, we can set the desiredTimeNanos to
be in the future only for configs within the same config groups.
Bug: 190250110
Test: atest VtsHalGraphicsComposerV2_4TargetTest
Change-Id: I5e292b656eccf6e90c06e08c6eb202d689b6f026
diff --git a/graphics/composer/2.4/vts/functional/VtsHalGraphicsComposerV2_4TargetTest.cpp b/graphics/composer/2.4/vts/functional/VtsHalGraphicsComposerV2_4TargetTest.cpp
index 7d0a83b..2f0429c 100644
--- a/graphics/composer/2.4/vts/functional/VtsHalGraphicsComposerV2_4TargetTest.cpp
+++ b/graphics/composer/2.4/vts/functional/VtsHalGraphicsComposerV2_4TargetTest.cpp
@@ -561,17 +561,28 @@
setActiveConfig(display, config1);
sendRefreshFrame(display, nullptr);
- int32_t vsyncPeriod1 = mComposerClient->getDisplayAttribute_2_4(
+ const auto vsyncPeriod1 = mComposerClient->getDisplayAttribute_2_4(
display.get(), config1,
IComposerClient::IComposerClient::Attribute::VSYNC_PERIOD);
- int32_t vsyncPeriod2 = mComposerClient->getDisplayAttribute_2_4(
+ const auto configGroup1 = mComposerClient->getDisplayAttribute_2_4(
+ display.get(), config1,
+ IComposerClient::IComposerClient::Attribute::CONFIG_GROUP);
+ const auto vsyncPeriod2 = mComposerClient->getDisplayAttribute_2_4(
display.get(), config2,
IComposerClient::IComposerClient::Attribute::VSYNC_PERIOD);
+ const auto configGroup2 = mComposerClient->getDisplayAttribute_2_4(
+ display.get(), config2,
+ IComposerClient::IComposerClient::Attribute::CONFIG_GROUP);
if (vsyncPeriod1 == vsyncPeriod2) {
return; // continue
}
+ // We don't allow delayed change when changing config groups
+ if (params.delayForChange > 0 && configGroup1 != configGroup2) {
+ return; // continue
+ }
+
VsyncPeriodChangeTimeline timeline;
IComposerClient::VsyncPeriodChangeConstraints constraints = {
.desiredTimeNanos = systemTime() + params.delayForChange,