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

Commit 540fe889 authored by Xiang Wang's avatar Xiang Wang Committed by Android (Google) Code Review
Browse files

Merge "Add test API for GPU load hints" into main

parents c835e984 dad56d53
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2343,6 +2343,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 {
+35 −1
Original line number Diff line number Diff line
@@ -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 {}