Skip to content

Commit

Permalink
Merge pull request #15 from mstaz/merge_e_20200616
Browse files Browse the repository at this point in the history
Merge updates from /e/ device tree branch
  • Loading branch information
dk1978 authored Jun 25, 2020
2 parents b589c55 + 97e11e6 commit b38150c
Show file tree
Hide file tree
Showing 12 changed files with 719 additions and 200 deletions.
5 changes: 5 additions & 0 deletions BoardConfig.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions configs/perf/perf-profile0.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[priority] # This profile is reserved for perflock requests
99
160 changes: 93 additions & 67 deletions configs/powerhint.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<!--
/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
* Copyright (c) 2020, The eOS Project.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
Expand Down Expand Up @@ -29,71 +30,96 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-->
<HintConfigs>
<Powerhint>
<!--preview-->
<!-- B CPU - above_hispeed_delay of 40 ms -->
<!-- B CPU - go hispeed load 95 -->
<!-- B CPU - hispeed freq of 556 MHz -->
<!-- B CPU - target load of 90 -->
<!-- L CPU - above_hispeed_delay of 40 ms -->
<!-- L CPU - go hispeed load 95 -->
<!-- L CPU - hispeed freq of 556 MHz- -->
<!-- L CPU - target load of 90 -->
<!-- CPUBW low power ceil mpbs of 2500 -->
<!-- CPUBW low power io percent of 50 -->
<Config
Id="0x00001300" Enable="true" Target="msm8953"
Resources="0x41400000, 0x4, 0x41410000, 0x5F, 0x41414000, 0x22C, 0x41420000, 0x5A, 0x41400100, 0x4, 0x41410100, 0x5F
, 0x41414100, 0x22C, 0x41420100, 0x5A, 0x41810000, 0x9C4, 0x41814000, 0x32" />

