Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2333ecb6 authored by Robert Carr's avatar Robert Carr
Browse files

WM: Prepare BLASTSync to flip main BLAST flag.

We will flip BLAST on in multiple stages. First the main
BLASTBufferQueue adapter, and in a second stage BLASTSyncEngine
buffer passing. We protect the usage of this buffer passing behind
a compile time flag so we can flip the main flag while continuing
development on this. While we are here, we also take care to
look at this flag from when processing the MainWindowSizeTransaction
if BLASTSync is disabled we need to use deferred transactions to make
this work, but if BLASTSync is enabled, deferred transactions will
actually sabotage us, preventing the buffer from latching.

Bug: 152346200
Test: Existing tests pass
Change-Id: I8a5d700c4b2e0da814ed12da3fb8521cba8849da
parent f2a595df
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -665,6 +665,8 @@ public class WindowManagerService extends IWindowManager.Stub

    // Whether the system should use BLAST for ViewRootImpl
    final boolean mUseBLAST;
    // Whether to enable BLASTSyncEngine Transaction passing.
    final boolean mUseBLASTSync = false;

    int mDockedStackCreateMode = SPLIT_SCREEN_CREATE_MODE_TOP_OR_LEFT;
    Rect mDockedStackCreateBounds;
@@ -2131,7 +2133,7 @@ public class WindowManagerService extends IWindowManager.Stub
                win.finishSeamlessRotation(false /* timeout */);
            }

            if (win.useBLASTSync()) {
            if (mUseBLASTSync && win.useBLASTSync()) {
                result |= RELAYOUT_RES_BLAST_SYNC;
            }

@@ -5131,6 +5133,10 @@ public class WindowManagerService extends IWindowManager.Stub
        return mUseBLAST;
    }

    public boolean useBLASTSync() {
        return mUseBLASTSync;
    }

    @Override
    public void getInitialDisplaySize(int displayId, Point size) {
        synchronized (mGlobalLock) {
+9 −0
Original line number Diff line number Diff line
@@ -5904,6 +5904,15 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
            return;
        }

        final Task task = getTask();
        if (task != null) {
            final SurfaceControl.Transaction t = task.getMainWindowSizeChangeTransaction();
            if (t != null) {
                mBLASTSyncTransaction.merge(t);
            }
            task.setMainWindowSizeChangeTransaction(null);
        }

        // If localSyncId is >0 then we are syncing with children and will
        // invoke transaction ready from our own #transactionReady callback
        // we just need to signal our side of the sync (setReady). But if we
+5 −0
Original line number Diff line number Diff line
@@ -752,6 +752,11 @@ class WindowStateAnimator {
    }

    private boolean shouldConsumeMainWindowSizeTransaction() {
      // If we use BLASTSync we always consume the transaction when finishing
      // the sync.
      if (mService.useBLASTSync()) {
          return false;
      }
      // We only consume the transaction when the client is calling relayout
      // because this is the only time we know the frameNumber will be valid
      // due to the client renderer being paused. Put otherwise, only when