Remove internal display related methods
SurfaceFlinger and SurfaceComposerClient simply return the first
connected display as internal display, which is not really correct.
In particular,in the case of dual display for foldable devices, both
displays are marked as Internal determined by calling into HWC2
IComposerClient::getDisplayConnectionType().
Therefore, the concept of internal/external/primary displays is removed
from SurfaceFlinger, and the display manager is the better place to
handle the logics.
flatland is modified to take an extra argument to specify display id,
and error occurs if no display is specified in case of multi-display.
Bug: 241285477
Bug: 242763577
Bug: 74619554
Test: atest libgui_test libsurfaceflinger_unittest SurfaceFlinger_test
Change-Id: Ib6c7e502ef3269c2c60a4e5388e5ac75275f87ed
diff --git a/libs/nativewindow/include/system/window.h b/libs/nativewindow/include/system/window.h
index 79f49e1..c7745e6 100644
--- a/libs/nativewindow/include/system/window.h
+++ b/libs/nativewindow/include/system/window.h
@@ -235,8 +235,8 @@
NATIVE_WINDOW_ENABLE_FRAME_TIMESTAMPS = 25,
NATIVE_WINDOW_GET_COMPOSITOR_TIMING = 26,
NATIVE_WINDOW_GET_FRAME_TIMESTAMPS = 27,
- NATIVE_WINDOW_GET_WIDE_COLOR_SUPPORT = 28,
- NATIVE_WINDOW_GET_HDR_SUPPORT = 29,
+ /* 28, removed: NATIVE_WINDOW_GET_WIDE_COLOR_SUPPORT */
+ /* 29, removed: NATIVE_WINDOW_GET_HDR_SUPPORT */
NATIVE_WINDOW_SET_USAGE64 = ANATIVEWINDOW_PERFORM_SET_USAGE64,
NATIVE_WINDOW_GET_CONSUMER_USAGE64 = 31,
NATIVE_WINDOW_SET_BUFFERS_SMPTE2086_METADATA = 32,
@@ -988,15 +988,34 @@
outDequeueReadyTime, outReleaseTime);
}
-static inline int native_window_get_wide_color_support(
- struct ANativeWindow* window, bool* outSupport) {
- return window->perform(window, NATIVE_WINDOW_GET_WIDE_COLOR_SUPPORT,
- outSupport);
+/* deprecated. Always returns 0 and outSupport holds true. Don't call. */
+static inline int native_window_get_wide_color_support (
+ struct ANativeWindow* window __UNUSED, bool* outSupport) __deprecated;
+
+/*
+ Deprecated(b/242763577): to be removed, this method should not be used
+ Surface support should not be tied to the display
+ Return true since most displays should have this support
+*/
+static inline int native_window_get_wide_color_support (
+ struct ANativeWindow* window __UNUSED, bool* outSupport) {
+ *outSupport = true;
+ return 0;
}
-static inline int native_window_get_hdr_support(struct ANativeWindow* window,
+/* deprecated. Always returns 0 and outSupport holds true. Don't call. */
+static inline int native_window_get_hdr_support(struct ANativeWindow* window __UNUSED,
+ bool* outSupport) __deprecated;
+
+/*
+ Deprecated(b/242763577): to be removed, this method should not be used
+ Surface support should not be tied to the display
+ Return true since most displays should have this support
+*/
+static inline int native_window_get_hdr_support(struct ANativeWindow* window __UNUSED,
bool* outSupport) {
- return window->perform(window, NATIVE_WINDOW_GET_HDR_SUPPORT, outSupport);
+ *outSupport = true;
+ return 0;
}
static inline int native_window_get_consumer_usage(struct ANativeWindow* window,