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

Commit ced0b069 authored by Ramkumar Radhakrishnan's avatar Ramkumar Radhakrishnan Committed by Linux Build Service Account
Browse files

sf: Remove 50ms delay when external animation is disabled

1. Delay display projection transaction by 50ms when disable external
   animation feature is enabled.
2. Read the property sys.disable_ext_animation only during bootup to
   avoid unneccessary read for every draw cycle.

Change-Id: I9d57b6745ce794f8d942bb41086da060a2985395
parent 766d5f67
Loading
Loading
Loading
Loading
+22 −15
Original line number Diff line number Diff line
@@ -188,6 +188,9 @@ SurfaceFlinger::SurfaceFlinger()
    if(mGpuTileRenderEnable)
       ALOGV("DirtyRect optimization enabled for FULL GPU Composition");
    mUnionDirtyRect.clear();

    property_get("sys.disable_ext_animation", value, "0");
    mDisableExtAnimation = atoi(value) ? true : false;
#endif

    ALOGI_IF(mDebugRegion, "showupdates enabled");
@@ -1137,9 +1140,9 @@ void SurfaceFlinger::setUpHWComposer() {
#ifdef QCOM_BSP
                bool freezeSurfacePresent = false;
                const size_t layerCount = layers.size();
                char value[PROPERTY_VALUE_MAX];
                property_get("sys.disable_ext_animation", value, "0");
                if(atoi(value) && (id != HWC_DISPLAY_PRIMARY)) {
                // Look for ScreenShotSurface in external layer list, only when
                // disable external rotation animation feature is enabled
                if(mDisableExtAnimation && (id != HWC_DISPLAY_PRIMARY)) {
                    for (size_t i = 0 ; i < layerCount ; ++i) {
                        static int screenShotLen = strlen("ScreenshotSurface");
                        const sp<Layer>& layer(layers[i]);
@@ -2316,14 +2319,17 @@ void SurfaceFlinger::setTransactionState(
    ATRACE_CALL();
    size_t count = displays.size();
#ifdef QCOM_BSP
    // Delay the display projection transaction by 50ms only when the disable
    // external rotation animation feature is enabled
    if(mDisableExtAnimation) {
        for (size_t i=0 ; i<count ; i++) {
            const DisplayState& s(displays[i]);
            if(s.token != mBuiltinDisplays[DisplayDevice::DISPLAY_PRIMARY]) {
                const uint32_t what = s.what;
                // Invalidate and Delay the binder thread by 50 ms on
                // eDisplayProjectionChanged to trigger a draw cycle so that
            // it can fix one incorrect frame on the External, when we disable
            // external animation
                // it can fix one incorrect frame on the External, when we
                // disable external animation
                if (what & DisplayState::eDisplayProjectionChanged) {
                    invalidateHwcGeometry();
                    repaintEverything();
@@ -2331,6 +2337,7 @@ void SurfaceFlinger::setTransactionState(
                }
            }
        }
    }
#endif
    Mutex::Autolock _l(mStateLock);
    uint32_t transactionFlags = 0;
+4 −0
Original line number Diff line number Diff line
@@ -525,6 +525,10 @@ private:

    mat4 mColorMatrix;
    bool mHasColorMatrix;
#ifdef QCOM_BSP
    // Flag to disable external rotation animation feature.
    bool mDisableExtAnimation;
#endif
};

}; // namespace android