[SF] Update to use RefreshRateChangedDebugData.refreshPeriodNanos
Checks for Interface Version is >= 3 and vrr_config flag is enabled
before using the refreshPeriodNanos
Update getDisplayConfigurationsSupported to
isVrrSupported
BUG: 314527560
Test: Check refresh rate indicator value by
faking refreshRateNanos from the AidlComposerHal::onRefreshRateChangedDebug
Change-Id: If5cac2c3101ac721f653d275d9b165c94ff2716d
diff --git a/services/surfaceflinger/DisplayHardware/AidlComposerHal.cpp b/services/surfaceflinger/DisplayHardware/AidlComposerHal.cpp
index 3690219..3b17857 100644
--- a/services/surfaceflinger/DisplayHardware/AidlComposerHal.cpp
+++ b/services/surfaceflinger/DisplayHardware/AidlComposerHal.cpp
@@ -288,7 +288,7 @@
}
}
-bool AidlComposer::getDisplayConfigurationsSupported() const {
+bool AidlComposer::isVrrSupported() const {
return mComposerInterfaceVersion >= 3 && FlagManager::getInstance().vrr_config();
}
diff --git a/services/surfaceflinger/DisplayHardware/AidlComposerHal.h b/services/surfaceflinger/DisplayHardware/AidlComposerHal.h
index 1635a16..6d8b42b 100644
--- a/services/surfaceflinger/DisplayHardware/AidlComposerHal.h
+++ b/services/surfaceflinger/DisplayHardware/AidlComposerHal.h
@@ -66,7 +66,7 @@
~AidlComposer() override;
bool isSupported(OptionalFeature) const;
- bool getDisplayConfigurationsSupported() const;
+ bool isVrrSupported() const;
std::vector<aidl::android::hardware::graphics::composer3::Capability> getCapabilities()
override;
diff --git a/services/surfaceflinger/DisplayHardware/ComposerHal.h b/services/surfaceflinger/DisplayHardware/ComposerHal.h
index 082717a..4b090be 100644
--- a/services/surfaceflinger/DisplayHardware/ComposerHal.h
+++ b/services/surfaceflinger/DisplayHardware/ComposerHal.h
@@ -105,7 +105,7 @@
};
virtual bool isSupported(OptionalFeature) const = 0;
- virtual bool getDisplayConfigurationsSupported() const = 0;
+ virtual bool isVrrSupported() const = 0;
virtual std::vector<aidl::android::hardware::graphics::composer3::Capability>
getCapabilities() = 0;
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
index 10df216..0f79dfc 100644
--- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp
+++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
@@ -321,7 +321,7 @@
const auto hwcDisplayId = mDisplayData.at(displayId).hwcDisplay->getId();
- if (mComposer->getDisplayConfigurationsSupported()) {
+ if (mComposer->isVrrSupported()) {
return getModesFromDisplayConfigurations(hwcDisplayId, maxFrameIntervalNs);
}
diff --git a/services/surfaceflinger/DisplayHardware/HidlComposerHal.cpp b/services/surfaceflinger/DisplayHardware/HidlComposerHal.cpp
index ed52b95..e855f32 100644
--- a/services/surfaceflinger/DisplayHardware/HidlComposerHal.cpp
+++ b/services/surfaceflinger/DisplayHardware/HidlComposerHal.cpp
@@ -276,8 +276,8 @@
}
}
-bool HidlComposer::getDisplayConfigurationsSupported() const {
- // getDisplayConfigurations is not supported on the HIDL composer.
+bool HidlComposer::isVrrSupported() const {
+ // VRR is not supported on the HIDL composer.
return false;
};
diff --git a/services/surfaceflinger/DisplayHardware/HidlComposerHal.h b/services/surfaceflinger/DisplayHardware/HidlComposerHal.h
index 5c19b47..0011b2a 100644
--- a/services/surfaceflinger/DisplayHardware/HidlComposerHal.h
+++ b/services/surfaceflinger/DisplayHardware/HidlComposerHal.h
@@ -167,7 +167,7 @@
~HidlComposer() override;
bool isSupported(OptionalFeature) const;
- bool getDisplayConfigurationsSupported() const;
+ bool isVrrSupported() const;
std::vector<aidl::android::hardware::graphics::composer3::Capability> getCapabilities()
override;