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

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

Merge "SF: add first trunk-stable flag" into main

parents 2271305f 5ffd98a1
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -7,6 +7,17 @@ package {
    default_applicable_licenses: ["frameworks_native_license"],
}

aconfig_declarations {
    name: "surfaceflinger_flags",
    package: "com.android.graphics.surfaceflinger.flags",
    srcs: ["surfaceflinger_flags.aconfig"],
}

cc_aconfig_library {
    name: "libsurfaceflingerflags",
    aconfig_declarations: "surfaceflinger_flags",
}

cc_defaults {
    name: "surfaceflinger_defaults",
    cflags: [
@@ -20,6 +31,9 @@ cc_defaults {
        "-Wconversion",
        "-DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION",
    ],
    static_libs: [
        "libsurfaceflingerflags",
    ],
}

cc_defaults {
@@ -84,6 +98,7 @@ cc_defaults {
        "libshaders",
        "libtimestats",
        "libtonemap",
        "libsurfaceflingerflags",
    ],
    header_libs: [
        "android.hardware.graphics.composer@2.1-command-buffer",
+10 −0
Original line number Diff line number Diff line
@@ -161,6 +161,8 @@
#include <aidl/android/hardware/graphics/composer3/DisplayCapability.h>
#include <aidl/android/hardware/graphics/composer3/RenderIntent.h>

#include <com_android_graphics_surfaceflinger_flags.h>

#undef NO_THREAD_SAFETY_ANALYSIS
#define NO_THREAD_SAFETY_ANALYSIS \
    _Pragma("GCC error \"Prefer <ftl/fake_guard.h> or MutexUtils.h helpers.\"")
@@ -170,6 +172,7 @@
#define DOES_CONTAIN_BORDER false

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

using namespace std::chrono_literals;
using namespace std::string_literals;
@@ -490,6 +493,8 @@ SurfaceFlinger::SurfaceFlinger(Factory& factory) : SurfaceFlinger(factory, SkipI
            base::GetBoolProperty("persist.debug.sf.enable_layer_lifecycle_manager"s, true);
    mLegacyFrontEndEnabled = !mLayerLifecycleManagerEnabled ||
            base::GetBoolProperty("persist.debug.sf.enable_legacy_frontend"s, false);

    mMiscFlagValue = flags::misc1();
}

LatchUnsignaledConfig SurfaceFlinger::getLatchUnsignaledConfig() {
@@ -731,6 +736,8 @@ void SurfaceFlinger::bootFinished() {
            enableRefreshRateOverlay(true);
        }
    }));

    LOG_ALWAYS_FATAL_IF(flags::misc1() != mMiscFlagValue, "misc1 flag is not boot stable!");
}

static std::optional<renderengine::RenderEngine::RenderEngineType>
@@ -5912,6 +5919,7 @@ status_t SurfaceFlinger::doDump(int fd, const DumpArgs& args, bool asProto) {
            }
        }
    }

    write(fd, result.c_str(), result.size());
    return NO_ERROR;
}
@@ -6333,6 +6341,8 @@ void SurfaceFlinger::dumpAllLocked(const DumpArgs& args, const std::string& comp
    result.append("SurfaceFlinger global state:\n");
    colorizer.reset(result);

    StringAppendF(&result, "MiscFlagValue: %s\n", mMiscFlagValue ? "true" : "false");

    getRenderEngine().dump(result);

    result.append("ClientCache state:\n");
+2 −0
Original line number Diff line number Diff line
@@ -1450,6 +1450,8 @@ private:
    void sfdo_setDebugFlash(int delay);
    void sfdo_scheduleComposite();
    void sfdo_scheduleCommit();

    bool mMiscFlagValue;
};

class SurfaceComposerAIDL : public gui::BnSurfaceComposer {
+9 −0
Original line number Diff line number Diff line
package: "com.android.graphics.surfaceflinger.flags"

flag {
  name: "misc1"
  namespace: "core_graphics"
  description: "This flag controls minor miscellaneous SurfaceFlinger changes"
  bug: "297389311"
  is_fixed_read_only: true
}
 No newline at end of file