Introduce DynamicDisplayInfo
In this CL we introduce the getDynamicDisplayInfo call
on ISurfaceComposer which replaces the existing
- getDisplayModes
- getActiveDisplayMode
- getColorModes
- getActiveColorMode
- getHdrCapabilities
This way all display properties can be queried atomically.
The current DisplayInfo class is moved to the androd::ui
namespace and it's renamed to StaticDisplayInfo.
ui::DisplayMode is now LightFlattenable and the mode ID is
int32_t instead of size_t in order to prevent serialization
problems.
Additionally we add the ID field to ui::DisplayMode. This
way we no longer need the supported display IDs to be
from 0 to N-1.
Bug: 159590486
Bug: 180539476
Test: presubmit, manually test that device boots
Change-Id: I52b170913ce47cb5df2e8417e6cc95d395df1fda
diff --git a/services/surfaceflinger/DisplayHardware/HWC2.h b/services/surfaceflinger/DisplayHardware/HWC2.h
index 4c7f284..e7bf286 100644
--- a/services/surfaceflinger/DisplayHardware/HWC2.h
+++ b/services/surfaceflinger/DisplayHardware/HWC2.h
@@ -18,9 +18,9 @@
#include <gui/HdrMetadata.h>
#include <math/mat4.h>
-#include <ui/DisplayInfo.h>
#include <ui/HdrCapabilities.h>
#include <ui/Region.h>
+#include <ui/StaticDisplayInfo.h>
#include <utils/Log.h>
#include <utils/StrongPointer.h>
#include <utils/Timers.h>
@@ -104,7 +104,7 @@
hal::DisplayRequest* outDisplayRequests,
std::unordered_map<Layer*, hal::LayerRequest>* outLayerRequests) = 0;
[[clang::warn_unused_result]] virtual hal::Error getConnectionType(
- android::DisplayConnectionType*) const = 0;
+ ui::DisplayConnectionType*) const = 0;
[[clang::warn_unused_result]] virtual hal::Error supportsDoze(bool* outSupport) const = 0;
[[clang::warn_unused_result]] virtual hal::Error getHdrCapabilities(
android::HdrCapabilities* outCapabilities) const = 0;
@@ -175,7 +175,7 @@
hal::Error getRequests(
hal::DisplayRequest* outDisplayRequests,
std::unordered_map<Layer*, hal::LayerRequest>* outLayerRequests) override;
- hal::Error getConnectionType(android::DisplayConnectionType*) const override;
+ hal::Error getConnectionType(ui::DisplayConnectionType*) const override;
hal::Error supportsDoze(bool* outSupport) const override;
hal::Error getHdrCapabilities(android::HdrCapabilities* outCapabilities) const override;
hal::Error getDisplayedContentSamplingAttributes(hal::PixelFormat* outFormat,