Merge 091da968f5f35e59f5b3c60ce69be2f4fc02923a on remote branch
Change-Id: I6f3f839d5cda23a281b09c3a8f91fd00c6f3ac66
diff --git a/Android.mk b/Android.mk
index 7e3c79b..c92cde7 100644
--- a/Android.mk
+++ b/Android.mk
@@ -8,16 +8,7 @@
LOCAL_MODULE_RELATIVE_PATH := hw
# KEYSTONE(I1132378f14428bf511f3cea4f419e90a6e89f823,b/181709127)
-LOCAL_SHARED_LIBRARIES := liblog libcutils libdl libxml2 libbase libutils libbinder_ndk
-
-ifeq ($(call math_gt_or_eq, 33, $(PLATFORM_SDK_VERSION)), true)
- LOCAL_SHARED_LIBRARIES += android.hardware.power-V3-ndk
-endif
-ifeq ($(call math_gt_or_eq, 34, $(PLATFORM_SDK_VERSION)), true)
- LOCAL_SHARED_LIBRARIES += android.hardware.power-V4-ndk
-else
- LOCAL_SHARED_LIBRARIES += android.hardware.power-V1-ndk_platform
-endif
+LOCAL_SHARED_LIBRARIES := liblog libcutils libdl libxml2 libbase libutils libbinder_ndk android.hardware.power-V3-ndk
LOCAL_HEADER_LIBRARIES += libutils_headers
LOCAL_HEADER_LIBRARIES += libhardware_headers
@@ -82,12 +73,6 @@
LOCAL_SRC_FILES += power-710.c
endif
-ifeq ($(call is-board-platform-in-list,trinket), true)
-LOCAL_SHARED_LIBRARIES := liblog libcutils libdl libxml2
-LOCAL_SRC_FILES := power.c metadata-parser.c utils.c list.c hint-data.c powerhintparser.c
-LOCAL_SRC_FILES += power-6125.c
-endif
-
ifeq ($(call is-board-platform-in-list,msmnile), true)
LOCAL_SRC_FILES += power-msmnile.c
endif
@@ -96,25 +81,11 @@
LOCAL_CFLAGS += -DINTERACTION_BOOST
endif
-ifeq ($(call is-board-platform-in-list,trinket), true)
-LOCAL_MODULE := power.qcom
-LOCAL_MODULE_TAGS := optional
-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-variable
-LOCAL_VENDOR_MODULE := true
-include $(BUILD_SHARED_LIBRARY)
-else
LOCAL_MODULE := android.hardware.power-service
LOCAL_INIT_RC := android.hardware.power-service.rc
LOCAL_MODULE_TAGS := optional
LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-variable
LOCAL_VENDOR_MODULE := true
-ifeq ($(PLATFORM_SDK_VERSION), 34)
-LOCAL_VINTF_FRAGMENTS := /vintf/sdk34/power.xml
-else
LOCAL_VINTF_FRAGMENTS := power.xml
-endif
include $(BUILD_EXECUTABLE)
endif
-
-
-endif
diff --git a/PowerHintSession.cpp b/PowerHintSession.cpp
index c4e9074..c466947 100644
--- a/PowerHintSession.cpp
+++ b/PowerHintSession.cpp
@@ -31,15 +31,3 @@
ndk::ScopedAStatus PowerHintSessionImpl::close(){
return ndk::ScopedAStatus::ok();
}
-#if (PLATFORM_SDK_VERSION >= 34)
-ndk::ScopedAStatus PowerHintSessionImpl::sendHint(aidl::android::hardware::power::SessionHint hint){
- return ndk::ScopedAStatus::ok();
-}
-ndk::ScopedAStatus PowerHintSessionImpl::setThreads(const std::vector<int32_t>& threadIds){
- if (threadIds.size() == 0) {
- LOG(ERROR) << "Error: threadIds.size() shouldn't be " << threadIds.size();
- return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
- }
- return ndk::ScopedAStatus::ok();
-}
-#endif
diff --git a/PowerHintSession.h b/PowerHintSession.h
index a56713a..3491b26 100644
--- a/PowerHintSession.h
+++ b/PowerHintSession.h
@@ -8,9 +8,6 @@
#include <aidl/android/hardware/power/WorkDuration.h>
#include <aidl/android/hardware/power/BnPowerHintSession.h>
-#if (PLATFORM_SDK_VERSION >= 34)
-#include <aidl/android/hardware/power/SessionHint.h>
-#endif
std::shared_ptr<aidl::android::hardware::power::IPowerHintSession> setPowerHintSession();
int64_t getSessionPreferredRate();
@@ -23,9 +20,5 @@
ndk::ScopedAStatus pause() override;
ndk::ScopedAStatus resume() override;
ndk::ScopedAStatus close() override;
- #if (PLATFORM_SDK_VERSION >= 34)
- ndk::ScopedAStatus sendHint(aidl::android::hardware::power::SessionHint hint) override;
- ndk::ScopedAStatus setThreads(const std::vector<int32_t>& threadIds) override;
- #endif
};
-#endif /* __POWERHINTSESSION__ */
\ No newline at end of file
+#endif /* __POWERHINTSESSION__ */
diff --git a/config/trinket/powerhint.xml b/config/trinket/powerhint.xml
new file mode 100644
index 0000000..a669dd9
--- /dev/null
+++ b/config/trinket/powerhint.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8" ?>
+
+<!--
+/* Copyright (c) 2016-2018,2020. The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+-->
+<HintConfigs>
+ <Powerhint>
+
+ <!-- camera 30fps and camera preview -->
+ <!--L CPU CORE 0 SCHED LOAD BOOST -->
+ <!--L CPU CORE 1 SCHED LOAD BOOST -->
+ <!--L CPU CORE 2 SCHED LOAD BOOST -->
+ <!--L CPU CORE 3 SCHED LOAD BOOST -->
+ <!--L CPU CORE 4 SCHED LOAD BOOST -->
+ <!--L CPU CORE 5 SCHED LOAD BOOST -->
+ <!--L CPU CORE 6 SCHED LOAD BOOST -->
+ <!--L CPU CORE 7 SCHED LOAD BOOST -->
+ <!--L CPU - Set hispeed load 95 -->
+ <!--BWMON - Set sample_ms 20 -->
+ <!--L CPU - Set hispeed load 95 -->
+ <!-- Silver Max frequency -->
+ <Config
+ Id="0x00001331" Enable="true" Timeout="0" Target="trinket"
+ Resources="0x40C68100, 0xFFFFFFF1, 0x40C68110, 0xFFFFFFF1, 0x40C68120, 0xFFFFFFF1,
+ 0x40C68130, 0xFFFFFFF1, 0x40C68000, 0xFFFFFFF1, 0x40C68010, 0xFFFFFFF1, 0x40C68020, 0xFFFFFFF1, 0x40C68030, 0xFFFFFFF1,
+ 0x41440100, 0x5F, 0x41820000, 0x14, 0x41440000, 0x5F, 0x40804100, 0x64C"/>
+
+ <!-- camera HFR -->
+ <!--BWMON - Set sample_ms 20 -->
+ <!--L CPU - Set hispeed load 95 -->
+ <!--L CPU - Set hispeed frequency -->
+ <Config
+ Id="0x00001333" Enable="true" Timeout="0" Target="trinket"
+ Resources="0x41820000, 0x14, 0x41440100, 0x5F, 0x4143C100, 0x3F9"/>
+
+ </Powerhint>
+</HintConfigs>
diff --git a/power-vendor-board.mk b/power-vendor-board.mk
index 17ad8b9..23d97aa 100644
--- a/power-vendor-board.mk
+++ b/power-vendor-board.mk
@@ -1,5 +1 @@
-ifeq ($(TARGET_BOARD_PLATFORM),trinket)
-TARGET_USES_NON_LEGACY_POWERHAL := false
-else
TARGET_USES_NON_LEGACY_POWERHAL := true
-endif
diff --git a/power-vendor-product.mk b/power-vendor-product.mk
index 68d5801..438584f 100644
--- a/power-vendor-product.mk
+++ b/power-vendor-product.mk
@@ -23,4 +23,6 @@
PRODUCT_COPY_FILES += vendor/qcom/opensource/power/config/pineapple/powerhint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/powerhint.xml
else ifeq ($(TARGET_BOARD_PLATFORM),crow)
PRODUCT_COPY_FILES += vendor/qcom/opensource/power/config/crow/powerhint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/powerhint.xml
+else ifeq ($(TARGET_BOARD_PLATFORM),trinket)
+PRODUCT_COPY_FILES += vendor/qcom/opensource/power/config/trinket/powerhint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/powerhint.xml
endif
diff --git a/vintf/sdk34/power.xml b/vintf/sdk34/power.xml
deleted file mode 100644
index 1e08685..0000000
--- a/vintf/sdk34/power.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<!--
-Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
-SPDX-License-Identifier: BSD-3-Clause-Clear
--->
-<manifest version="1.0" type="device">
- <hal format="aidl">
- <name>android.hardware.power</name>
- <version>4</version>
- <fqname>IPower/default</fqname>
- </hal>
-</manifest>
\ No newline at end of file