SF: Don't cache display modes in HWComposer
The display modes should be stored only in DisplayDevice.
Having the state also in HWComposer is unnesesary and hard to
keep in sync with SF, e.g. during hotplug processing of
displays which can change their supported modes.
Any HWC calls which need to validate their parameters need
to go through display device. This additinally makes the
code more undestandable.
Bug: 159590486
Test: presubmit
Change-Id: I40b03c09a5fd6092fca0682d602deb70db022fa5
diff --git a/services/surfaceflinger/BufferLayer.cpp b/services/surfaceflinger/BufferLayer.cpp
index 39ae2fd..ec81ff7 100644
--- a/services/surfaceflinger/BufferLayer.cpp
+++ b/services/surfaceflinger/BufferLayer.cpp
@@ -377,7 +377,7 @@
displayId && mFlinger->getHwComposer().isConnected(*displayId)) {
// The HWC doesn't support present fences, so use the refresh
// timestamp instead.
- const nsecs_t actualPresentTime = mFlinger->getHwComposer().getRefreshTimestamp(*displayId);
+ const nsecs_t actualPresentTime = display->getRefreshTimestamp();
mFlinger->mTimeStats->setPresentTime(layerId, mCurrentFrameNumber, actualPresentTime);
mFlinger->mFrameTracer->traceTimestamp(layerId, getCurrentBufferId(), mCurrentFrameNumber,
actualPresentTime,