<Powerhint>
<Hint type="0x0E00"> <!--preview-->
<Resource opcode="0x41400000" value="0x4" /> <!-- B CPU - above_hispeed_delay of 40 ms -->
<Resource opcode="0x41410000" value="0x5F" /> <!-- B CPU - go hispeed load 95 -->
<Resource opcode="0x41414000" value="0x22C"/> <!-- B CPU - hispeed freq of 556 MHz -->
<Resource opcode="0x41420000" value="0x5A" /> <!-- B CPU - target load of 90 -->
<Resource opcode="0x41400100" value="0x4" /> <!-- L CPU - above_hispeed_delay of 40 ms -->
<Resource opcode="0x41410100" value="0x5F" /> <!-- L CPU - go hispeed load 95 -->
<Resource opcode="0x41414100" value="0x22C"/> <!-- L CPU - hispeed freq of 556 MHz- -->
<Resource opcode="0x41420100" value="0x5A" /> <!-- L CPU - target load of 90 -->
<Resource opcode="0x41810000" value="0x9C4"/> <!-- CPUBW low power ceil mpbs of 2500 -->
<Resource opcode="0x41814000" value="0x32" /> <!-- CPUBW low power io percent of 50 -->
</Hint>
<Hint type="0x0A00"> <!--video encode 30 fps-->
<Resource opcode="0x41400000" value="0x4" /> <!-- B CPU - above_hispeed_delay of 40 ms -->
<Resource opcode="0x41410000" value="0x5F" /> <!-- B CPU - go hispeed load 95 -->
<Resource opcode="0x41414000" value="0x326"/> <!-- B CPU - hispeed freq of 806 MHz -->
<Resource opcode="0x41420000" value="0x5A" /> <!-- B CPU - target load of 90 -->
<Resource opcode="0x41400100" value="0x4" /> <!-- L CPU - above_hispeed_delay of 40 ms -->
<Resource opcode="0x41410100" value="0x5F" /> <!-- L CPU - go hispeed load 95 -->
<Resource opcode="0x41414100" value="0x22C"/> <!-- L CPU - hispeed freq of 556 MHz- -->
<Resource opcode="0x41420100" value="0x5A" /> <!-- L CPU - target load of 90 -->
<Resource opcode="0x41810000" value="0x9C4"/> <!-- CPUBW low power ceil mpbs of 2500 -->
<Resource opcode="0x41814000" value="0x32" /> <!-- CPUBW low power io percent of 50 -->
<Resource opcode="0x4180C000" value="0x0" /> <!-- CPUBW disable hysteresis -->
<Resource opcode="0x41820000" value="0xA" /> <!-- CPUBW sample_ms of 10ms -->
<Resource opcode="0x41438100" value="0x0" /> <!-- L CPU - disable ignore_hispeed_notif -->
<Resource opcode="0x41438000" value="0x0" /> <!-- B CPU - disable ignore_hispeed_notif -->
</Hint>
<Hint type="0x0B00"> <!--video decode-->
<Resource opcode="0x41400100" value="0x4" /> <!-- L CPU - Above Hispeed Delay of 40ms -->
<Resource opcode="0x41410100" value="0x5F" /> <!-- L CPU - Go Hispeed Delay of 95 -->
<Resource opcode="0x41414100" value="0x2D9"/> <!-- L CPU - Hispeed Freq of 768 MHz -->
<Resource opcode="0x41420100" value="0x5A" /> <!-- L CPU - Target Loads of 90 -->
<Resource opcode="0x41400000" value="0x4" /> <!-- B CPU - Above Hispeed Delay of 40ms -->
<Resource opcode="0x41410000" value="0x5F" /> <!-- B CPU - Go Hispeed Load of 95 -->
<Resource opcode="0x41414000" value="0x2D9"/> <!-- B CPU - Hispeed Freq of 729 MHz -->
<Resource opcode="0x41420000" value="0x5A" /> <!-- B CPU - Target Load of 90 -->
</Hint>
<Hint type="0x0F00"> <!--sustained performance-->
<Resource opcode="0x40800000" value="0x0"/> <!-- B CPU - Cluster min freq uncapped -->
<Resource opcode="0x40800100" value="0x0"/> <!-- L CPU - Cluster min freq uncapped -->
<Resource opcode="0x40804000" value="0x4E0"/> <!-- B CPU - Cluster max freq ~1.2 GHz -->
<Resource opcode="0x40804100" value="0x4E0"/> <!-- L CPU - Cluster max freq ~1.2 Ghz -->
<Resource opcode="0x4280C000" value="0xB4"/> <!-- GPU - min freq 180 Mhz -->
<Resource opcode="0x42810000" value="0x156"/> <!-- GPU - max freq 342 Mhz -->
<Resource opcode="0x42814000" value="0x0"/> <!-- GPUBW freq uncapped -->
</Hint>
<Hint type="0x1000"> <!--vr mode-->
<Resource opcode="0x40800000" value="0x579"/> <!-- B CPU - Cluster min freq ~1.4 Ghz -->
<Resource opcode="0x40800100" value="0x579"/> <!-- L CPU - Cluster min freq ~1.4 Ghz -->
<Resource opcode="0x40804000" value="0x579"/> <!-- B CPU - Cluster max freq ~1.4 Ghz -->
<Resource opcode="0x40804100" value="0x579"/> <!-- L CPU - Cluster max freq ~1.4 Ghz -->
<Resource opcode="0x4280C000" value="0x203"/> <!-- GPU - min freq 510 Mhz -->
<Resource opcode="0x42810000" value="0x203"/> <!-- GPU - max freq 510 Mhz -->
<Resource opcode="0x42814000" value="0x1E4F"/> <!-- GPUBW freq 775 Mhz-->
</Hint>
<Hint type="0x1001"> <!--vr mode sustained performance-->
<Resource opcode="0x40800000" value="0x4E0"/> <!-- B CPU - Cluster min freq ~1.2 Ghz -->
<Resource opcode="0x40800100" value="0x4E0"/> <!-- L CPU - Cluster min freq ~1.2 Ghz -->
<Resource opcode="0x40804000" value="0x4E0"/> <!-- B CPU - Cluster max freq ~1.2 Ghz -->
<Resource opcode="0x40804100" value="0x4E0"/> <!-- L CPU - Cluster max freq ~1.2 Ghz -->
<Resource opcode="0x4280C000" value="0x156"/> <!-- GPU - min freq 342 Mhz -->
<Resource opcode="0x42810000" value="0x156"/> <!-- GPU - max freq 342 Mhz -->
<Resource opcode="0x42814000" value="0x1E4F"/> <!-- GPUBW freq 775 Mhz -->
</Hint>
</Powerhint>
<!--video encode 30 fps-->
<!-- B CPU - above_hispeed_delay of 40 ms -->
<!-- B CPU - go hispeed load 95 -->
<!-- B CPU - hispeed freq of 806 MHz -->
<!-- B CPU - target load of 90 -->
<!-- L CPU - above_hispeed_delay of 40 ms -->
<!-- L CPU - go hispeed load 95 -->
<!-- L CPU - hispeed freq of 556 MHz- -->
<!-- L CPU - target load of 90 -->
<!-- CPUBW low power ceil mpbs of 2500 -->
<!-- CPUBW low power io percent of 50 -->
<!-- CPUBW disable hysteresis -->
<!-- CPUBW sample_ms of 10ms -->
<!-- L CPU - disable ignore_hispeed_notif -->
<!-- B CPU - disable ignore_hispeed_notif -->
<Config
Id="0x00001203" Enable="true" Target="msm8953"
Resources="0x41400000, 0x4, 0x41410000, 0x5F ,0x41414000, 0x326, 0x41420000, 0x5A, 0x41400100, 0x4, 0x41410100
, 0x5F, 0x41414100, 0x22C, 0x41420100, 0x5A, 0x41810000 ,0x9C4, 0x41814000,
0x32, 0x4180C000 ,0x0, 0x41820000, 0xA, 0x41438100, 0x0, 0x41438000, 0x0" />

