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

Commit 39f67c03 authored by Matt Buckley's avatar Matt Buckley Committed by Android (Google) Code Review
Browse files

Merge "Add CPU/GPU_LOAD_SPIKE hints for one-off expensive workloads" into main

parents acc94381 fd2b7869
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -358,6 +358,31 @@ int APerformanceHint_notifyWorkloadReset(
        APerformanceHintSession* _Nonnull session,
        bool cpu, bool gpu, const char* _Nonnull debugName) __INTRODUCED_IN(36);

/**
 * Informs the framework of an upcoming one-off expensive frame for a graphics pipeline
 * bound to this session. This frame will be treated as not representative of the workload as a
 * whole, and it will be discarded the purposes of load tracking. The user can specify
 * whether the workload spike 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 spike is expected to affect the CPU.
 * @param gpu Indicates if the workload spike 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_notifyWorkloadSpike(
        APerformanceHintSession* _Nonnull session,
        bool cpu, bool gpu, const char* _Nonnull debugName) __INTRODUCED_IN(36);

/**
 * Associates a session with any {@link ASurfaceControl} or {@link ANativeWindow}
 * instances managed by this session.
+14 −0
Original line number Diff line number Diff line
@@ -74,6 +74,20 @@ enum SessionHint: int32_t {
     * baseline to prepare for an arbitrary load, and must wake up if inactive.
     */
    GPU_LOAD_RESET = 7,

    /**
     * This hint indicates an upcoming CPU workload that is abnormally large and
     * not representative of the workload. This should be used for rare, one-time
     * operations and should be ignored by any load tracking or session hysteresis.
     */
    CPU_LOAD_SPIKE = 8,

    /**
     * This hint indicates an upcoming GPU workload that is abnormally large and
     * not representative of the workload. This should be used for rare, one-time
     * operations and should be ignored by any load tracking or session hysteresis.
     */
    GPU_LOAD_SPIKE = 9,
};

// Allows access to PowerHAL's SessionTags without needing to import its AIDL