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

Commit 54673d43 authored by Ady Abraham's avatar Ady Abraham Committed by Android (Google) Code Review
Browse files

Merge "Revert "Revert "SF: opportunistically try to present the next vs..."" into main

parents c7199930 529bd9f6
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -31,9 +31,6 @@ cc_defaults {
        "-Wconversion",
        "-DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION",
    ],
    static_libs: [
        "libsurfaceflingerflags",
    ],
}

cc_defaults {
+3 −0
Original line number Diff line number Diff line
@@ -63,6 +63,7 @@ cc_defaults {
cc_library {
    name: "libcompositionengine",
    defaults: ["libcompositionengine_defaults"],
    static_libs: ["libsurfaceflingerflags"],
    srcs: [
        "src/planner/CachedSet.cpp",
        "src/planner/Flattener.cpp",
@@ -107,6 +108,7 @@ cc_library {
        "libgtest",
        "libgmock",
        "libcompositionengine",
        "libsurfaceflingerflags_test",
    ],
    local_include_dirs: ["include"],
    export_include_dirs: ["include"],
@@ -141,6 +143,7 @@ cc_test {
        "librenderengine_mocks",
        "libgmock",
        "libgtest",
        "libsurfaceflingerflags_test",
    ],
    // For some reason, libvulkan isn't picked up from librenderengine
    // Probably ASAN related?
+11 −2
Original line number Diff line number Diff line
@@ -28,10 +28,13 @@
#include "VSyncDispatchTimerQueue.h"
#include "VSyncTracker.h"

#include <com_android_graphics_surfaceflinger_flags.h>

#undef LOG_TAG
#define LOG_TAG "VSyncDispatch"

namespace android::scheduler {
using namespace com::android::graphics::surfaceflinger;

using base::StringAppendF;

@@ -100,9 +103,15 @@ ScheduleResult VSyncDispatchTimerQueueEntry::schedule(VSyncDispatch::ScheduleTim
            mArmedInfo && (nextVsyncTime > (mArmedInfo->mActualVsyncTime + mMinVsyncDistance));
    bool const wouldSkipAWakeup =
            mArmedInfo && ((nextWakeupTime > (mArmedInfo->mActualWakeupTime + mMinVsyncDistance)));
    if (flags::dont_skip_on_early()) {
        if (wouldSkipAVsyncTarget || wouldSkipAWakeup) {
            return getExpectedCallbackTime(mArmedInfo->mActualVsyncTime, timing);
        }
    } else {
        if (wouldSkipAVsyncTarget && wouldSkipAWakeup) {
            return getExpectedCallbackTime(nextVsyncTime, timing);
        }
    }

    nextVsyncTime = adjustVsyncIfNeeded(tracker, nextVsyncTime);
    nextWakeupTime = nextVsyncTime - timing.workDuration - timing.readyDuration;
+2 −0
Original line number Diff line number Diff line
@@ -6446,6 +6446,8 @@ void SurfaceFlinger::dumpAllLocked(const DumpArgs& args, const std::string& comp
                  mMisc2FlagEarlyBootValue == mMisc2FlagLateBootValue ? "stable" : "modified");
    StringAppendF(&result, "VrrConfigFlagValue: %s\n",
                  flagutils::vrrConfigEnabled() ? "true" : "false");
    StringAppendF(&result, "DontSkipOnEarlyFlagValue: %s\n",
                  flags::dont_skip_on_early() ? "true" : "false");

    getRenderEngine().dump(result);

+7 −0
Original line number Diff line number Diff line
@@ -38,3 +38,10 @@ flag {
  bug: "283055450"
  is_fixed_read_only: true
}

flag {
  name: "dont_skip_on_early"
  namespace: "core_graphics"
  description: "This flag is guarding the behaviour where SurfaceFlinger is trying to opportunistically present a frame when the configuration change from late to early"
  bug: "273702768"
}
Loading