From 463ad8ee22fecc4e0f53757c618c5e77239f6467 Mon Sep 17 00:00:00 2001 From: Marin Shalamanov Date: Thu, 28 Jan 2021 22:58:37 +0100 Subject: Introduce DynamicDisplayInfo In this CL we introduce SurfaceContorl.getDynamicDisplayInfo which replaces the current seprate calls for supported and active display mode, supproted and active color modes and HDR capabilities. This way display capabilities can be queried atomically. Additionally this CL pipes an DisplayMode IDs from SurfaceFlinger and updates LocalDislayAdapter to use IDs instead of array indices. Test: presubmit Bug: 159590486 Bug: 175678215 Change-Id: I169e3055d07905e2330e11f158b61ffd366f97e6 --- native/android/surface_control.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'native') diff --git a/native/android/surface_control.cpp b/native/android/surface_control.cpp index c1b5f1ddd423..fe4753bd9dd6 100644 --- a/native/android/surface_control.cpp +++ b/native/android/surface_control.cpp @@ -26,14 +26,13 @@ #include #include -#include +#include #include using namespace android::hardware::configstore; using namespace android::hardware::configstore::V1_0; using namespace android; -using android::hardware::configstore::V1_0::ISurfaceFlingerConfigs; using Transaction = SurfaceComposerClient::Transaction; @@ -71,14 +70,13 @@ static bool getHdrSupport(const sp& surfaceControl) { return false; } - HdrCapabilities hdrCapabilities; - status_t err = client->getHdrCapabilities(display, &hdrCapabilities); - if (err) { + ui::DynamicDisplayInfo info; + if (status_t err = client->getDynamicDisplayInfo(display, &info); err != NO_ERROR) { ALOGE("unable to get hdr capabilities"); - return false; + return err; } - return !hdrCapabilities.getSupportedHdrTypes().empty(); + return !info.hdrCapabilities.getSupportedHdrTypes().empty(); } static bool isDataSpaceValid(const sp& surfaceControl, ADataSpace dataSpace) { -- cgit v1.2.3