From f39c60f14b8c66ca6e5c787abaddb74073877b49 Mon Sep 17 00:00:00 2001 From: Peiyong Lin Date: Mon, 27 Nov 2023 17:21:48 +0000 Subject: [PATCH] [Reland] Add GPU enabled ADPF to V5 of power hal. Adds the ability for V5 ADPF clients to clue the power hal in as to how much of the work duration is attributable to the CPU vs how much of the work duration is attributable to the GPU. Bug: b/284324521 Test: atest VtsHalPowerTargetTest Change-Id: I81360fdaa21a87c2f2c7fc28702e625185a9a2d3 --- .../android/hardware/power/WorkDuration.aidl | 3 +++ .../android/hardware/power/WorkDuration.aidl | 24 ++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/WorkDuration.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/WorkDuration.aidl index e86cd40ec2..45013ddf77 100644 --- a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/WorkDuration.aidl +++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/WorkDuration.aidl @@ -36,4 +36,7 @@ package android.hardware.power; parcelable WorkDuration { long timeStampNanos; long durationNanos; + long workPeriodStartTimestampNanos; + long cpuDurationNanos; + long gpuDurationNanos; } diff --git a/power/aidl/android/hardware/power/WorkDuration.aidl b/power/aidl/android/hardware/power/WorkDuration.aidl index a06a058fb5..fcd638b77a 100644 --- a/power/aidl/android/hardware/power/WorkDuration.aidl +++ b/power/aidl/android/hardware/power/WorkDuration.aidl @@ -23,8 +23,30 @@ parcelable WorkDuration { * sample was measured. */ long timeStampNanos; + /** - * Work duration in nanoseconds. + * Total work duration in nanoseconds. */ long durationNanos; + + /** + * Timestamp in nanoseconds based on CLOCK_MONOTONIC when the work starts. + * The work period start timestamp could be zero if the call is from + * the legacy SDK/NDK reportActualWorkDuration API. + */ + long workPeriodStartTimestampNanos; + + /** + * CPU work duration in nanoseconds. + * The CPU work duration could be the same as the total work duration if + * the call is from the legacy SDK/NDK reportActualWorkDuration API. + */ + long cpuDurationNanos; + + /** + * GPU work duration in nanoseconds. + * The GPU work duration could be zero if the call is from the legacy + * SDK/NDK reportActualWorkDuration API. + */ + long gpuDurationNanos; }