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

Commit bc120be8 authored by Dan Stoza's avatar Dan Stoza Committed by Android Git Automerger
Browse files

am 2121b937: am 04eeb288: am 50be1df7: Merge "SF: Track missed frames and...

am 2121b937: am 04eeb288: am 50be1df7: Merge "SF: Track missed frames and optionally drop them" into mnc-dr-dev

* commit '2121b937':
  SF: Track missed frames and optionally drop them
parents 946fa817 2121b937
Loading
Loading
Loading
Loading
+28 −6
Original line number Original line Diff line number Diff line
@@ -163,6 +163,9 @@ SurfaceFlinger::SurfaceFlinger()
    property_get("ro.bq.gpu_to_cpu_unsupported", value, "0");
    property_get("ro.bq.gpu_to_cpu_unsupported", value, "0");
    mGpuToCpuSupported = !atoi(value);
    mGpuToCpuSupported = !atoi(value);


    property_get("debug.sf.drop_missed_frames", value, "0");
    mDropMissedFrames = atoi(value);

    property_get("debug.sf.showupdates", value, "0");
    property_get("debug.sf.showupdates", value, "0");
    mDebugRegion = atoi(value);
    mDebugRegion = atoi(value);


@@ -919,6 +922,22 @@ bool SurfaceFlinger::handleMessageInvalidate() {


void SurfaceFlinger::handleMessageRefresh() {
void SurfaceFlinger::handleMessageRefresh() {
    ATRACE_CALL();
    ATRACE_CALL();

    static nsecs_t previousExpectedPresent = 0;
    nsecs_t expectedPresent = mPrimaryDispSync.computeNextRefresh(0);
    static bool previousFrameMissed = false;
    bool frameMissed = (expectedPresent == previousExpectedPresent);
    if (frameMissed != previousFrameMissed) {
        ATRACE_INT("FrameMissed", static_cast<int>(frameMissed));
    }
    previousFrameMissed = frameMissed;

    if (CC_UNLIKELY(mDropMissedFrames && frameMissed)) {
        // Latch buffers, but don't send anything to HWC, then signal another
        // wakeup for the next vsync
        preComposition();
        repaintEverything();
    } else {
        preComposition();
        preComposition();
        rebuildLayerStacks();
        rebuildLayerStacks();
        setUpHWComposer();
        setUpHWComposer();
@@ -927,6 +946,9 @@ void SurfaceFlinger::handleMessageRefresh() {
        postComposition();
        postComposition();
    }
    }


    previousExpectedPresent = mPrimaryDispSync.computeNextRefresh(0);
}

void SurfaceFlinger::doDebugFlashRegions()
void SurfaceFlinger::doDebugFlashRegions()
{
{
    // is debugging enabled
    // is debugging enabled
+1 −0
Original line number Original line Diff line number Diff line
@@ -445,6 +445,7 @@ private:
    RenderEngine* mRenderEngine;
    RenderEngine* mRenderEngine;
    nsecs_t mBootTime;
    nsecs_t mBootTime;
    bool mGpuToCpuSupported;
    bool mGpuToCpuSupported;
    bool mDropMissedFrames;
    sp<EventThread> mEventThread;
    sp<EventThread> mEventThread;
    sp<EventThread> mSFEventThread;
    sp<EventThread> mSFEventThread;
    sp<EventControlThread> mEventControlThread;
    sp<EventControlThread> mEventControlThread;