diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk index cc1abd0..55a9d4c 100644 --- a/BoardConfigCommon.mk +++ b/BoardConfigCommon.mk @@ -151,6 +151,7 @@ TARGET_RELEASETOOLS_EXTENSIONS := $(COMMON_PATH) # Sepolicy TARGET_SEPOLICY_DIR := msmsteppe +include device/lineage/sepolicy/libperfmgr/sepolicy.mk include device/qcom/sepolicy_vndr/SEPolicy.mk SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += $(COMMON_PATH)/sepolicy/private diff --git a/libqti-perfd-client/Android.bp b/libqti-perfd-client/Android.bp deleted file mode 100644 index 010d072..0000000 --- a/libqti-perfd-client/Android.bp +++ /dev/null @@ -1,17 +0,0 @@ -cc_library_shared { - name: "libqti-perfd-client", - proprietary: true, - defaults: ["hidl_defaults"], - srcs: [ - "client.c", - ], - cflags: [ - "-Werror", - "-Wextra", - "-Wall", - ], - shared_libs: [ - "liblog", - "libutils", - ], -} diff --git a/libqti-perfd-client/client.c b/libqti-perfd-client/client.c deleted file mode 100644 index 547ebcd..0000000 --- a/libqti-perfd-client/client.c +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2021-2024 The LineageOS Project - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#define LOG_TAG "libqti-perfd-client" - -#include -#include - -void perf_get_feedback() {} - -void perf_hint() {} - -int perf_lock_acq(int handle, int duration, int arg3[], int arg4) { - ALOGI("perf_lock_acq: handle: %d, duration: %d, arg3[0]: %d, arg4: %d", handle, duration, - arg3[0], arg4); - return handle ?: 233; -} - -void perf_lock_cmd() {} - -int perf_lock_rel(int handle) { - ALOGI("perf_lock_rel: handle: %d", handle); - return handle ?: 233; -} - -void perf_lock_use_profile() {} diff --git a/sepolicy/vendor/file_contexts b/sepolicy/vendor/file_contexts index b545797..3f6eafe 100644 --- a/sepolicy/vendor/file_contexts +++ b/sepolicy/vendor/file_contexts @@ -34,7 +34,6 @@ # HALs /(vendor|system/vendor)/bin/hw/android\.hardware\.biometrics\.fingerprint@2\.3-service\.xiaomi u:object_r:hal_fingerprint_default_exec:s0 /vendor/bin/hw/android\.hardware\.light@2\.0-service\.xiaomi_sm6150 u:object_r:hal_light_default_exec:s0 -/vendor/bin/hw/android\.hardware\.power-service\.xiaomi-libperfmgr u:object_r:hal_power_default_exec:s0 /vendor/bin/hw/vendor\.lineage\.livedisplay@2\.1-service\.xiaomi_sm6150 u:object_r:hal_lineage_livedisplay_qti_exec:s0 # IR diff --git a/sepolicy/vendor/genfs_contexts b/sepolicy/vendor/genfs_contexts index 4541b0a..cdf1598 100644 --- a/sepolicy/vendor/genfs_contexts +++ b/sepolicy/vendor/genfs_contexts @@ -54,6 +54,3 @@ genfscon sysfs /devices/platform/soc/a8c000.i2c/i2c-2/2-0066/wakeup genfscon sysfs /devices/platform/soc/a8c000.i2c/i2c-2/2-0066/power_supply/bq2597x-standalone/wakeup u:object_r:sysfs_wakeup:s0 genfscon sysfs /devices/platform/soc/soc:maxim_ds28e16/power_supply/batt_verify/wakeup u:object_r:sysfs_wakeup:s0 genfscon sysfs /devices/platform/soc/soc:fingerprint_fpc/wakeup u:object_r:sysfs_wakeup:s0 - -# Power -genfscon proc /sys/kernel/sched_energy_aware u:object_r:proc_sched_energy_aware:s0 diff --git a/sepolicy/vendor/hal_power_default.te b/sepolicy/vendor/hal_power_default.te index 0cf37e4..f195fdb 100644 --- a/sepolicy/vendor/hal_power_default.te +++ b/sepolicy/vendor/hal_power_default.te @@ -1,18 +1,4 @@ -type proc_sched_energy_aware, proc_type, fs_type; -vendor_internal_prop(vendor_power_prop) - allow hal_power_default touchfeature_device:chr_file rw_file_perms; # To do powerhint on nodes defined in powerhint.json -allow hal_power_default cgroup:dir search; -allow hal_power_default cgroup:file rw_file_perms; -allow hal_power_default proc_sched_energy_aware:file rw_file_perms; -allow hal_power_default sysfs_devices_system_cpu:file rw_file_perms; allow hal_power_default vendor_latency_device:chr_file rw_file_perms; -allow hal_power_default vendor_sysfs_devfreq:dir search; -allow hal_power_default vendor_sysfs_devfreq:file rw_file_perms; -allow hal_power_default vendor_sysfs_kgsl:file rw_file_perms; -allow hal_power_default vendor_sysfs_graphics:file r_file_perms; - -# To get/set powerhal state property -set_prop(hal_power_default, vendor_power_prop) diff --git a/sepolicy/vendor/property_contexts b/sepolicy/vendor/property_contexts index 9519b29..ca17ccf 100644 --- a/sepolicy/vendor/property_contexts +++ b/sepolicy/vendor/property_contexts @@ -9,9 +9,6 @@ ro.hardware.fp u:object_r:vendor_fp_prop:s0 vendor.panel.display u:object_r:vendor_fp_prop:s0 vendor.fps_hal. u:object_r:vendor_fp_prop:s0 -# Power HAL -vendor.powerhal. u:object_r:vendor_power_prop:s0 - # Telephony ro.vendor.oem.imei u:object_r:vendor_deviceid_prop:s0 ro.vendor.oem.meid u:object_r:vendor_deviceid_prop:s0 diff --git a/sm6150.mk b/sm6150.mk index 694f059..393e4e9 100644 --- a/sm6150.mk +++ b/sm6150.mk @@ -1,5 +1,5 @@ # -# Copyright (C) 2020-2023 The LineageOS Project +# Copyright (C) 2020-2024 The LineageOS Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -291,13 +291,10 @@ PRODUCT_ENFORCE_RRO_TARGETS += * # Partitions PRODUCT_USE_DYNAMIC_PARTITIONS := true -# Perf -PRODUCT_PACKAGES += \ - libqti-perfd-client - # Power PRODUCT_PACKAGES += \ - android.hardware.power-service.xiaomi-libperfmgr + android.hardware.power-service.lineage-libperfmgr \ + libqti-perfd-client # Protobuf PRODUCT_PACKAGES += \ @@ -346,6 +343,8 @@ PRODUCT_SOONG_NAMESPACES += \ $(LOCAL_PATH) \ hardware/google/interfaces \ hardware/google/pixel \ + hardware/lineage/interfaces/power-libperfmgr \ + hardware/qcom-caf/common/libqti-perfd-client \ hardware/xiaomi # Telephony