From bcfd5f140ccd9396c3a419ebad66812b0cc0780a Mon Sep 17 00:00:00 2001 From: Sooraj S Date: Fri, 15 May 2020 13:59:05 +0530 Subject: [PATCH 1/9] FP3: audio: compile with moar features! This also fixed Microphone not working in VOIP calls --- BoardConfig.mk | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/BoardConfig.mk b/BoardConfig.mk index 20ad0cd..5a03659 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -142,11 +142,36 @@ MM_AUDIO_ENABLED_FTM := true TARGET_USES_QCOM_MM_AUDIO := true AUDIO_FEATURE_ENABLED_SOURCE_TRACKING := true BOARD_SUPPORTS_QAHW := false -AUDIO_FEATURE_ENABLED_DYNAMIC_LOG := true AUDIO_FEATURE_ENABLED_SND_MONITOR := true AUDIO_FEATURE_ENABLED_SVA_MULTI_STAGE := true AUDIO_ENABLE_AW8898_AMPLIFIER := true +USE_CUSTOM_AUDIO_POLICY := 1 +#AUDIO_FEATURE_ENABLED_VOICE_CONCURRENCY := true +AUDIO_FEATURE_ENABLED_AAC_ADTS_OFFLOAD := true +AUDIO_FEATURE_ENABLED_COMPRESS_CAPTURE := false +AUDIO_FEATURE_ENABLED_COMPRESS_VOIP := true +AUDIO_FEATURE_ENABLED_EXTN_FORMATS := true +AUDIO_FEATURE_ENABLED_EXTN_FLAC_DECODER := true +AUDIO_FEATURE_ENABLED_EXTN_RESAMPLER := true +AUDIO_FEATURE_ENABLED_FM_POWER_OPT := true +AUDIO_FEATURE_ENABLED_PCM_OFFLOAD := true +AUDIO_FEATURE_ENABLED_PCM_OFFLOAD_24 := true +AUDIO_FEATURE_ENABLED_FLAC_OFFLOAD := true +AUDIO_FEATURE_ENABLED_VORBIS_OFFLOAD := true +AUDIO_FEATURE_ENABLED_WMA_OFFLOAD := true +AUDIO_FEATURE_ENABLED_ALAC_OFFLOAD := true +AUDIO_FEATURE_ENABLED_APE_OFFLOAD := true +AUDIO_FEATURE_ENABLED_PROXY_DEVICE := true +AUDIO_FEATURE_ENABLED_DTS_EAGLE := false +BOARD_USES_SRS_TRUEMEDIA := false +DTS_CODEC_M_ := true +MM_AUDIO_ENABLED_SAFX := true +AUDIO_FEATURE_ENABLED_HW_ACCELERATED_EFFECTS := false +AUDIO_FEATURE_ENABLED_DS2_DOLBY_DAP := false +AUDIO_FEATURE_ENABLED_AUDIOSPHERE := true +DOLBY_ENABLE := false + #Audio Specific device overlays DEVICE_PACKAGE_OVERLAYS += hardware/qcom/audio-caf/msm8996/configs/common/overlay From f3db916c4f9976c7aa4b150f74fc93862dcb5c68 Mon Sep 17 00:00:00 2001 From: ssizon Date: Tue, 2 Jun 2020 00:52:40 +0530 Subject: [PATCH 2/9] FP3: update blobs to 04211500 Extract blobs from FP3 A.120 user build --- lineage_FP3.mk | 4 +- proprietary-files.txt | 137 +++++++++++++++++++-------------------- rootdir/etc/init.qcom.rc | 10 +-- setup-makefiles.sh | 2 +- 4 files changed, 71 insertions(+), 82 deletions(-) diff --git a/lineage_FP3.mk b/lineage_FP3.mk index ef51836..7ae90b7 100644 --- a/lineage_FP3.mk +++ b/lineage_FP3.mk @@ -37,7 +37,7 @@ PRODUCT_GMS_CLIENTID_BASE := android-uniscope # userdebug PRODUCT_BUILD_PROP_OVERRIDES += \ PRODUCT_NAME=FP3 \ - PRIVATE_BUILD_DESC="FP3-userdebug 9 8901.2.A.0111-SS.20200304 03042332 release-keys" + PRIVATE_BUILD_DESC="FP3-user 9 8901.2.A.0120.20200421 04211500 release-keys" # Set BUILD_FINGERPRINT variable to be picked up by both system and vendor build.prop -BUILD_FINGERPRINT := Fairphone/FP3/FP3:9/8901.2.A.0111-SS.20200304/03042332:userdebug/release-keys +BUILD_FINGERPRINT := Fairphone/FP3/FP3:9/8901.2.A.0120.20200421/04211500:user/release-keys diff --git a/proprietary-files.txt b/proprietary-files.txt index 994d26e..7b64e6c 100644 --- a/proprietary-files.txt +++ b/proprietary-files.txt @@ -630,18 +630,18 @@ vendor/lib/libhdr_tm.so vendor/lib64/libhdr_tm.so # Graphics (SDM) - from 8901.2.A.0111-SS.20200304 -vendor/lib/libscalar.so|ec3eac6b3f7d028647d8ff8d5763641694b08a19 -vendor/lib/libsdm-color.so|2ab146cb732eff1a4ddf66b1041fc25be722994f -vendor/lib/libsdm-diag.so|8bb92e3962a469ee0f1dd1ddcb097fa29a630eda --vendor/lib/libsdm-disp-vndapis.so|7ec59b1f8c78e53558fb4ff2a7261f0f4ef6ded7 -vendor/lib/libsdmextension.so|bd1d28a620adfc300f13e557d7eae641d93f0362 -vendor/lib/libtinyxml2_1.so|e28ea3cc0b01a1c28cd1b256225155a5947a8d70 -vendor/lib64/libscalar.so|304b152dabbc03bd99b1f81adadb0835fd242f51 -vendor/lib64/libsdm-color.so|1a9b68e5f2f09d37c2fa83907a6a70c7adb081f5 -vendor/lib64/libsdm-diag.so|25bab19a8c4453b3d20e3e1a71a0e8d3675b17b4 --vendor/lib64/libsdm-disp-vndapis.so|d93f262f60b58f32273909142aa7fdc7bfb6dda3 -vendor/lib64/libsdmextension.so|3e347988e89780a2da64a3ff6efa0ad23f6c3f47 -vendor/lib64/libtinyxml2_1.so|a2d9661cf2bb426e72ba15fd1a6a4eec940418a5 +vendor/lib/libscalar.so +vendor/lib/libsdm-color.so +vendor/lib/libsdm-diag.so +-vendor/lib/libsdm-disp-vndapis.so +vendor/lib/libsdmextension.so +vendor/lib/libtinyxml2_1.so +vendor/lib64/libscalar.so +vendor/lib64/libsdm-color.so +vendor/lib64/libsdm-diag.so +-vendor/lib64/libsdm-disp-vndapis.so +vendor/lib64/libsdmextension.so +vendor/lib64/libtinyxml2_1.so # Graphics - Firmwares vendor/firmware/a530_gpmu.fw2 @@ -796,7 +796,7 @@ vendor/lib64/libperipheral_client.so vendor/lib64/libdisp-aba.so # QMI -etc/permissions/qti_permissions.xml|e6ff4572352b1a4f91b6b9d7cbb1cad9924410a0 +etc/permissions/qti_permissions.xml etc/permissions/qti_libpermissions.xml vendor/bin/irsc_util vendor/lib/libdiag.so @@ -837,14 +837,14 @@ vendor/lib64/libmdmdetect.so -vendor/lib64/libqmiservices.so # Radio --app/datastatusnotification/datastatusnotification.apk|b893ed156ad7b23cd9e67f7fafbca4f8a4d8d5a4 +-app/datastatusnotification/datastatusnotification.apk -app/QtiTelephonyService/QtiTelephonyService.apk:vendor/app/QtiTelephonyService/QtiTelephonyService.apk etc/permissions/qcrilhook.xml:vendor/etc/permissions/qcrilhook.xml etc/permissions/telephonyservice.xml:vendor/etc/permissions/telephonyservice.xml framework/qcrilhook.jar:vendor/framework/qcrilhook.jar -framework/qti-telephony-common.jar|8f86d77d2cf13d6222ba7b4eef659e3f997f0cf2 +framework/qti-telephony-common.jar framework/QtiTelephonyServicelibrary.jar:vendor/framework/QtiTelephonyServicelibrary.jar --priv-app/qcrilmsgtunnel/qcrilmsgtunnel.apk|0d533923f840e3ce2ab43c956ea0ae4f29c7dc53 +-priv-app/qcrilmsgtunnel/qcrilmsgtunnel.apk framework/com.qualcomm.qti.uceservice-V2.0-java.jar vendor/bin/ATFWD-daemon vendor/bin/ipacm-diag @@ -935,7 +935,7 @@ vendor/lib/qcrild_librilutils.so vendor/lib64/qcrild_librilutils.so # Radio - IMS --priv-app/ims/ims.apk|3405e8189797954054130362011df237a1da7860 +-priv-app/ims/ims.apk etc/permissions/com.qualcomm.qti.imscmservice-V2.0-java.xml etc/permissions/com.qualcomm.qti.imscmservice-V2.1-java.xml etc/permissions/com.qualcomm.qti.imscmservice.xml @@ -1039,59 +1039,56 @@ vendor/etc/wifi/aoa_cldb_swl14.bin etc/firmware/wlan/prima/WCNSS_cfg.dat # Wi-Fi Display - 8901.2.A.0111-SS.20200304 -bin/wfdservice|edeb291221024401cbae69c2fa4e58733b7efc4c -etc/init/wfdservice.rc|311bfdd1675e56499662f39455536b75b78477bb -etc/wfdconfigsink.xml|134a86f74d9c374ce9081bff92c02515712a7f12 -etc/wfdconfig.xml|60a210d323f3f65dd1424cfd517295c522824b7b --framework/WfdCommon.jar|7b925c98d811b342e55549521af5c0a244e44025 -lib64/extractors/libmmparser.so|61cba3935000d9e04c7b73a20961bc8b15ed31b7 -lib64/libFileMux.so|c528ef66ce38e8474690b75d6ee1c9380c424be1 -lib64/libmmosal.so|b836f3b339d3acd93c63ad144ce4ba4aadb16e38 -lib64/libmmparser_lite.so|7e4d2f1022be67ccf9fe23034882c4e169b251d5 -lib64/libwfdclient.so|89d4d2d1a452246664a4dc4ae783173be3180835 -lib64/libwfdnative.so|e73791a9d0ee843547adf5d2cbf1973af505bd91 -lib/com.qualcomm.qti.wifidisplayhal@1.0.so|53ea5a509b6de0dbc3848275dd9eff18a4f0b519 -lib/extractors/libmmparser.so|8628c82f2cc2a269826ee86e3883c7cf1ed6949c -lib/libFileMux.so|5961dd16c9c6808e8321abf4b0266a9926ef327b -lib/libmmosal.so|ca8714ad8bd64ae9d23222df6098fbb949e75d96 -lib/libmmparser_lite.so|786498c462929cedbdd532a7c7a4aee99a63e616 -lib/libmmrtpdecoder.so|adb55936e63ff087a9e3458070515e1ab7dbe178 -lib/libmmrtpencoder.so|9a85d450a8633207f7a499962c5821d1a3fec2b8 -lib/libOmxMux.so|6aff8e6e81331f3d5d3a8d46d342e5b5efc237f3 -lib/libwfdavenhancements.so|e699cad5e5f6bd5ff6b07495795e1f5865a91166 -lib/libwfdclient.so|dfef4e644097d82eef472cbc7b9079062b1c838c -lib/libwfdcodecv4l2.so|c4d8f54143431e8a8648766f989ff64adbae3557 -lib/libwfdcommonutils.so|f76e75661c41c5c494f60dbb01f22f7114b51fc6 -lib/libwfdconfigutils.so|1f7a9f752648de1fc04655133e9ddbfafa640839 -lib/libwfdmminterface.so|3ed15fd4bbb865722399bba446302bd61ab023fd -lib/libwfdmmsink.so|9bc89fddbd83522b81e43b818fcf8f2ec39d4191 -lib/libwfdmmsrc.so|0ea81dcf5cc913cb48dc61b400513ad0f0478ec8 -lib/libwfdnative.so|3c7450ba0b62d5b8f40f3a3036f8a46542a2d241 -lib/libwfdrtsp.so|5ee03a541fc3c2d5437b6caf48702ea99e704db4 -lib/libwfdservice.so|a6470df0d60f880396643a3038c49a07b23ff116 -lib/libwfdsm.so|363c2a674520d7bb76883ed5957d5a66b7da440b -lib/libwfduibcinterface.so|85faeea87b41e321de9a6fc0c4106978abf2ca92 -lib/libwfduibcsinkinterface.so|25235e58eb13e84f0e9bbc06592fdf85369d7529 -lib/libwfduibcsink.so|2573a8b30d8c774d415ddfa788d4a5b8b12f4c1b -lib/libwfduibcsrcinterface.so|cb1ce08a89654236a29d940b6988309b670bf98d -lib/libwfduibcsrc.so|78bc3258deb8f818c3392d5accdf8e7aac729fdc --priv-app/WfdService/WfdService.apk|30befc443051135dff5d00d8185e575c3aaff9c0 -vendor/bin/wifidisplayhalservice|4822ef60a8f95a120af13833071c06af8618ae0b -vendor/etc/init/com.qualcomm.qti.wifidisplayhal@1.0-service.rc|04e463342cbba4c0e9c311a18238f95dec9359fd -vendor/lib/com.qualcomm.qti.wifidisplayhal@1.0-halimpl.so|f4b6f4e2e40552601aa42ededf856841ce376fe1 -vendor/lib/com.qualcomm.qti.wifidisplayhal@1.0.so|1f617a4c89ce9cd1e62a6960d5f09bc1b8402ea3 -vendor/lib/libmmosal_proprietary.so|df50cf90bdf0e29bcd741af46b5ace8c89c0b8c0 -vendor/lib/libOmxVideoDSMode.so|49afb32feb65de020ef3b4f2f67e13edaa14816c -vendor/lib/libwfdcommonutils_proprietary.so|e82897ed8d7d797336df291a1afb6e22227b2f60 -vendor/lib/libwfdhaldsmanager.so|e19f116dae16c0397ae910795ca6680e6a8a6dc6 -vendor/lib/libwfdhdcpcp.so|e0969d65a5809fc2f0d5f84bde616554cebe8b5e -vendor/lib/libwfdmmservice.so|edfef7c2a265539ab8256291bf5a537ee72ae534 -vendor/lib/libwfdmodulehdcpsession.so|c7893d8cb4dfa574c2835bd08d539177e912144e -vendor/lib64/libmmosal_proprietary.so|1a6fd0d32407879020428c2c403e0a9bfe554750 -vendor/lib64/libwfdhdcpcp.so|d9bfd72076d5c657c54ac5ff9e2b6ac1e0a194f2 - -# Add Arima ftm daemon and adb enable command start -vendor/bin/ArimaFtmDaemon +bin/wfdservice +etc/init/wfdservice.rc +etc/wfdconfigsink.xml +etc/wfdconfig.xml +-framework/WfdCommon.jar +lib64/extractors/libmmparser.so +lib64/libFileMux.so +lib64/libmmosal.so +lib64/libmmparser_lite.so +lib64/libwfdclient.so +lib64/libwfdnative.so +lib/com.qualcomm.qti.wifidisplayhal@1.0.so +lib/extractors/libmmparser.so +lib/libFileMux.so +lib/libmmosal.so +lib/libmmparser_lite.so +lib/libmmrtpdecoder.so +lib/libmmrtpencoder.so +lib/libOmxMux.so +lib/libwfdavenhancements.so +lib/libwfdclient.so +lib/libwfdcodecv4l2.so +lib/libwfdcommonutils.so +lib/libwfdconfigutils.so +lib/libwfdmminterface.so +lib/libwfdmmsink.so +lib/libwfdmmsrc.so +lib/libwfdnative.so +lib/libwfdrtsp.so +lib/libwfdservice.so +lib/libwfdsm.so +lib/libwfduibcinterface.so +lib/libwfduibcsinkinterface.so +lib/libwfduibcsink.so +lib/libwfduibcsrcinterface.so +lib/libwfduibcsrc.so +-priv-app/WfdService/WfdService.apk +vendor/bin/wifidisplayhalservice +vendor/etc/init/com.qualcomm.qti.wifidisplayhal@1.0-service.rc +vendor/lib/com.qualcomm.qti.wifidisplayhal@1.0-halimpl.so +vendor/lib/com.qualcomm.qti.wifidisplayhal@1.0.so +vendor/lib/libmmosal_proprietary.so +vendor/lib/libOmxVideoDSMode.so +vendor/lib/libwfdcommonutils_proprietary.so +vendor/lib/libwfdhaldsmanager.so +vendor/lib/libwfdhdcpcp.so +vendor/lib/libwfdmmservice.so +vendor/lib/libwfdmodulehdcpsession.so +vendor/lib64/libmmosal_proprietary.so +vendor/lib64/libwfdhdcpcp.so # This is in charge of setting the subsystem restart values at: # /sys/bus/msm_subsys/devices/subsys*/restart_level diff --git a/rootdir/etc/init.qcom.rc b/rootdir/etc/init.qcom.rc index 5fbf5a1..34bb9f0 100755 --- a/rootdir/etc/init.qcom.rc +++ b/rootdir/etc/init.qcom.rc @@ -1215,15 +1215,7 @@ service bugreport /system/bin/dumpstate -d -p -B -z -o /data/user_de/0/com.andro class main disabled oneshot - keycodes 114 115 116 - -# [20181113][TracyChui]Add arima ftm daemon and adb enable command start -service arima_ftm_daemon /vendor/bin/ArimaFtmDaemon - user root - group root - disabled -# [20181113][TracyChui]Add arima ftm daemon and adb enable command end - + keycodes 114 115 116 #Set GPU Opengles version on property:vendor.opengles.version=* diff --git a/setup-makefiles.sh b/setup-makefiles.sh index b521e64..d0220b0 100755 --- a/setup-makefiles.sh +++ b/setup-makefiles.sh @@ -40,7 +40,7 @@ source "${HELPER}" setup_vendor "${DEVICE}" "${VENDOR}" "${LINEAGE_ROOT}" true # Copyright headers and guards -write_headers "FP3 ocean channel" +write_headers "FP3" # The standard common blobs write_makefiles "${MY_DIR}/proprietary-files.txt" true From 67b653febf82a518cf21e37a590580587c68faad Mon Sep 17 00:00:00 2001 From: Sooraj S Date: Fri, 5 Jun 2020 01:12:19 +0530 Subject: [PATCH 3/9] FP3: enable WifiDisplay --- .../frameworks/base/core/res/res/values/config.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml index 130f364..85be230 100644 --- a/overlay/frameworks/base/core/res/res/values/config.xml +++ b/overlay/frameworks/base/core/res/res/values/config.xml @@ -454,4 +454,17 @@ 1.android.pool.ntp.org + + true + From eced0f4203aa76b205ecf85492c6be3d6db50c5a Mon Sep 17 00:00:00 2001 From: Sooraj S Date: Fri, 5 Jun 2020 01:25:04 +0530 Subject: [PATCH 4/9] FP3: Add dummy perf profile Since lineageos 15.1 the power hal doesn't use the perf_lock_use_profile() method anymore. It was used to apply performance profiles. On startup the perfd daemon is looking for at least one profile which is used as default. So there is only a perf-profiles0.conf to make the daemon happy. Removes log spam: E ANDR-PERF-MPCTL: Invalid profile no. 0, total profiles 0 only --- configs/perf/perf-profile0.conf | 2 ++ device.mk | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 configs/perf/perf-profile0.conf diff --git a/configs/perf/perf-profile0.conf b/configs/perf/perf-profile0.conf new file mode 100644 index 0000000..0c358e1 --- /dev/null +++ b/configs/perf/perf-profile0.conf @@ -0,0 +1,2 @@ +[priority] # This profile is reserved for perflock requests +99 diff --git a/device.mk b/device.mk index 3417040..e49ce0f 100644 --- a/device.mk +++ b/device.mk @@ -339,9 +339,10 @@ PRODUCT_PACKAGES += \ PRODUCT_COPY_FILES += \ $(LOCAL_PATH)/rootdir/bin/init.qti.qseecomd.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.qti.qseecomd.sh -# Powerhint configuration file +# Perf PRODUCT_COPY_FILES += \ - $(LOCAL_PATH)/configs/powerhint.xml:system/etc/powerhint.xml + $(LOCAL_PATH)/configs/powerhint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/powerhint.xml \ + $(LOCAL_PATH)/configs/perf/perf-profile0.conf:$(TARGET_COPY_OUT_VENDOR)/etc/perf/perf-profile0.conf # Enable vndk-sp Libraries PRODUCT_PACKAGES += \ From b149fdd3e02e74af412cc27c5f2c0f12b646f89b Mon Sep 17 00:00:00 2001 From: Sooraj S Date: Fri, 5 Jun 2020 01:30:16 +0530 Subject: [PATCH 5/9] FP3: Update power profile --- .../base/core/res/res/xml/power_profile.xml | 120 +++++++++++++----- 1 file changed, 91 insertions(+), 29 deletions(-) diff --git a/overlay/frameworks/base/core/res/res/xml/power_profile.xml b/overlay/frameworks/base/core/res/res/xml/power_profile.xml index 7fe9cc9..c42a8b9 100644 --- a/overlay/frameworks/base/core/res/res/xml/power_profile.xml +++ b/overlay/frameworks/base/core/res/res/xml/power_profile.xml @@ -29,33 +29,95 @@ --> - 63 - 261 - - - 200000 - 499200 - 533333 - 800000 - 998400 - 1094400 - 1209600 - - - - 151 - 169 - 177 - 195 - 259 - 307 - 353 - - - 1.6 - - 1.6 - - 3060 + + + 0 + 63 + 261 + + 0.606 + + 74.462 + + 25.088 + + 374.399 + + 265.769 + + 21.412 + + 208.332 + + 46.310 + + + 33.079 + 30 + 25 + 20 + 15 + 10 + 5 + 1.090 + + + + 4 + 4 + + + 614400 + 883200 + 1036800 + 1363200 + 1536000 + 1670400 + 1804800 + + + 633600 + 902400 + 1094400 + 1401600 + 1555200 + 1804800 + + + 8.24 + 18.66 + 20.2 + 28.57 + 48.57 + 51.23 + 62.6 + + + 10.85 + 20.85 + 31.57 + 50.96 + 70.31 + 100.25 + + + 4.27 + + 7.22 + + 3.993 + + 2.969 + + 3.5 + + + 3060 From 16b143b1456f7af827e732f15ed8f1fe76b53b85 Mon Sep 17 00:00:00 2001 From: Sooraj S Date: Fri, 5 Jun 2020 01:33:35 +0530 Subject: [PATCH 6/9] FP3: clean display related debug props --- vendor_prop.mk | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/vendor_prop.mk b/vendor_prop.mk index 8c56366..b43ad50 100644 --- a/vendor_prop.mk +++ b/vendor_prop.mk @@ -5,9 +5,14 @@ # Display PRODUCT_PROPERTY_OVERRIDES += \ debug.sf.enable_hwc_vds=1 \ - debug.sf.hw=1 \ + debug.sf.hw=0 \ debug.egl.hw=0 \ - dev.pm.dyn_samplingrate=1 + dev.pm.dyn_samplingrate=1 \ + debug.sf.recomputecrop=0 \ + persist.hwc.mdpcomp.enable=true \ + debug.mdpcomp.logs=0 \ + dalvik.vm.heapsize=36m + #Disable SF Latch Buffer Signaled property PRODUCT_PROPERTY_OVERRIDES += \ From 3a188f479d3b20929a3db0f17936310c742ffcde Mon Sep 17 00:00:00 2001 From: Sooraj S Date: Mon, 8 Jun 2020 15:16:35 +0530 Subject: [PATCH 7/9] FP3: Add device specific power class This is a copy from /hardware/qcom/power/power-8953.c which is modified to device specific needs --- BoardConfig.mk | 5 + configs/powerhint.xml | 160 ++++++++++------- power/Android.mk | 17 ++ power/power-8953.c | 408 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 523 insertions(+), 67 deletions(-) create mode 100644 power/Android.mk create mode 100644 power/power-8953.c diff --git a/BoardConfig.mk b/BoardConfig.mk index 5a03659..0bc8706 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -201,6 +201,11 @@ NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3 TARGET_USES_MEDIA_EXTENSIONS := true TARGET_MOUNT_POINTS_SYMLINKS := false +# Power +BOARD_POWER_CUSTOM_BOARD_LIB := libpower_8953 +TARGET_HAS_NO_WLAN_STATS := true +TARGET_USES_INTERACTION_BOOST := true + # DRM TARGET_ENABLE_MEDIADRM_64 := true diff --git a/configs/powerhint.xml b/configs/powerhint.xml index 7e9f283..4db4f46 100644 --- a/configs/powerhint.xml +++ b/configs/powerhint.xml @@ -2,6 +2,7 @@ + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/power/Android.mk b/power/Android.mk new file mode 100644 index 0000000..29b8506 --- /dev/null +++ b/power/Android.mk @@ -0,0 +1,17 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_C_INCLUDES := hardware/qcom/power +LOCAL_CFLAGS := -Wall -Werror +LOCAL_SHARED_LIBRARIES := liblog +LOCAL_HEADER_LIBRARIES += libhardware_headers + +ifeq ($(TARGET_USES_INTERACTION_BOOST),true) + LOCAL_CFLAGS += -DINTERACTION_BOOST +endif + +LOCAL_SRC_FILES := power-8953.c +LOCAL_MODULE := libpower_8953 +LOCAL_VENDOR_MODULE := true +include $(BUILD_STATIC_LIBRARY) diff --git a/power/power-8953.c b/power/power-8953.c new file mode 100644 index 0000000..ffcd7e8 --- /dev/null +++ b/power/power-8953.c @@ -0,0 +1,408 @@ +/* + * Copyright (c) 2016, The Linux Foundation. All rights reserved. + * Copyright (C) 2018 The LineageOS Project + * + * 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. + */ + +#define LOG_NIDEBUG 0 + +#include +#include +#include +#include +#include +#include +#include +#include + +#define LOG_TAG "QCOM PowerHAL" +#include +#include +#include + +#include "utils.h" +#include "metadata-defs.h" +#include "hint-data.h" +#include "performance.h" +#include "power-common.h" + +#define NUM_PERF_MODES 3 + +const int kMaxLaunchDuration = 5000; /* ms */ +const int kMaxInteractiveDuration = 5000; /* ms */ +const int kMinInteractiveDuration = 500; /* ms */ + +static int current_power_profile = PROFILE_BALANCED; + +static int profile_high_performance[] = { + SCHED_BOOST_ON_V3, 0x1, + ALL_CPUS_PWR_CLPS_DIS_V3, 0x1, + MIN_FREQ_BIG_CORE_0, 0xFFF, + MIN_FREQ_LITTLE_CORE_0, 0xFFF, + GPU_MIN_POWER_LEVEL, 0x1, + SCHED_PREFER_IDLE_DIS_V3, 0x1, + SCHED_MOSTLY_IDLE_NR_RUN, 0x1, + SCHED_MOSTLY_IDLE_LOAD, 0x1, +}; + +static int profile_power_save[] = { + MAX_FREQ_BIG_CORE_0, 0x3bf, + MAX_FREQ_LITTLE_CORE_0, 0x300, +}; + +static int profile_bias_power[] = { + MAX_FREQ_BIG_CORE_0, 0x4B0, + MAX_FREQ_LITTLE_CORE_0, 0x300, +}; + +static int profile_bias_performance[] = { + MIN_FREQ_BIG_CORE_0, 0x540, +}; + +#ifdef INTERACTION_BOOST +int get_number_of_profiles() +{ + return 5; +} +#endif + +static int set_power_profile(void *data) +{ + int profile = data ? *((int*)data) : 0; + int ret = -EINVAL; + const char *profile_name = NULL; + + if (profile == current_power_profile) + return 0; + + ALOGV("%s: Profile=%d", __func__, profile); + + if (current_power_profile != PROFILE_BALANCED) { + undo_hint_action(DEFAULT_PROFILE_HINT_ID); + ALOGV("%s: Hint undone", __func__); + current_power_profile = PROFILE_BALANCED; + } + + if (profile == PROFILE_POWER_SAVE) { + ret = perform_hint_action(DEFAULT_PROFILE_HINT_ID, profile_power_save, + ARRAY_SIZE(profile_power_save)); + profile_name = "powersave"; + + } else if (profile == PROFILE_HIGH_PERFORMANCE) { + ret = perform_hint_action(DEFAULT_PROFILE_HINT_ID, + profile_high_performance, ARRAY_SIZE(profile_high_performance)); + profile_name = "performance"; + + } else if (profile == PROFILE_BIAS_POWER) { + ret = perform_hint_action(DEFAULT_PROFILE_HINT_ID, profile_bias_power, + ARRAY_SIZE(profile_bias_power)); + profile_name = "bias power"; + + } else if (profile == PROFILE_BIAS_PERFORMANCE) { + ret = perform_hint_action(DEFAULT_PROFILE_HINT_ID, + profile_bias_performance, ARRAY_SIZE(profile_bias_performance)); + profile_name = "bias perf"; + } else if (profile == PROFILE_BALANCED) { + ret = 0; + profile_name = "balanced"; + } + + if (ret == 0) { + current_power_profile = profile; + ALOGD("%s: Set %s mode", __func__, profile_name); + } + return ret; +} + +typedef enum { + NORMAL_MODE = 0, + SUSTAINED_MODE = 1, + VR_MODE = 2, + VR_SUSTAINED_MODE = (SUSTAINED_MODE|VR_MODE), + INVALID_MODE = 0xFF +} perf_mode_type_t; + +typedef struct perf_mode { + perf_mode_type_t type; + int perf_hint_id; +} perf_mode_t; + +perf_mode_t perf_modes[NUM_PERF_MODES] = { + { SUSTAINED_MODE, SUSTAINED_PERF_HINT }, + { VR_MODE, VR_MODE_HINT }, + { VR_SUSTAINED_MODE, VR_MODE_SUSTAINED_PERF_HINT } +}; + +static int current_mode = NORMAL_MODE; + +static inline int get_perfd_hint_id(perf_mode_type_t type) { + int i; + for (i = 0; i < NUM_PERF_MODES; i++) { + if (perf_modes[i].type == type) { + ALOGD("Hint id is 0x%x for mode 0x%x", perf_modes[i].perf_hint_id, type); + return perf_modes[i].perf_hint_id; + } + } + ALOGD("Couldn't find the hint for mode 0x%x", type); + return 0; +} + +static int switch_mode(perf_mode_type_t mode) { + int hint_id = 0; + static int perfd_mode_handle = -1; + + // release existing mode if any + if (CHECK_HANDLE(perfd_mode_handle)) { + ALOGD("Releasing handle 0x%x", perfd_mode_handle); + release_request(perfd_mode_handle); + perfd_mode_handle = -1; + } + // switch to a perf mode + hint_id = get_perfd_hint_id(mode); + if (hint_id != 0) { + perfd_mode_handle = perf_hint_enable(hint_id, 0); + if (!CHECK_HANDLE(perfd_mode_handle)) { + ALOGE("Failed perf_hint_interaction for mode: 0x%x", mode); + return -1; + } + ALOGD("Acquired handle 0x%x", perfd_mode_handle); + } + return 0; +} + +static int process_perf_hint(void *data, perf_mode_type_t mode) { + // enable + if (data) { + ALOGI("Enable request for mode: 0x%x", mode); + // check if mode is current mode + if (current_mode & mode) { + ALOGD("Mode 0x%x already enabled", mode); + return HINT_HANDLED; + } + // enable requested mode + if (0 != switch_mode(current_mode | mode)) { + ALOGE("Couldn't enable mode 0x%x", mode); + return HINT_NONE; + } + current_mode |= mode; + ALOGI("Current mode is 0x%x", current_mode); + // disable + } else { + ALOGI("Disable request for mode: 0x%x", mode); + // check if mode is enabled + if (!(current_mode & mode)) { + ALOGD("Mode 0x%x already disabled", mode); + return HINT_HANDLED; + } + // disable requested mode + if (0 != switch_mode(current_mode & ~mode)) { + ALOGE("Couldn't disable mode 0x%x", mode); + return HINT_NONE; + } + current_mode &= ~mode; + ALOGI("Current mode is 0x%x", current_mode); + } + + return HINT_HANDLED; +} + +static int process_video_encode_hint(void *metadata) +{ + char governor[80]; + struct video_encode_metadata_t video_encode_metadata; + static int video_encode_handle = 0; + + if (!metadata) { + return HINT_NONE; + } + + if (get_scaling_governor_check_cores(governor, sizeof(governor), CPU0) == -1) { + if (get_scaling_governor_check_cores(governor, sizeof(governor), CPU1) == -1) { + if (get_scaling_governor_check_cores(governor, sizeof(governor), CPU2) == -1) { + if (get_scaling_governor_check_cores(governor, sizeof(governor), CPU3) == -1) { + ALOGE("Can't obtain scaling governor."); + return HINT_NONE; + } + } + } + } + + /* Initialize encode metadata struct fields */ + memset(&video_encode_metadata, 0, sizeof(struct video_encode_metadata_t)); + video_encode_metadata.state = -1; + + if (parse_video_encode_metadata((char *)metadata, &video_encode_metadata) == -1) { + ALOGE("Error occurred while parsing metadata."); + return HINT_NONE; + } + + if (video_encode_metadata.state == 1) { + if (is_interactive_governor(governor)) { + video_encode_handle = perf_hint_enable( + VIDEO_ENCODE_HINT, 0); + return HINT_HANDLED; + } + } else if (video_encode_metadata.state == 0) { + if (is_interactive_governor(governor)) { + release_request(video_encode_handle); + return HINT_HANDLED; + } + } + return HINT_NONE; +} + +static int process_activity_launch_hint(void *data) +{ + static int launch_handle = -1; + static int launch_mode = 0; + // release lock early if launch has finished + if (!data) { + if (CHECK_HANDLE(launch_handle)) { + release_request(launch_handle); + launch_handle = -1; + } + launch_mode = 0; + return HINT_HANDLED; + } + if (current_mode != NORMAL_MODE) { + ALOGV("%s: ignoring due to other active perf hints", __func__); + } else if (!launch_mode) { + launch_handle = perf_hint_enable_with_type(VENDOR_HINT_FIRST_LAUNCH_BOOST, + kMaxLaunchDuration, LAUNCH_BOOST_V1); + if (!CHECK_HANDLE(launch_handle)) { + ALOGE("Failed to perform launch boost"); + return HINT_NONE; + } + launch_mode = 1; + } + return HINT_HANDLED; +} + +static int process_interaction_hint(void *data) +{ + static struct timespec s_previous_boost_timespec; + static int s_previous_duration = 0; + struct timespec cur_boost_timespec; + long long elapsed_time; + int duration = kMinInteractiveDuration; + if (current_mode != NORMAL_MODE) { + ALOGV("%s: ignoring due to other active perf hints", __func__); + return HINT_HANDLED; + } + if (data) { + int input_duration = *((int*)data); + if (input_duration > duration) { + duration = (input_duration > kMaxInteractiveDuration) ? + kMaxInteractiveDuration : input_duration; + } + } + clock_gettime(CLOCK_MONOTONIC, &cur_boost_timespec); + elapsed_time = calc_timespan_us(s_previous_boost_timespec, cur_boost_timespec); + // don't hint if previous hint's duration covers this hint's duration + if ((s_previous_duration * 1000) > (elapsed_time + duration * 1000)) { + return HINT_HANDLED; + } + s_previous_boost_timespec = cur_boost_timespec; + s_previous_duration = duration; + + perf_hint_enable_with_type(VENDOR_HINT_SCROLL_BOOST, duration, SCROLL_VERTICAL); + + return HINT_HANDLED; +} + +int power_hint_override(power_hint_t hint, void *data) +{ + int ret_val = HINT_NONE; + + if (hint == POWER_HINT_SET_PROFILE) { + if (set_power_profile(data) < 0) + ALOGE("Setting power profile failed. perf HAL not started?"); + return HINT_HANDLED; + } + + // Skip other hints in high/low power modes + if (current_power_profile == PROFILE_POWER_SAVE || + current_power_profile == PROFILE_HIGH_PERFORMANCE) { + return HINT_HANDLED; + } + + switch (hint) { + case POWER_HINT_VSYNC: + break; + case POWER_HINT_VIDEO_ENCODE: + ret_val = process_video_encode_hint(data); + break; + case POWER_HINT_SUSTAINED_PERFORMANCE: + ret_val = process_perf_hint(data, SUSTAINED_MODE); + break; + case POWER_HINT_VR_MODE: + ret_val = process_perf_hint(data, VR_MODE); + break; + case POWER_HINT_INTERACTION: + ret_val = process_interaction_hint(data); + break; + case POWER_HINT_LAUNCH: + ret_val = process_activity_launch_hint(data); + break; + default: + break; + } + return ret_val; +} + +int set_interactive_override(int on) +{ + char governor[80]; + + if (get_scaling_governor_check_cores(governor, sizeof(governor), CPU0) == -1) { + if (get_scaling_governor_check_cores(governor, sizeof(governor), CPU1) == -1) { + if (get_scaling_governor_check_cores(governor, sizeof(governor), CPU2) == -1) { + if (get_scaling_governor_check_cores(governor, sizeof(governor), CPU3) == -1) { + ALOGE("Can't obtain scaling governor."); + return HINT_NONE; + } + } + } + } + + if (!on) { + /* Display off. */ + if (is_interactive_governor(governor)) { + int resource_values[] = { + INT_OP_CLUSTER0_TIMER_RATE, BIG_LITTLE_TR_MS_40 + }; + perform_hint_action(DISPLAY_STATE_HINT_ID, + resource_values, ARRAY_SIZE(resource_values)); + } + } else { + /* Display on. */ + if (is_interactive_governor(governor)) { + undo_hint_action(DISPLAY_STATE_HINT_ID); + } + } + return HINT_HANDLED; +} From a5ebc0fb5f12902564d98bebd7ab4449e3902d1a Mon Sep 17 00:00:00 2001 From: Sooraj S Date: Tue, 9 Jun 2020 11:35:23 +0530 Subject: [PATCH 8/9] FP3 overlay: Enable ACS and 11ac for softap operations This sets below flag to true: config_wifi_softap_acs_supported config_wifi_softap_ieee80211ac_supported --- overlay/frameworks/base/core/res/res/values/config.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml index 85be230..16008f5 100644 --- a/overlay/frameworks/base/core/res/res/values/config.xml +++ b/overlay/frameworks/base/core/res/res/values/config.xml @@ -284,10 +284,10 @@ - false + true - false + true false From 2ddbbf2e56bed37f7aec1af8928ea0f021932864 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Lam?= Date: Thu, 11 Jun 2020 13:23:32 +0200 Subject: [PATCH 9/9] Remove redundant heapsize line --- vendor_prop.mk | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vendor_prop.mk b/vendor_prop.mk index b43ad50..5aebffd 100644 --- a/vendor_prop.mk +++ b/vendor_prop.mk @@ -10,9 +10,7 @@ PRODUCT_PROPERTY_OVERRIDES += \ dev.pm.dyn_samplingrate=1 \ debug.sf.recomputecrop=0 \ persist.hwc.mdpcomp.enable=true \ - debug.mdpcomp.logs=0 \ - dalvik.vm.heapsize=36m - + debug.mdpcomp.logs=0 #Disable SF Latch Buffer Signaled property PRODUCT_PROPERTY_OVERRIDES += \