Merge "SF: Moving InjectVSyncSource into it's own class"
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index fef53bb..2a07074 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -132,22 +132,7 @@
CompositorTiming compositorTiming;
flinger->getCompositorTiming(&compositorTiming);
mFrameEventHistory.initializeCompositorTiming(compositorTiming);
-}
-
-void Layer::onFirstRef() NO_THREAD_SAFETY_ANALYSIS {
- if (!isCreatedFromMainThread()) {
- // Grab the SF state lock during this since it's the only way to safely access HWC
- mFlinger->mStateLock.lock();
- }
-
- const auto& hwc = mFlinger->getHwComposer();
- const auto& activeConfig = hwc.getActiveConfig(HWC_DISPLAY_PRIMARY);
- nsecs_t displayPeriod = activeConfig->getVsyncPeriod();
- mFrameTracker.setDisplayRefreshPeriod(displayPeriod);
-
- if (!isCreatedFromMainThread()) {
- mFlinger->mStateLock.unlock();
- }
+ mFrameTracker.setDisplayRefreshPeriod(compositorTiming.interval);
}
Layer::~Layer() {
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index a6da495..814adf7 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -604,8 +604,6 @@
: mFlinger(flinger), mLayer(layer) {}
};
- virtual void onFirstRef();
-
friend class impl::SurfaceInterceptor;
void commitTransaction(const State& stateToCommit);
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 31d8deb..41c7f22 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2201,7 +2201,9 @@
getHwComposer().getRenderIntents(displayId, colorMode);
hwcColorModes.emplace(colorMode, renderIntents);
}
+ }
+ if (displayId >= 0) {
getHwComposer().getHdrCapabilities(displayId, &hdrCapabilities);
supportedPerFrameMetadata = getHwComposer().getSupportedPerFrameMetadata(displayId);
}
diff --git a/services/surfaceflinger/tests/unittests/DisplayTransactionTest.cpp b/services/surfaceflinger/tests/unittests/DisplayTransactionTest.cpp
index 508875d..b4aec36 100644
--- a/services/surfaceflinger/tests/unittests/DisplayTransactionTest.cpp
+++ b/services/surfaceflinger/tests/unittests/DisplayTransactionTest.cpp
@@ -657,7 +657,8 @@
using SimpleHwcVirtualDisplayVariant = HwcVirtualDisplayVariant<1024, 768, Secure::TRUE>;
using HwcVirtualDisplayCase =
Case<SimpleHwcVirtualDisplayVariant, WideColorSupportNotConfiguredVariant,
- NonHwcDisplayHdrSupportVariant, NonHwcPerFrameMetadataSupportVariant>;
+ HdrNotSupportedVariant<SimpleHwcVirtualDisplayVariant>,
+ NoPerFrameMetadataSupportVariant<SimpleHwcVirtualDisplayVariant>>;
using WideColorP3ColorimetricDisplayCase =
Case<PrimaryDisplayVariant, WideColorP3ColorimetricSupportedVariant<PrimaryDisplayVariant>,
HdrNotSupportedVariant<PrimaryDisplayVariant>,