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

Commit cce24b39 authored by Dan Stoza's avatar Dan Stoza Committed by android-build-merger
Browse files

DO NOT MERGE SF: Add property to disable HWC virtual displays

am: 3cf4bfe2

Change-Id: I615cdf9466cbb37d32890f126dc0be1fecf9a50a
parents 31212b50 3cf4bfe2
Loading
Loading
Loading
Loading
+31 −20
Original line number Diff line number Diff line
@@ -183,6 +183,10 @@ SurfaceFlinger::SurfaceFlinger()
    property_get("debug.sf.disable_backpressure", value, "0");
    mPropagateBackpressure = !atoi(value);
    ALOGI_IF(!mPropagateBackpressure, "Disabling backpressure propagation");

    property_get("debug.sf.disable_hwc_vds", value, "0");
    mUseHwcVirtualDisplays = !atoi(value);
    ALOGI_IF(!mUseHwcVirtualDisplays, "Disabling HWC virtual displays");
}

void SurfaceFlinger::onFirstRef()
@@ -1582,6 +1586,7 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags)
                        // etc.) but no internal state (i.e. a DisplayDevice).
                        if (state.surface != NULL) {

                            if (mUseHwcVirtualDisplays) {
                                int width = 0;
                                int status = state.surface->query(
                                        NATIVE_WINDOW_WIDTH, &width);
@@ -1602,6 +1607,7 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags)

                                mHwc->allocateVirtualDisplay(width, height, &format,
                                        &hwcId);
                            }

                            // TODO: Plumb requested format back up to consumer

@@ -3276,6 +3282,11 @@ status_t SurfaceFlinger::onTransact(
                mSFEventThread->setPhaseOffset(static_cast<nsecs_t>(n));
                return NO_ERROR;
            }
            case 1021: { // Disable HWC virtual displays
                n = data.readInt32();
                mUseHwcVirtualDisplays = !n;
                return NO_ERROR;
            }
        }
    }
    return err;
+1 −0
Original line number Diff line number Diff line
@@ -529,6 +529,7 @@ private:
#ifdef USE_HWC2
    bool mPropagateBackpressure = true;
#endif
    bool mUseHwcVirtualDisplays = true;

    // these are thread safe
    mutable MessageQueue mEventQueue;
+12 −2
Original line number Diff line number Diff line
@@ -181,6 +181,10 @@ SurfaceFlinger::SurfaceFlinger()
    }
    ALOGI_IF(mDebugRegion, "showupdates enabled");
    ALOGI_IF(mDebugDDMS, "DDMS debugging enabled");

    property_get("debug.sf.disable_hwc_vds", value, "0");
    mUseHwcVirtualDisplays = !atoi(value);
    ALOGI_IF(!mUseHwcVirtualDisplays, "Disabling HWC virtual displays");
}

void SurfaceFlinger::onFirstRef()
@@ -1508,9 +1512,10 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags)
                                    NATIVE_WINDOW_HEIGHT, &height);
                            ALOGE_IF(status != NO_ERROR,
                                    "Unable to query height (%d)", status);
                            if (MAX_VIRTUAL_DISPLAY_DIMENSION == 0 ||
                            if (mUseHwcVirtualDisplays &&
                                    (MAX_VIRTUAL_DISPLAY_DIMENSION == 0 ||
                                    (width <= MAX_VIRTUAL_DISPLAY_DIMENSION &&
                                     height <= MAX_VIRTUAL_DISPLAY_DIMENSION)) {
                                     height <= MAX_VIRTUAL_DISPLAY_DIMENSION))) {
                                hwcDisplayId = allocateHwcDisplayId(state.type);
                            }

@@ -3190,6 +3195,11 @@ status_t SurfaceFlinger::onTransact(
                mSFEventThread->setPhaseOffset(static_cast<nsecs_t>(n));
                return NO_ERROR;
            }
            case 1021: { // Disable HWC virtual displays
                n = data.readInt32();
                mUseHwcVirtualDisplays = !n;
                return NO_ERROR;
            }
        }
    }
    return err;