Skip to content

Commit 2eb60a8

Browse files
Priyanka Advani (xWF)Android (Google) Code Review
authored andcommitted
Merge "Revert "Add public ADPF load hints with better rate limiter and ..."" into main
2 parents 0bf2991 + 147f08c commit 2eb60a8

2 files changed

Lines changed: 1 addition & 75 deletions

File tree

include/android/performance_hint.h

Lines changed: 1 addition & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,9 @@
1919
*
2020
* APerformanceHint allows apps to create performance hint sessions for groups
2121
* of threads, and provide hints to the system about the workload of those threads,
22-
* to help the system more accurately allocate resources for them. It is the NDK
22+
* to help the system more accurately allocate power for them. It is the NDK
2323
* counterpart to the Java PerformanceHintManager SDK API.
2424
*
25-
* This API is intended for periodic workloads, such as frame production. Clients are
26-
* expected to create an instance of APerformanceHintManager, create a session with
27-
* that, and then set a target duration for the session. Then, they can report the actual
28-
* work duration at the end of each cycle to inform the framework about how long those
29-
* workloads are taking. The framework will then compare the actual durations to the target
30-
* duration and attempt to help the client reach a steady state under the target.
31-
*
32-
* Unlike reportActualWorkDuration, the "notify..." hints are intended to be sent in
33-
* advance of large changes in the workload, to prevent them from going over the target
34-
* when there is a sudden, unforseen change. Their effects are intended to last for only
35-
* one cycle, after which reportActualWorkDuration will have a chance to catch up.
36-
* These hints should be used judiciously, only in cases where the workload is changing
37-
* substantially. To enforce that, they are tracked using a per-app rate limiter to avoid
38-
* excessive hinting and encourage clients to be mindful about when to send them.
3925
* @{
4026
*/
4127

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

266-
/**
267-
* Informs the framework of an upcoming increase in the workload of a graphics pipeline
268-
* bound to this session. The user can specify whether the increase is expected to be
269-
* on the CPU, GPU, or both.
270-
*
271-
* Sending hints for both CPU and GPU counts as two separate hints for the purposes of the
272-
* rate limiter.
273-
*
274-
* @param cpu Indicates if the workload increase is expected to affect the CPU.
275-
* @param gpu Indicates if the workload increase is expected to affect the GPU.
276-
* @param debugName A required string used to identify this specific hint during
277-
* tracing. This debug string will only be held for the duration of the
278-
* method, and can be safely discarded after.
279-
*
280-
* @return 0 on success.
281-
* EINVAL if no hints were requested.
282-
* EBUSY if the hint was rate limited.
283-
* EPIPE if communication with the system service has failed.
284-
* ENOTSUP if the hint is not supported.
285-
*/
286-
int APerformanceHint_notifyWorkloadIncrease(
287-
APerformanceHintSession* _Nonnull session,
288-
bool cpu, bool gpu, const char* _Nonnull debugName) __INTRODUCED_IN(36);
289-
290-
/**
291-
* Informs the framework of an upcoming reset in the workload of a graphics pipeline
292-
* bound to this session, or the imminent start of a new workload. The user can specify
293-
* whether the reset is expected to affect the CPU, GPU, or both.
294-
*
295-
* Sending hints for both CPU and GPU counts as two separate hints for the purposes of the
296-
* this load tracking.
297-
*
298-
* @param cpu Indicates if the workload reset is expected to affect the CPU.
299-
* @param gpu Indicates if the workload reset is expected to affect the GPU.
300-
* @param debugName A required string used to identify this specific hint during
301-
* tracing. This debug string will only be held for the duration of the
302-
* method, and can be safely discarded after.
303-
*
304-
* @return 0 on success.
305-
* EINVAL if no hints were requested.
306-
* EBUSY if the hint was rate limited.
307-
* EPIPE if communication with the system service has failed.
308-
* ENOTSUP if the hint is not supported.
309-
*/
310-
int APerformanceHint_notifyWorkloadReset(
311-
APerformanceHintSession* _Nonnull session,
312-
bool cpu, bool gpu, const char* _Nonnull debugName) __INTRODUCED_IN(36);
313-
314252
/**
315253
* Creates a new AWorkDuration. When the client finishes using {@link AWorkDuration}, it should
316254
* call {@link AWorkDuration_release()} to destroy {@link AWorkDuration} and release all resources

include/private/performance_hint_private.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -114,18 +114,6 @@ APerformanceHintSession* APerformanceHint_createSessionInternal(APerformanceHint
114114
*/
115115
void APerformanceHint_setUseFMQForTesting(bool enabled);
116116

117-
/**
118-
* Get the rate limiter properties for testing.
119-
*/
120-
void APerformanceHint_getRateLimiterPropertiesForTesting(
121-
int32_t* maxLoadHintsPerInterval, int64_t* loadHintInterval);
122-
123-
/*
124-
* Forces the "new load hint" flag to be disabled for testing.
125-
*/
126-
void APerformanceHint_setUseNewLoadHintBehaviorForTesting(bool newBehavior);
127-
128-
129117
__END_DECLS
130118

131119
#endif // ANDROID_PRIVATE_NATIVE_PERFORMANCE_HINT_PRIVATE_H

0 commit comments

Comments
 (0)