OSDN Git Service

Allow VirtualDisplay's to use hardware composer when in VR mode even if
authorAlex Sakhartchouk <alexst@google.com>
Sun, 26 Mar 2017 16:28:34 +0000 (12:28 -0400)
committerSantos Cordon <santoscordon@google.com>
Fri, 31 Mar 2017 17:03:07 +0000 (17:03 +0000)
physical composer does not support them.

Bug: 36071574
Test: Applied remaining wip patches, launched 2D activity while in
persistent VR mode. Observed 2D activity rendered in VR in VirtualDisplay.
Further, instrumented SurfaceFlinger code to ensure DisplayDevice's are
created and destroyed with proper composers during VR mode transition.

Change-Id: I12b09f1209fcf33f97abfd77e14c6ce61f45a5e9
(cherry picked from commit d38ec4e294eadd4f655476fc90b675c78c1c8740)

services/surfaceflinger/SurfaceFlinger.cpp

index f82b363..04358dc 100644 (file)
@@ -1903,7 +1903,8 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags)
                         // etc.) but no internal state (i.e. a DisplayDevice).
                         if (state.surface != NULL) {
 
-                            if (mUseHwcVirtualDisplays) {
+                            // Allow VR composer to use virtual displays.
+                            if (mUseHwcVirtualDisplays || mHwc == mVrHwc) {
                                 int width = 0;
                                 int status = state.surface->query(
                                         NATIVE_WINDOW_WIDTH, &width);