From 19a43ccd9aa1db86585a01988d6f487df4e5793d Mon Sep 17 00:00:00 2001 From: dianlujitao Date: Thu, 18 Jan 2018 21:24:30 +0800 Subject: power: Prepare for power profile support * Add support for system performance profiles and CPU boost. * Uses mpctl to configure the CPUs in the appropriate modes. * Implement binderized Lineage power HAL. Author: Steve Kondik Date: Sat May 17 03:37:53 2014 -0700 power: Add support for CPU boost hint Change-Id: I07c3e8daf8a5f3b568e27334f26d4ba8f4cf40c4 Author: Steve Kondik Date: Sun May 18 23:55:23 2014 -0700 power: Add power hint to set profile * A PowerHAL can implement support for this hint to receive power profile changes from the framework. Change-Id: Ie1e9e3b827c731cf5a817a0491677e3451fe8678 Author: Steve Kondik Date: Mon May 19 17:26:34 2014 -0700 power: Add support for SET_PROFILE hints * Add support for system performance profiles. * Uses mpctl to configure the CPUs in the appropriate modes. * PERFORMANCE = all cores at max * POWER_SAVE = max two cores at non-turbo voltage * If a custom profile is set, don't honor any other hints * Clean up the code and firm up the locking. Change-Id: Ie6acada805780c9ae6e6bc2002843aef638ca63b Author: Steve Kondik Date: Tue Nov 3 03:27:42 2015 -0800 power: Update for PerformanceManager changes * Undo damage caused by the previous patch which broke all hint arguments. We were actually using these wrong to begin with anyway. * Add support for get_profile * Clean up code Change-Id: Ibc3f21bfb7aa46ec97b9b63d09737d4331a5a714 Author: dianlujitao Date: Sat Feb 23 20:24:57 2019 +0800 power: Pass NULL parameter in powerHint if data is zero * This restores the behavior in AOSP and CAF power HAL to avoid confusion. Change-Id: I72f5bb9286e2f57121e39eea82d2fe8854989393 Change-Id: I7ae614667e3182eaf0a90b81e8ed839689cfbf28 --- Power.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Power.h') diff --git a/Power.h b/Power.h index 4ede54b..a76c65d 100644 --- a/Power.h +++ b/Power.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2019, The Linux Foundation. All rights reserved. + * Copyright (C) 2017-2019 The LineageOS Project * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -34,6 +35,7 @@ #include #include #include +#include namespace android { namespace hardware { @@ -47,11 +49,14 @@ using PowerHint_1_2 = ::android::hardware::power::V1_2::PowerHint; using ::android::hardware::Return; using ::android::hardware::Void; using ::android::hardware::power::V1_2::IPower; +using ::vendor::lineage::power::V1_0::ILineagePower; +using ::vendor::lineage::power::V1_0::LineageFeature; -struct Power : public IPower { +struct Power : public IPower, public ILineagePower { // Methods from ::android::hardware::power::V1_0::IPower follow. Power(); + status_t registerAsSystemService(); Return setInteractive(bool interactive) override; Return powerHint(PowerHint_1_0 hint, int32_t data) override; @@ -63,6 +68,9 @@ struct Power : public IPower { Return powerHintAsync(PowerHint_1_0 hint, int32_t data) override; // Methods from ::android::hardware::power::V1_2::IPower follow Return powerHintAsync_1_2(PowerHint_1_2 hint, int32_t data) override; + + // Methods from ::vendor::lineage::power::V1_0::ILineagePower follow. + Return getFeature(LineageFeature feature) override; }; } // namespace implementation -- cgit v1.2.3