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

Commit b7e15527 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 12587146 from fb429a02 to 25Q1-release

Change-Id: I339bba8719e459b9c0a116d38a4421dd3005a1bd
parents 70d2ce93 fb429a02
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -52,7 +52,6 @@
 *   - DO NOT CHANGE THE LAYOUT OR SIZE OF STRUCTURES
 */

#include <android/api-level.h>
#include <stdbool.h>
#include <stdint.h>
#include <unistd.h>
+63 −0
Original line number Diff line number Diff line
@@ -762,6 +762,69 @@ void ASurfaceTransaction_setFrameRateWithChangeStrategy(ASurfaceTransaction* _No
                                                        int8_t changeFrameRateStrategy)
                                                        __INTRODUCED_IN(31);

/**
 * Sets the intended frame rate for the given \a surface_control.
 *
 * On devices that are capable of running the display at different frame rates,
 * the system may choose a display refresh rate to better match this surface's frame
 * rate. Usage of this API won't introduce frame rate throttling, or affect other
 * aspects of the application's frame production pipeline. However, because the system
 * may change the display refresh rate, calls to this function may result in changes
 * to Choreographer callback timings, and changes to the time interval at which the
 * system releases buffers back to the application.
 *
 * You can register for changes in the refresh rate using
 * \a AChoreographer_registerRefreshRateCallback.
 *
 * See ASurfaceTransaction_clearFrameRate().
 *
 * Available since API level 36.
 *
 * \param desiredMinRate The desired minimum frame rate (inclusive) for the surface, specifying that
 * the surface prefers the device render rate to be at least `desiredMinRate`.
 *
 * <p>Set `desiredMinRate` = `desiredMaxRate` to indicate the surface prefers an exact frame rate.
 *
 * <p>Set `desiredMinRate` = 0 to indicate the surface has no preference
 * and any frame rate is acceptable.
 *
 * <p>The value should be greater than or equal to 0.
 *
 * \param desiredMaxRate The desired maximum frame rate (inclusive) for the surface, specifying that
 * the surface prefers the device render rate to be at most `desiredMaxRate`.
 *
 * <p>Set `desiredMaxRate` = `desiredMinRate` to indicate the surface prefers an exact frame rate.
 *
 * <p>Set `desiredMaxRate` = positive infinity to indicate the surface has no preference
 * and any frame rate is acceptable.
 *
 * <p>The value should be greater than or equal to `desiredMinRate`.
 *
 * \param fixedSourceRate The "fixed source" frame rate of the surface if the content has an
 * inherently fixed frame rate, e.g. a video that has a specific frame rate.
 *
 * <p>When the frame rate chosen for the surface is the `fixedSourceRate` or a
 * multiple, the surface can render without frame pulldown, for optimal smoothness. For
 * example, a 30 fps video (`fixedSourceRate`=30) renders just as smoothly on 30 fps,
 * 60 fps, 90 fps, 120 fps, and so on.
 *
 * <p>Setting the fixed source rate can also be used together with a desired
 * frame rate min and max via setting `desiredMinRate` and `desiredMaxRate`. This still
 * means the surface's content has a fixed frame rate of `fixedSourceRate`, but additionally
 * specifies the preference to be in the range [`desiredMinRate`, `desiredMaxRate`]. For example, an
 * app might want to specify there is 30 fps video (`fixedSourceRate`=30) as well as a smooth
 * animation on the same surface which looks good when drawing within a frame rate range such as
 * [`desiredMinRate`, `desiredMaxRate`] = [60,120].
 *
 * \param changeFrameRateStrategy Whether display refresh rate transitions caused by this surface
 * should be seamless. A seamless transition is one that doesn't have any visual interruptions, such
 * as a black screen for a second or two.
 */
void ASurfaceTransaction_setFrameRateParams(
        ASurfaceTransaction* _Nonnull transaction, ASurfaceControl* _Nonnull surface_control,
        float desiredMinRate, float desiredMaxRate, float fixedSourceRate,
        ANativeWindow_ChangeFrameRateStrategy changeFrameRateStrategy) __INTRODUCED_IN(36);