<!--video decode-->
<!-- L CPU - above_hispeed_delay of 40 ms -->
<!-- L CPU - go hispeed load 95 -->
<!-- L CPU - hispeed freq of 768 MHz- -->
<!-- L CPU - target load of 90 -->
<!-- B CPU - above_hispeed_delay of 40 ms -->
<!-- B CPU - go hispeed load 95 -->
<!-- B CPU - hispeed freq of 729 MHz -->
<!-- B CPU - target load of 90 -->
<Config
Id="0x00001204" Enable="true" Target="msm8953"
Resources="0x41400100, 0x4, 0x41410100, 0x5F ,0x41414100, 0x2D9, 0x41420100, 0x5A, 0x41400000, 0x4, 0x41410000
, 0x5F, 0x41414000, 0x2D9, 0x41420000, 0x5A" />

<!--sustained performance-->
<!-- B CPU - Cluster min freq uncapped -->
<!-- L CPU - Cluster min freq uncapped -->
<!-- B CPU - Cluster max freq ~1.2 GHz -->
<!-- L CPU - Cluster max freq ~1.2 Ghz -->
<!-- GPU - min freq 180 Mhz -->
<!-- GPU - max freq 342 Mhz -->
<!-- GPUBW freq uncapped -->
<Config
Id="0x00001206" Enable="true" Target="msm8953"
Resources="0x40800000, 0x0, 0x40800100, 0x0, 0x40804000, 0x4E0, 0x40804100, 0x4E0,
0x4280C000, 0xB4, 0x42810000, 0x156, 0x42814000, 0x0"/>

<!--vr mode-->
<!-- B CPU - Cluster min freq ~1.4 Ghz -->
<!-- L CPU - Cluster min freq ~1.4 Ghz -->
<!-- B CPU - Cluster max freq ~1.4 Ghz -->
<!-- L CPU - Cluster max freq ~1.4 Ghz -->
<!-- GPU - min freq 510 Mhz -->
<!-- GPU - max freq 510 Mhz -->
<!-- GPUBW freq 775 Mhz-->
<Config
Id="0x00001207" Enable="true" Target="msm8953"
Resources="0x40800000, 0x579, 0x40800100, 0x579, 0x40804000, 0x579, 0x40804100, 0x579,
0x4280C000, 0x203, 0x42810000, 0x203, 0x42814000, 0x1E4F"/>

