summaryrefslogtreecommitdiff
path: root/include/android
diff options
context:
space:
mode:
author Matt Buckley <mattbuckley@google.com> 2024-01-31 22:10:42 +0000
committer Matt Buckley <mattbuckley@google.com> 2024-02-01 00:37:17 +0000
commit0bbd177f10a7e4b21c27cd00dd1d786be6c2b722 (patch)
tree4403ae104579c294e4f14907de2d0e81be9a4d12 /include/android
parentb2e2eefaf247c683c985ef70d99a519d137243da (diff)
Allow ADPF WorkDuration CPU duration to be zero
This patch updates the checks, tests, and documentation to ensure ADPF CPU == 0 is allowed, and instead checks to make sure that both CPU and GPU cannot be 0 at the same time. Bug: 323226967 Test: atest PerformanceHintManagerTest Change-Id: I6927899793c7d9801541465280af32627e200dc9
Diffstat (limited to 'include/android')
-rw-r--r--include/android/performance_hint.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/include/android/performance_hint.h b/include/android/performance_hint.h
index 08d339b176..3c82d888b5 100644
--- a/include/android/performance_hint.h
+++ b/include/android/performance_hint.h
@@ -233,11 +233,11 @@ int APerformanceHint_setPreferPowerEfficiency(
* @param workDuration The {@link AWorkDuration} structure of times the thread group took to
* complete its last task in nanoseconds breaking down into different components.
*
- * The work period start timestamp, actual total duration and actual CPU duration must be
- * positive.
+ * The work period start timestamp and actual total duration must be greater than zero.
*
- * The actual GPU duration must be non-negative. If the actual GPU duration is 0, it means
- * the actual GPU duration is not measured.
+ * The actual CPU and GPU durations must be greater than or equal to zero, and at least one
+ * of them must be greater than zero. When one of them is equal to zero, it means that type
+ * of work was not measured for this workload.
*
* @return 0 on success.
* EINVAL if any duration is an invalid number.
@@ -289,7 +289,8 @@ void AWorkDuration_setActualTotalDurationNanos(AWorkDuration* _Nonnull aWorkDura
*
* @param aWorkDuration The {@link AWorkDuration} created by calling {@link AWorkDuration_create()}
* @param actualCpuDurationNanos The actual CPU work duration in nanoseconds. This number must be
- * greater than zero.
+ * greater than or equal to zero. If it is equal to zero, that means the CPU was not
+ * measured.
*/
void AWorkDuration_setActualCpuDurationNanos(AWorkDuration* _Nonnull aWorkDuration,
int64_t actualCpuDurationNanos) __INTRODUCED_IN(__ANDROID_API_V__);
@@ -299,7 +300,7 @@ void AWorkDuration_setActualCpuDurationNanos(AWorkDuration* _Nonnull aWorkDurati
*
* @param aWorkDuration The {@link AWorkDuration} created by calling {@link AWorkDuration_create()}.
* @param actualGpuDurationNanos The actual GPU work duration in nanoseconds, the number must be
- * non-negative. If the actual GPU duration is 0, it means the actual GPU duration is
+ * greater than or equal to zero. If it is equal to zero, that means the GPU was not
* measured.
*/
void AWorkDuration_setActualGpuDurationNanos(AWorkDuration* _Nonnull aWorkDuration,