/**
 * Clears the frame rate which is set for \a surface_control.
 *
+47 −10
Original line number Diff line number Diff line
@@ -254,14 +254,30 @@ void perfettoTraceAsyncBeginForTrack(const struct PerfettoTeCategory& category,
                                       const char* trackName, uint64_t cookie) {
  PERFETTO_TE(
        category, PERFETTO_TE_SLICE_BEGIN(name),
      PERFETTO_TE_NAMED_TRACK(trackName, cookie, PerfettoTeProcessTrackUuid()));
        PERFETTO_TE_PROTO_TRACK(
            PerfettoTeNamedTrackUuid(trackName, cookie,
                                     PerfettoTeProcessTrackUuid()),
            PERFETTO_TE_PROTO_FIELD_CSTR(
                perfetto_protos_TrackDescriptor_atrace_name_field_number,
                trackName),
            PERFETTO_TE_PROTO_FIELD_VARINT(
                perfetto_protos_TrackDescriptor_parent_uuid_field_number,
                PerfettoTeProcessTrackUuid())));
}

void perfettoTraceAsyncEndForTrack(const struct PerfettoTeCategory& category,
                                     const char* trackName, uint64_t cookie) {
    PERFETTO_TE(
        category, PERFETTO_TE_SLICE_END(),
      PERFETTO_TE_NAMED_TRACK(trackName, cookie, PerfettoTeProcessTrackUuid()));
        PERFETTO_TE_PROTO_TRACK(
            PerfettoTeNamedTrackUuid(trackName, cookie,
                                     PerfettoTeProcessTrackUuid()),
            PERFETTO_TE_PROTO_FIELD_CSTR(
                perfetto_protos_TrackDescriptor_atrace_name_field_number,
                trackName),
            PERFETTO_TE_PROTO_FIELD_VARINT(
                perfetto_protos_TrackDescriptor_parent_uuid_field_number,
                PerfettoTeProcessTrackUuid())));
}

void perfettoTraceAsyncBegin(const struct PerfettoTeCategory& category, const char* name,
@@ -282,12 +298,33 @@ void perfettoTraceInstantForTrack(const struct PerfettoTeCategory& category,
                                    const char* trackName, const char* name) {
  PERFETTO_TE(
        category, PERFETTO_TE_INSTANT(name),
      PERFETTO_TE_NAMED_TRACK(trackName, 1, PerfettoTeProcessTrackUuid()));
        PERFETTO_TE_PROTO_TRACK(
            PerfettoTeNamedTrackUuid(trackName, 1,
                                     PerfettoTeProcessTrackUuid()),
            PERFETTO_TE_PROTO_FIELD_CSTR(
                perfetto_protos_TrackDescriptor_atrace_name_field_number,
                trackName),
            PERFETTO_TE_PROTO_FIELD_VARINT(
                perfetto_protos_TrackDescriptor_parent_uuid_field_number,
                PerfettoTeProcessTrackUuid())));
}

void perfettoTraceCounter(const struct PerfettoTeCategory& category,
                            [[maybe_unused]] const char* name, int64_t value) {
  PERFETTO_TE(category, PERFETTO_TE_COUNTER(),
                          const char* name, int64_t value) {
  PERFETTO_TE(
        category, PERFETTO_TE_COUNTER(),
        PERFETTO_TE_PROTO_TRACK(
            PerfettoTeCounterTrackUuid(name,
                                       PerfettoTeProcessTrackUuid()),
            PERFETTO_TE_PROTO_FIELD_CSTR(
                perfetto_protos_TrackDescriptor_atrace_name_field_number,
                name),
            PERFETTO_TE_PROTO_FIELD_VARINT(
                perfetto_protos_TrackDescriptor_parent_uuid_field_number,
                PerfettoTeProcessTrackUuid()),
            PERFETTO_TE_PROTO_FIELD_BYTES(
                perfetto_protos_TrackDescriptor_counter_field_number,
                PERFETTO_NULL, 0)),
        PERFETTO_TE_INT_COUNTER(value));
}
}  // namespace internal
+2 −0
Original line number Diff line number Diff line
@@ -156,6 +156,7 @@ void FlagManager::dump(std::string& result) const {
    DUMP_READ_ONLY_FLAG(trace_frame_rate_override);
    DUMP_READ_ONLY_FLAG(true_hdr_screenshots);
    DUMP_READ_ONLY_FLAG(display_config_error_hal);
    DUMP_READ_ONLY_FLAG(connected_display_hdr);

#undef DUMP_READ_ONLY_FLAG
#undef DUMP_SERVER_FLAG
@@ -260,6 +261,7 @@ FLAG_MANAGER_READ_ONLY_FLAG(flush_buffer_slots_to_uncache, "");
FLAG_MANAGER_READ_ONLY_FLAG(force_compile_graphite_renderengine, "");
FLAG_MANAGER_READ_ONLY_FLAG(true_hdr_screenshots, "debug.sf.true_hdr_screenshots");
FLAG_MANAGER_READ_ONLY_FLAG(display_config_error_hal, "");
FLAG_MANAGER_READ_ONLY_FLAG(connected_display_hdr, "");

/// Trunk stable server flags ///
FLAG_MANAGER_SERVER_FLAG(refresh_rate_overlay_on_external_display, "")
+1 −0
Original line number Diff line number Diff line
@@ -94,6 +94,7 @@ public:
    bool trace_frame_rate_override() const;
    bool true_hdr_screenshots() const;
    bool display_config_error_hal() const;
    bool connected_display_hdr() const;

protected:
    // overridden for unit tests
Loading