<!--vr mode sustained performance-->
<!-- B CPU - Cluster min freq ~1.2 Ghz -->
<!-- L CPU - Cluster min freq ~1.2 Ghz -->
<!-- B CPU - Cluster max freq ~1.2 Ghz -->
<!-- L CPU - Cluster max freq ~1.2 Ghz -->
<!-- GPU - min freq 342 Mhz -->
<!-- GPU - max freq 342 Mhz -->
<!-- GPUBW freq 775 Mhz -->
<Config
Id="0x00001301" Enable="true" Target="msm8953"
Resources="0x40800000, 0x4E0, 0x40800100, 0x4E0, 0x40804000, 0x4E0, 0x40804100, 0x4E0, 0x4280C000, 0x156,
0x42810000, 0x156, 0x42814000, 0x1E4F"/>
</Powerhint>
</HintConfigs>
5 changes: 3 additions & 2 deletions device.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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 += \
Expand Down
4 changes: 2 additions & 2 deletions lineage_FP3.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 15 additions & 2 deletions overlay/frameworks/base/core/res/res/values/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,10 @@
</string-array>

<!-- Enable ACS (auto channel selection) for Wifi hotspot (SAP) -->
<bool translatable="false" name="config_wifi_softap_acs_supported">false</bool>
<bool translatable="false" name="config_wifi_softap_acs_supported">true</bool>

<!-- Enable 802.11ac for Wifi hotspot (SAP) -->
<bool translatable="false" name="config_wifi_softap_ieee80211ac_supported">false</bool>
<bool translatable="false" name="config_wifi_softap_ieee80211ac_supported">true</bool>

<!-- Boolean indicating whether single radio chain scan results are to be used for network selection -->
<bool translatable="false" name="config_wifi_framework_use_single_radio_chain_scan_results_network_selection">false</bool>
Expand Down Expand Up @@ -454,4 +454,17 @@
<!-- Remote server that can provide NTP responses. -->
<string translatable="false" name="config_ntpServer">1.android.pool.ntp.org</string>

<!-- Whether WiFi display is supported by this device.
There are many prerequisites for this feature to work correctly.
Here are a few of them:
* The WiFi radio must support WiFi P2P.
* The WiFi radio must support concurrent connections to the WiFi display and
to an access point.
* The Audio Flinger audio_policy.conf file must specify a rule for the "r_submix"
remote submix module. This module is used to record and stream system
audio output to the WiFi display encoder in the media server.
* The remote submix module "audio.r_submix.default" must be installed on the device.
* The device must be provisioned with HDCP keys (for protected content). -->
<bool name="config_enableWifiDisplay">true</bool>

</resources>
120 changes: 91 additions & 29 deletions overlay/frameworks/base/core/res/res/xml/power_profile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,33 +29,95 @@
-->

