From dcb38bbd32eb96ec46d69658390353a853b3af6d Mon Sep 17 00:00:00 2001 From: Dominik Laskowski Date: Fri, 25 Jan 2019 02:35:50 -0800 Subject: SF: Plumb physical display IDs to libgui This CL replaces ISurfaceComposer::{eDisplayIdMain,eDisplayIdHdmi} with the stable 64-bit display IDs generated by SF. Note that the 64-bit IDs fall back to the old values if the HWC API for display identification is not supported. Bug: 74619554 Test: LocalDisplayAdapter and Choreographer receive 64-bit IDs Test: 64-bit IDs fall back to 0 and 1 on HWC 2.2 and below Change-Id: I3c08eff6eb8bb179ecce596ab2820a2aa44c8649 --- libs/gui/Surface.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'libs/gui/Surface.cpp') diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp index 1f726b2ba4..3affa23482 100644 --- a/libs/gui/Surface.cpp +++ b/libs/gui/Surface.cpp @@ -321,8 +321,11 @@ status_t Surface::getFrameTimestamps(uint64_t frameNumber, status_t Surface::getWideColorSupport(bool* supported) { ATRACE_CALL(); - sp display( - composerService()->getBuiltInDisplay(ISurfaceComposer::eDisplayIdMain)); + const sp display = composerService()->getInternalDisplayToken(); + if (display == nullptr) { + return NAME_NOT_FOUND; + } + *supported = false; status_t error = composerService()->isWideColorDisplay(display, supported); return error; @@ -331,8 +334,11 @@ status_t Surface::getWideColorSupport(bool* supported) { status_t Surface::getHdrSupport(bool* supported) { ATRACE_CALL(); - sp display( - composerService()->getBuiltInDisplay(ISurfaceComposer::eDisplayIdMain)); + const sp display = composerService()->getInternalDisplayToken(); + if (display == nullptr) { + return NAME_NOT_FOUND; + } + HdrCapabilities hdrCapabilities; status_t err = composerService()->getHdrCapabilities(display, &hdrCapabilities); -- cgit v1.2.3-59-g8ed1b