From 3316a0a08e79739b0508087232efcb3f2803dafe Mon Sep 17 00:00:00 2001 From: Dominik Laskowski Date: Fri, 25 Jan 2019 02:56:41 -0800 Subject: Generalize physical display management This CL enables the framework to manage an arbitrary number of physical displays. It also surfaces physical display IDs, which are stable across reboots and encode (model, port) information that will be propagated further up in a follow-up CL. Bug: 116025192 Test: Boot with more than two displays Test: Hotplug works with any number of displays Test: Verify stable display IDs with "dumpsys display" Change-Id: Idb2eaff66b2e0873be6ad27d337ff18b730d1331 --- cmds/bootanimation/BootAnimation.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'cmds/bootanimation/BootAnimation.cpp') diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp index 5dcb392b002d..46917e4f6062 100644 --- a/cmds/bootanimation/BootAnimation.cpp +++ b/cmds/bootanimation/BootAnimation.cpp @@ -252,10 +252,12 @@ status_t BootAnimation::initTexture(FileMap* map, int* width, int* height) status_t BootAnimation::readyToRun() { mAssets.addDefaultAssets(); - sp dtoken(SurfaceComposerClient::getBuiltInDisplay( - ISurfaceComposer::eDisplayIdMain)); + mDisplayToken = SurfaceComposerClient::getInternalDisplayToken(); + if (mDisplayToken == nullptr) + return -1; + DisplayInfo dinfo; - status_t status = SurfaceComposerClient::getDisplayInfo(dtoken, &dinfo); + status_t status = SurfaceComposerClient::getDisplayInfo(mDisplayToken, &dinfo); if (status) return -1; @@ -1014,16 +1016,13 @@ void BootAnimation::handleViewport(nsecs_t timestep) { // At the end of the animation, we switch to the viewport that DisplayManager will apply // later. This changes the coordinate system, and means we must move the surface up by // the inset amount. - sp dtoken(SurfaceComposerClient::getBuiltInDisplay( - ISurfaceComposer::eDisplayIdMain)); - Rect layerStackRect(0, 0, mWidth, mHeight - mTargetInset); Rect displayRect(0, mTargetInset, mWidth, mHeight); SurfaceComposerClient::Transaction t; t.setPosition(mFlingerSurfaceControl, 0, -mTargetInset) .setCrop(mFlingerSurfaceControl, Rect(0, mTargetInset, mWidth, mHeight)); - t.setDisplayProjection(dtoken, 0 /* orientation */, layerStackRect, displayRect); + t.setDisplayProjection(mDisplayToken, 0 /* orientation */, layerStackRect, displayRect); t.apply(); mTargetInset = mCurrentInset = 0; -- cgit v1.2.3-59-g8ed1b