<device name="Android">
<item name="screen.on">63</item>
<item name="screen.full">261</item>
<!-- Different CPU speeds as reported in
/sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state -->
<array name="cpu.speeds">
<value>200000</value> <!-- 200 MHz CPU speed -->
<value>499200</value> <!-- 499 MHz CPU speed -->
<value>533333</value> <!-- 533 MHz CPU speed -->
<value>800000</value> <!-- 800 MHz CPU speed -->
<value>998400</value> <!-- 998 MHz CPU speed -->
<value>1094400</value> <!-- 1094 MHz CPU speed -->
<value>1209600</value> <!-- 1209 MHz CPU speed -->
</array>
<!-- Current at each CPU speed, as per 'cpu.speeds' -->
<array name="cpu.active">
<value>151</value>
<value>169</value>
<value>177</value>
<value>195</value>
<value>259</value>
<value>307</value>
<value>353</value>
</array>
<!-- Current when CPU is awake -->
<item name="cpu.awake">1.6</item>
<!-- Current when CPU is idle -->
<item name="cpu.idle">1.6</item>
<!-- This is the battery capacity in mAh (measured at nominal voltage) -->
<item name="battery.capacity">3060</item>
<!-- All values are in mA except as noted -->
<!-- Nothing -->
<item name="none">0</item>
<item name="screen.on">63</item>
<item name="screen.full">261</item>
<!-- Additional power used when Wi-Fi is turned on but not receiving,
transmitting, or scanning -->
<item name="wifi.on">0.606</item>
<!-- Additional power used when transmitting or receiving over Wi-Fi -->
<item name="wifi.active">74.462</item>
<!-- Additional power used when Wi-Fi is scanning for access points -->
<item name="wifi.scan">25.088</item>
<!-- Average power use by the camera subsystem for a typical camera
application. Intended as a rough estimate for an application running a
preview and capturing approximately 10 full-resolution pictures per
minute. -->
<item name="camera.avg">374.399</item>
<!-- Average power used by the camera flash module when on -->
<item name="camera.flashlight">265.769</item>
<!-- Additional power used when GPS is acquiring a signal -->
<item name="gps.on">21.412</item>
<!-- Additional power used when cellular radio is transmitting/receiving -->
<item name="radio.active">208.332</item>
<!-- The current consumed by the radio when it is scanning for a signal -->
<item name="radio.scanning">46.310</item>
<!-- Current consumed by the radio at different signal strengths, when paging -->
<array name="radio.on">
<value>33.079</value>
<value>30</value>
<value>25</value>
<value>20</value>
<value>15</value>
<value>10</value>
<value>5</value>
<value>1.090</value>
</array>
<!-- Number of cores each CPU cluster contains -->
<array name="cpu.clusters.cores">
<value>4</value> <!-- Cluster 0 has 4 cores (cpu0, cpu1, cpu2, cpu3) -->
<value>4</value> <!-- Cluster 1 has 4 cores (cpu4, cpu5, cpu6, cpu7) -->
</array>
<array name="cpu.core_speeds.cluster0">
<value>614400</value> <!-- 614 MHz CPU speed -->
<value>883200</value> <!-- 883 MHz CPU speed -->
<value>1036800</value> <!-- 1036 MHz CPU speed -->
<value>1363200</value> <!-- 1363 MHz CPU speed -->
<value>1536000</value> <!-- 1536 MHz CPU speed -->
<value>1670400</value> <!-- 1670 MHz CPU speed -->
<value>1804800</value> <!-- 1804 MHz CPU speed -->
</array>
<array name="cpu.core_speeds.cluster1">
<value>633600</value> <!-- 663 MHz CPU speed -->
<value>902400</value> <!-- 902 MHz CPU speed -->
<value>1094400</value> <!-- 1094 MHz CPU speed -->
<value>1401600</value> <!-- 1401 MHz CPU speed -->
<value>1555200</value> <!-- 1552 MHz CPU speed -->
<value>1804800</value> <!-- 1804 MHz CPU speed -->
</array>
<array name="cpu.core_power.cluster0">
<value>8.24</value> <!-- 614 MHz CPU speed -->
<value>18.66</value> <!-- 883 MHz CPU speed -->
<value>20.2</value> <!-- 1036 MHz CPU speed -->
<value>28.57</value> <!-- 1363 MHz CPU speed -->
<value>48.57</value> <!-- 1536 MHz CPU speed -->
<value>51.23</value> <!-- 1670 MHz CPU speed -->
<value>62.6</value> <!-- 1804 MHz CPU speed -->
</array>
<array name="cpu.core_power.cluster1">
<value>10.85</value> <!-- 663 MHz CPU speed -->
<value>20.85</value> <!-- 902 MHz CPU speed -->
<value>31.57</value> <!-- 1094 MHz CPU speed -->
<value>50.96</value> <!-- 1401 MHz CPU speed -->
<value>70.31</value> <!-- 1552 MHz CPU speed -->
<value>100.25</value> <!-- 1804 MHz CPU speed -->
</array>
<!-- Additional power consumption by CPU cluster0 itself when running
excluding cores in it -->
<item name="cpu.cluster_power.cluster0">4.27</item>
<!-- Additional power consumption by CPU cluster1 itself when running
excluding cores in it -->
<item name="cpu.cluster_power.cluster1">7.22</item>
<!-- Power consumption when CPU is suspended -->
<item name="cpu.suspend">3.993</item>
<!-- Additional power consumption when CPU is in a kernel idle loop -->
<item name="cpu.idle">2.969</item>
<!-- Additional power consumption by CPU excluding cluster and core when
running -->
<item name="cpu.active">3.5</item>
<!-- This is the battery capacity in mAh -->
<!-- This is the battery capacity in mAh (measured at nominal voltage) -->
<item name="battery.capacity">3060</item>
</device>
17 changes: 17 additions & 0 deletions power/Android.mk
Original file line number Diff line number Diff line change
@@ -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)
Loading

0 comments on commit b38150c

Please sign in to comment.