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

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

Snap for 12658558 from 6e566734 to 25Q1-release

Change-Id: I4e98cf5d5e5be3b917c3a4542fe41f631e8f9841
parents 3774e13e 6e566734
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -3,3 +3,6 @@ per-file input.h,keycodes.h = file:platform/frameworks/base:/INPUT_OWNERS
# Window manager
per-file surface_control_input_receiver.h = file:platform/frameworks/base:/services/core/java/com/android/server/wm/OWNERS
per-file input_transfer_token.h = file:platform/frameworks/base:/services/core/java/com/android/server/wm/OWNERS

# CoGS
per-file *luts* = file:platform/frameworks/base:/graphics/java/android/graphics/OWNERS
 No newline at end of file
+63 −1
Original line number Diff line number Diff line
@@ -19,9 +19,23 @@
 *
 * APerformanceHint allows apps to create performance hint sessions for groups
 * of threads, and provide hints to the system about the workload of those threads,
 * to help the system more accurately allocate power for them. It is the NDK
 * to help the system more accurately allocate resources for them. It is the NDK
 * counterpart to the Java PerformanceHintManager SDK API.
 *
 * This API is intended for periodic workloads, such as frame production. Clients are
 * expected to create an instance of APerformanceHintManager, create a session with
 * that, and then set a target duration for the session. Then, they can report the actual
 * work duration at the end of each cycle to inform the framework about how long those
 * workloads are taking. The framework will then compare the actual durations to the target
 * duration and attempt to help the client reach a steady state under the target.
 *
 * Unlike reportActualWorkDuration, the "notify..." hints are intended to be sent in
 * advance of large changes in the workload, to prevent them from going over the target
 * when there is a sudden, unforseen change. Their effects are intended to last for only
 * one cycle, after which reportActualWorkDuration will have a chance to catch up.
 * These hints should be used judiciously, only in cases where the workload is changing
 * substantially. To enforce that, they are tracked using a per-app rate limiter to avoid
 * excessive hinting and encourage clients to be mindful about when to send them.
 * @{
 */

@@ -249,6 +263,54 @@ int APerformanceHint_reportActualWorkDuration2(
        APerformanceHintSession* _Nonnull session,
        AWorkDuration* _Nonnull workDuration) __INTRODUCED_IN(__ANDROID_API_V__);

/**
 * Informs the framework of an upcoming increase in the workload of a graphics pipeline
 * bound to this session. The user can specify whether the increase is expected to be
 * on the CPU, GPU, or both.
 *
 * Sending hints for both CPU and GPU counts as two separate hints for the purposes of the
 * rate limiter.
 *
 * @param cpu Indicates if the workload increase is expected to affect the CPU.
 * @param gpu Indicates if the workload increase is expected to affect the GPU.
 * @param debugName A required string used to identify this specific hint during
 *        tracing. This debug string will only be held for the duration of the
 *        method, and can be safely discarded after.
 *
 * @return 0 on success.
 *         EINVAL if no hints were requested.
 *         EBUSY if the hint was rate limited.
 *         EPIPE if communication with the system service has failed.
 *         ENOTSUP if the hint is not supported.
 */
int APerformanceHint_notifyWorkloadIncrease(
        APerformanceHintSession* _Nonnull session,
        bool cpu, bool gpu, const char* _Nonnull debugName) __INTRODUCED_IN(36);

/**
 * Informs the framework of an upcoming reset in the workload of a graphics pipeline
 * bound to this session, or the imminent start of a new workload. The user can specify
 * whether the reset is expected to affect the CPU, GPU, or both.
 *
 * Sending hints for both CPU and GPU counts as two separate hints for the purposes of the
 * this load tracking.
 *
 * @param cpu Indicates if the workload reset is expected to affect the CPU.
 * @param gpu Indicates if the workload reset is expected to affect the GPU.
 * @param debugName A required string used to identify this specific hint during
 *        tracing. This debug string will only be held for the duration of the
 *        method, and can be safely discarded after.
 *
 * @return 0 on success.
 *         EINVAL if no hints were requested.
 *         EBUSY if the hint was rate limited.
 *         EPIPE if communication with the system service has failed.
 *         ENOTSUP if the hint is not supported.
 */
int APerformanceHint_notifyWorkloadReset(
        APerformanceHintSession* _Nonnull session,
        bool cpu, bool gpu, const char* _Nonnull debugName) __INTRODUCED_IN(36);

/**
 * Creates a new AWorkDuration. When the client finishes using {@link AWorkDuration}, it should
 * call {@link AWorkDuration_release()} to destroy {@link AWorkDuration} and release all resources
+12 −0
Original line number Diff line number Diff line
@@ -114,6 +114,18 @@ APerformanceHintSession* APerformanceHint_createSessionInternal(APerformanceHint
 */
void APerformanceHint_setUseFMQForTesting(bool enabled);

/**
 * Get the rate limiter properties for testing.
 */
void APerformanceHint_getRateLimiterPropertiesForTesting(
        int32_t* maxLoadHintsPerInterval, int64_t* loadHintInterval);

/*
 * Forces the "new load hint" flag to be disabled for testing.
 */
void APerformanceHint_setUseNewLoadHintBehaviorForTesting(bool newBehavior);


__END_DECLS

#endif // ANDROID_PRIVATE_NATIVE_PERFORMANCE_HINT_PRIVATE_H
+1 −1
Original line number Diff line number Diff line
@@ -829,6 +829,7 @@ aidl_interface {
    backend: {
        rust: {
            apex_available: [
                "//apex_available:platform",
                "com.android.virt",
            ],
            enabled: true,
@@ -881,7 +882,6 @@ cc_library {
        ":__subpackages__",
        "//packages/modules/Virtualization:__subpackages__",
        "//device/google/cuttlefish/shared/minidroid:__subpackages__",
        "//system/software_defined_vehicle:__subpackages__",
        "//visibility:any_system_partition",
    ],
}
+0 −1
Original line number Diff line number Diff line
@@ -27,7 +27,6 @@ rust_library {
    visibility: [
        "//device/google/cuttlefish/shared/minidroid/sample",
        "//packages/modules/Virtualization:__subpackages__",
        "//system/software_defined_vehicle:__subpackages__",
    ],
    apex_available: [
        "//apex_available:platform",
Loading