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

Commit 36ba7aff authored by Andy Yu's avatar Andy Yu Committed by Android (Google) Code Review
Browse files

Merge "Implement NDK createSessionUsingConfig API" into main

parents 92b1f133 dffd67c9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -236,6 +236,7 @@ aidl_interface {
        "android/os/GpuHeadroomParamsInternal.aidl",
        "android/os/IHintManager.aidl",
        "android/os/IHintSession.aidl",
        "android/os/SessionCreationConfig.aidl",
    ],
    unstable: true,
    backend: {
+8 −2
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ package android.os;
import android.os.CpuHeadroomParamsInternal;
import android.os.GpuHeadroomParamsInternal;
import android.os.IHintSession;
import android.os.SessionCreationConfig;
import android.hardware.power.ChannelConfig;
import android.hardware.power.SessionConfig;
import android.hardware.power.SessionTag;
@@ -34,8 +35,8 @@ interface IHintManager {
     * Throws UnsupportedOperationException if ADPF is not supported, and IllegalStateException
     * if creation is supported but fails.
     */
    IHintSession createHintSessionWithConfig(in IBinder token, in int[] threadIds,
            in long durationNanos, in SessionTag tag, out SessionConfig config);
    IHintSession createHintSessionWithConfig(in IBinder token, in SessionTag tag,
            in SessionCreationConfig creationConfig, out SessionConfig config);

    /**
     * Get preferred rate limit in nanoseconds.
@@ -56,4 +57,9 @@ interface IHintManager {
    long getCpuHeadroomMinIntervalMillis();
    float getGpuHeadroom(in GpuHeadroomParamsInternal params);
    long getGpuHeadroomMinIntervalMillis();

    /**
     * Get Maximum number of graphics pipeline threads allowed per-app.
     */
    int getMaxGraphicsPipelineThreadsCount();
}
+39 −0
Original line number Diff line number Diff line
/*
 *
 * Copyright 2024, The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.os;

import android.hardware.power.SessionTag;
import android.hardware.power.SessionMode;

/** {@hide} */
parcelable SessionCreationConfig {
    /**
     * List of tids to be included in the hint session.
     */
    int[] tids;

    /**
     * The initial target work duration of this hint session in nanoseconds.
     */
    long targetWorkDurationNanos;

    /**
     * List of the modes to be enabled upon session creation.
     */
    SessionMode[] modesToEnable;
}
+9 −0
Original line number Diff line number Diff line
@@ -11,6 +11,15 @@ flag {
    bug: "284324521"
}

flag {
    name: "adpf_graphics_pipeline"
    is_exported: true
    namespace: "game"
    description: "Guards use of SessionCreationConfig and Graphics Pipeline mode"
    is_fixed_read_only: true
    bug: "367803904"
}

flag {
    name: "adpf_hwui_gpu"
    namespace: "game"
+10 −0
Original line number Diff line number Diff line
@@ -355,12 +355,14 @@ LIBANDROID {
    APerformanceHint_getManager; # introduced=Tiramisu
    APerformanceHint_createSession; # introduced=Tiramisu
    APerformanceHint_getPreferredUpdateRateNanos; # introduced=Tiramisu
    APerformanceHint_getMaxGraphicsPipelineThreadsCount; # introduced=36
    APerformanceHint_updateTargetWorkDuration; # introduced=Tiramisu
    APerformanceHint_reportActualWorkDuration; # introduced=Tiramisu
    APerformanceHint_closeSession; # introduced=Tiramisu
    APerformanceHint_setThreads; # introduced=UpsideDownCake
    APerformanceHint_setPreferPowerEfficiency; # introduced=VanillaIceCream
    APerformanceHint_reportActualWorkDuration2; # introduced=VanillaIceCream
    APerformanceHint_createSessionUsingConfig; # introduced=36
    APerformanceHint_notifyWorkloadIncrease; # introduced=36
    APerformanceHint_notifyWorkloadReset; # introduced=36
    APerformanceHint_borrowSessionFromJava; # introduced=36
@@ -370,6 +372,12 @@ LIBANDROID {
    AWorkDuration_setActualTotalDurationNanos; # introduced=VanillaIceCream
    AWorkDuration_setActualCpuDurationNanos; # introduced=VanillaIceCream
    AWorkDuration_setActualGpuDurationNanos; # introduced=VanillaIceCream
    ASessionCreationConfig_create; # introduced=36
    ASessionCreationConfig_release; # introduced=36
    ASessionCreationConfig_setTids; # introduced=36
    ASessionCreationConfig_setTargetWorkDurationNanos; # introduced=36
    ASessionCreationConfig_setPreferPowerEfficiency; # introduced=36
    ASessionCreationConfig_setGraphicsPipeline; # introduced=36
  local:
    *;
};
@@ -379,8 +387,10 @@ LIBANDROID_PLATFORM {
    AThermal_setIThermalServiceForTesting;
    APerformanceHint_setIHintManagerForTesting;
    APerformanceHint_sendHint;
    APerformanceHint_setUseGraphicsPipelineForTesting;
    APerformanceHint_getThreadIds;
    APerformanceHint_createSessionInternal;
    APerformanceHint_createSessionUsingConfigInternal;
    APerformanceHint_setUseFMQForTesting;
    APerformanceHint_getRateLimiterPropertiesForTesting;
    APerformanceHint_setUseNewLoadHintBehaviorForTesting;
Loading