diff options
| author | 2024-01-03 17:00:00 -0800 | |
|---|---|---|
| committer | 2024-01-08 19:24:32 -0800 | |
| commit | dad56d534ed05cccbb64e9ad914d63d91a7b51bf (patch) | |
| tree | 8ea7de92cb19e6379b5bb55ad479197dd4afff75 | |
| parent | ab4ae770082532d5d3f247a279caf072df69d05b (diff) | |
Add test API for GPU load hints
Bug: 284324521
Test: atest PerformanceHintManagerTest
Change-Id: I28b0899eb46abaa49098040ba3fbf75ff1aefe39
| -rw-r--r-- | core/api/test-current.txt | 3 | ||||
| -rw-r--r-- | core/java/android/os/PerformanceHintManager.java | 36 |
2 files changed, 38 insertions, 1 deletions
diff --git a/core/api/test-current.txt b/core/api/test-current.txt index ad8b6852a6f4..7fb419f2d232 100644 --- a/core/api/test-current.txt +++ b/core/api/test-current.txt @@ -2332,6 +2332,9 @@ package android.os { field public static final int CPU_LOAD_RESET = 2; // 0x2 field public static final int CPU_LOAD_RESUME = 3; // 0x3 field public static final int CPU_LOAD_UP = 0; // 0x0 + field @FlaggedApi("android.os.adpf_gpu_report_actual_work_duration") public static final int GPU_LOAD_DOWN = 6; // 0x6 + field @FlaggedApi("android.os.adpf_gpu_report_actual_work_duration") public static final int GPU_LOAD_RESET = 7; // 0x7 + field @FlaggedApi("android.os.adpf_gpu_report_actual_work_duration") public static final int GPU_LOAD_UP = 5; // 0x5 } public final class PowerManager { diff --git a/core/java/android/os/PerformanceHintManager.java b/core/java/android/os/PerformanceHintManager.java index e0059105c21f..37bde3db5e14 100644 --- a/core/java/android/os/PerformanceHintManager.java +++ b/core/java/android/os/PerformanceHintManager.java @@ -149,13 +149,47 @@ public final class PerformanceHintManager { @TestApi public static final int CPU_LOAD_RESUME = 3; + /** + * This hint indicates an increase in GPU workload intensity. It means that + * this hint session needs extra GPU resources to meet the target duration. + * This hint must be sent before reporting the actual duration to the session. + * + * @hide + */ + @TestApi + @FlaggedApi(Flags.FLAG_ADPF_GPU_REPORT_ACTUAL_WORK_DURATION) + public static final int GPU_LOAD_UP = 5; + + /** + * This hint indicates a decrease in GPU workload intensity. It means that + * this hint session can reduce GPU resources and still meet the target duration. + * + * @hide + */ + @TestApi + @FlaggedApi(Flags.FLAG_ADPF_GPU_REPORT_ACTUAL_WORK_DURATION) + public static final int GPU_LOAD_DOWN = 6; + + /** + * This hint indicates an upcoming GPU workload that is completely changed and + * unknown. It means that the hint session should reset GPU resources to a known + * baseline to prepare for an arbitrary load, and must wake up if inactive. + * + * @hide + */ + @TestApi + @FlaggedApi(Flags.FLAG_ADPF_GPU_REPORT_ACTUAL_WORK_DURATION) + public static final int GPU_LOAD_RESET = 7; + /** @hide */ @Retention(RetentionPolicy.SOURCE) @IntDef(prefix = {"CPU_LOAD_"}, value = { CPU_LOAD_UP, CPU_LOAD_DOWN, CPU_LOAD_RESET, - CPU_LOAD_RESUME + CPU_LOAD_RESUME, + GPU_LOAD_UP, + GPU_LOAD_DOWN }) public @interface Hint {} |