Skip to content

Commit e8c299e

Browse files
committed
add MTK cpu core file
1 parent 45caa98 commit e8c299e

23 files changed

+3084
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Copyright Statement:
2+
#
3+
# This software/firmware and related documentation ("MediaTek Software") are
4+
# protected under relevant copyright laws. The information contained herein
5+
# is confidential and proprietary to MediaTek Inc. and/or its licensors.
6+
# Without the prior written permission of MediaTek inc. and/or its licensors,
7+
# any reproduction, modification, use or disclosure of MediaTek Software,
8+
# and information contained herein, in whole or in part, shall be strictly prohibited.
9+
#
10+
# MediaTek Inc. (C) 2010. All rights reserved.
11+
#
12+
# BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
13+
# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
14+
# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON
15+
# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
16+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
17+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
18+
# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
19+
# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
20+
# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
21+
# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
22+
# THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
23+
# CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
24+
# SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
25+
# STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
26+
# CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
27+
# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
28+
# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
29+
# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
30+
#
31+
# The following software/firmware and/or related documentation ("MediaTek Software")
32+
# have been modified by MediaTek Inc. All revisions are subject to any receiver's
33+
# applicable license agreements with MediaTek Inc.
34+
ifneq ($(MTK_EMULATOR_SUPPORT), yes)
35+
LOCAL_PATH:= $(call my-dir)
36+
37+
#include $(call all-makefiles-under, $(LOCAL_PATH)/$(shell echo $(MTK_PLATFORM) | tr A-Z a-z ))
38+
ifneq ($(wildcard $(LOCAL_PATH)/$(shell echo $(MTK_PLATFORM) | tr A-Z a-z)),)
39+
40+
include $(LOCAL_PATH)/$(shell echo $(MTK_PLATFORM) | tr A-Z a-z)/Android.mk \
41+
$(LOCAL_PATH)/perfservicenative/Android.mk \
42+
$(LOCAL_PATH)/perf_native_test/Android.mk
43+
44+
else # mt[xxxx] folder exist
45+
46+
include $(LOCAL_PATH)/perfservicenative/Android.mk \
47+
$(LOCAL_PATH)/perf_native_test/Android.mk
48+
49+
endif # mt[xxxx] folder not exist
50+
endif
51+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
LOCAL_PATH:= $(call my-dir)
2+
include $(call all-makefiles-under,$(LOCAL_PATH))
3+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
ifeq ($(MTK_PERFSERVICE_SUPPORT), yes)
2+
3+
LOCAL_PATH := $(call my-dir)
4+
include $(CLEAR_VARS)
5+
6+
# Module name should match library/file name to be installed.
7+
LOCAL_MODULE := perf_whitelist_cfg.xml
8+
LOCAL_PROPRIETARY_MODULE := true
9+
LOCAL_MODULE_OWNER := mtk
10+
LOCAL_MODULE_TAGS := optional
11+
LOCAL_SRC_FILES := $(LOCAL_MODULE)
12+
# set class according to lib/file attribute
13+
LOCAL_MODULE_CLASS := ETC
14+
include $(BUILD_PREBUILT)
15+
16+
endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Config file of MTK performance feature.
2+
3+
4+
WHAT IT DOES?
5+
=============
6+
perfservapplist.txt lists application white list.
7+
Use this config file can force more cpu online.
8+
9+
HOW IT WAS BUILT?
10+
==================
11+
N/A
12+
13+
HOW TO USE IT?
14+
==============
15+
Set application package name and its own cpu number.
16+
17+
All the source code of this library were written by MediaTek co..
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
3+
<WHITELIST>
4+
<PerfService>
5+
<Package name="com.imangi.templerun2">
6+
<Activity name="Common">
7+
<CMD_SET_CPU_CORE_MIN Param1="3"/>
8+
</Activity>
9+
</Package>
10+
<Package name="com.tencent.tmgp.sgame">
11+
<Activity name="Common">
12+
<CMD_SET_PACK_BOOST_TIMEOUT Param1="25"/>
13+
<CMD_SET_FSTB_FPS Param1="60" Param2="30"/>
14+
</Activity>
15+
</Package>
16+
<Package name="com.gameloft.android.ANMP.GloftA8HM">
17+
<Activity name="Common">
18+
<CMD_SET_FSTB_FPS Param1="30" Param2="30"/>
19+
</Activity>
20+
</Package>
21+
<Package name="com.happyelements.AndroidAnimal.qq">
22+
<Activity name="Common">
23+
<CMD_SET_FSTB_FPS Param1="50" Param2="26"/>
24+
</Activity>
25+
</Package>
26+
<Package name="com.andromeda.androbench2">
27+
<Activity name="Common">
28+
<CMD_SET_SPORTS_MODE Param1="1"/>
29+
</Activity>
30+
</Package>
31+
<Package name="com.futuremark.pcmark.android.benchmark">
32+
<Activity name="Common">
33+
<CMD_SET_SPORTS_MODE Param1="1"/>
34+
</Activity>
35+
</Package>
36+
<Package name="com.antutu.ABenchMark">
37+
<Activity name="Common">
38+
<CMD_SET_SPORTS_MODE Param1="1"/>
39+
</Activity>
40+
</Package>
41+
<Package name="com.primatelabs.geekbench">
42+
<Activity name="Common">
43+
<CMD_SET_SPORTS_MODE Param1="1"/>
44+
</Activity>
45+
</Package>
46+
<Package name="com.aurorasoftworks.quadrant.ui.professional">
47+
<Activity name="Common">
48+
<CMD_SET_SPORTS_MODE Param1="1"/>
49+
</Activity>
50+
</Package>
51+
<Package name="com.aurorasoftworks.quadrant.ui.advanced">
52+
<Activity name="Common">
53+
<CMD_SET_SPORTS_MODE Param1="1"/>
54+
</Activity>
55+
</Package>
56+
<Package name="com.ludashi.benchmark">
57+
<Activity name="Common">
58+
<CMD_SET_SPORTS_MODE Param1="1"/>
59+
</Activity>
60+
</Package>
61+
</PerfService>
62+
</WHITELIST>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
ifeq ($(MTK_PERFSERVICE_SUPPORT), yes)
2+
3+
LOCAL_PATH := $(call my-dir)
4+
include $(CLEAR_VARS)
5+
6+
# Module name should match library/file name to be installed.
7+
LOCAL_MODULE := perfservboosttbl.txt
8+
LOCAL_PROPRIETARY_MODULE := true
9+
LOCAL_MODULE_OWNER := mtk
10+
LOCAL_MODULE_TAGS := optional
11+
LOCAL_SRC_FILES := $(LOCAL_MODULE)
12+
# set class according to lib/file attribute
13+
LOCAL_MODULE_CLASS := ETC
14+
include $(BUILD_PREBUILT)
15+
16+
endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Config file of MTK performance feature.
2+
3+
4+
WHAT IT DOES?
5+
=============
6+
perfservboosttbl.txt lists process name.
7+
Use this config file can change schedule policy of specific process.
8+
9+
HOW IT WAS BUILT?
10+
==================
11+
N/A
12+
13+
HOW TO USE IT?
14+
==============
15+
Set process name and its own schedule policy.
16+
17+
All the source code of this library were written by MediaTek co..
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CMD_SET_BOOST_PROCESS_PID, audioserver, usb_call_dl, SETFUNC_RT_RR, 1
2+
CMD_SET_BOOST_PROCESS_PID, audioserver, usb_call_ul, SETFUNC_RT_RR, 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
ifeq ($(MTK_PERFSERVICE_SUPPORT), yes)
2+
3+
LOCAL_PATH := $(call my-dir)
4+
include $(CLEAR_VARS)
5+
6+
# Module name should match library/file name to be installed.
7+
LOCAL_MODULE := perfcontable.txt
8+
LOCAL_PROPRIETARY_MODULE := true
9+
LOCAL_MODULE_OWNER := mtk
10+
LOCAL_MODULE_TAGS := optional
11+
LOCAL_SRC_FILES := $(LOCAL_MODULE)
12+
# set class according to lib/file attribute
13+
LOCAL_MODULE_CLASS := ETC
14+
include $(BUILD_PREBUILT)
15+
16+
endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
Config file of MTK performance feature.
2+
3+
4+
WHAT IT DOES?
5+
=============
6+
perfcontable.txt is a feature to add new items to control drivers using PerfService.
7+
User can add control item into this table to do performance tuning
8+
9+
HOW IT WAS BUILT?
10+
==================
11+
N/A
12+
13+
HOW TO USE IT?
14+
==============
15+
Please fill in each line in perfcontable.txt with
16+
cmd name, cmd ID, entry, compare, max value, min value, normal value, sport value
17+
18+
1. cmd name:
19+
this command can be used by perfservscntbl.txt and perfservapplist.txt
20+
2. cmd id:
21+
cmd id can be used by useregister scenario in native and framework space
22+
CMD NAME AND CMD ID IS 1-1 MAPPING, PLEASE CHECK IF IT WILL RUIN THE CMDS IN perfservice_types.h
23+
3. entry:
24+
sysfs or procfs to control
25+
4. compare:
26+
less--> small value has higher priority
27+
more--> big value has higher priority
28+
5. max value:
29+
maximun value that driver support
30+
6. min value:
31+
minimun value that driver support
32+
7. normal value(option):
33+
normal mode default setting. System will use the boot value in the entry(3.) if user not fill in.
34+
8. sport value(option):
35+
sport mode default setting. System will use the boot value in the entry(3.) if user not fill in.
36+
37+
38+
All the source code of this library were written by MediaTek co..
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#CAUTION:
2+
#CMD NAME AND CMD ID IS 1-1 MAPPING, PLEASE CHECK IF IT WILL RUIN THE CMDS IN perfservice_types.h
3+
#
4+
#cmd name, cmd ID, entry, compare, max value, min value, normal value, sport value
5+
CMD_SET_CPUFREQ_HISPEED_FREQ, 12, /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq, more, 2340000, 0
6+
CMD_SET_CPUFREQ_MIN_SAMPLE_TIME, 13, /sys/devices/system/cpu/cpufreq/interactive/min_sample_time, more, 800000, 0
7+
CMD_SET_CPUFREQ_ABOVE_HISPEED_DELAY, 14, /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay, less, 200000, 0
8+
CMD_SET_ROOT_CLUSTER, 19, /proc/ppm/root_cluster, more, 2, -1
9+
CMD_SET_CPU_UP_THRESHOLD, 20, /proc/hps/up_threshold, less, 100, 0, 95, 80
10+
CMD_SET_CPU_DOWN_THRESHOLD, 21, /proc/hps/down_threshold, less, 100, 0, 85, 60
11+
CMD_SET_VCORE_BW_THRES, 45, /proc/fliperfs/cg_threshold, less, 12800, 400, 4000, 500
12+
CMD_SET_VCORE_BW_ENABLED, 46, /proc/fliperfs/cg_enable, more, 1, 0, 1, 1
13+
CMD_SET_VCORE_MIN, 47, /proc/fliperfs/perf, less, 3, 0, -1, 0
14+
CMD_SET_FG_BOOST_VALUE, 50, /proc/perfmgr/eas/perfserv_fg_boost, more, 3000, -100
15+
CMD_SET_STUNE_THRESH, 51, /sys/devices/system/cpu/eas/stune_task_thresh, less, 100, 0
16+
CMD_SET_RBOOST_THRESH, 54, /proc/hps/rush_boost_threshold, less, 0, 100, 98, 90
17+
CMD_SET_PPM_LL_to_ALL_CAP_HOLD_TIME, 55, /proc/ppm/policy/hica_settings/LL_ONLY_to_ALL/capacity_hold_time, less, 1, 5, 4, 1
18+
CMD_SET_SCHED_MODE, 56, /sys/devices/system/cpu/eas/enable, less, 2, 0, 2
19+
CMD_SET_GED_BENCHMARK_ON, 57, /sys/module/ged/parameters/gx_3D_benchmark_on, more, 1, 0, 0, 1
20+
CMD_SET_GX_BOOST, 58, /sys/module/ged/parameters/gx_force_cpu_boost, more, 1, 0, 0, 0
21+
CMD_SET_ROOT_BOOST_VALUE, 60, /dev/stune/schedtune.boost, more, 100, 0, 0, 0
22+
CMD_SET_TA_BOOST_VALUE, 62, /proc/perfmgr/eas/perfserv_ta_boost, more, 3000, -100, 0, 100
23+
CMD_SET_BG_BOOST_VALUE, 63, /proc/perfmgr/eas/perfserv_bg_boost, more, 3000, -100
24+
CMD_SET_SMART_FORCE_ISOLATE, 64, /proc/perfmgr/smart/smart_force_isolate, more, 1, 0
25+
CMD_SET_FPSGO_ENABLE, 65, /sys/kernel/debug/fpsgo/common/fpsgo_game_enable, less, 1, 0, 1, 0
26+
CMD_SET_FBT_SWITCH, 66, /proc/fbt_cpu/switch_fbt, more, 1, 0, 1
27+
CMD_SET_SCHED_LB_ENABLE, 68, /sys/devices/system/cpu/sched/lb_enhance_enable, more, 1, 0
28+
CMD_SET_FSTB_FORCE_VAG, 71, /sys/kernel/debug/fpsgo/fstb/fstb_tune_force_vag, more, 1, 0, 0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
ifeq ($(MTK_PERFSERVICE_SUPPORT), yes)
2+
3+
LOCAL_PATH := $(call my-dir)
4+
include $(CLEAR_VARS)
5+
6+
# Module name should match library/file name to be installed.
7+
LOCAL_MODULE := perfservscntbl.txt
8+
LOCAL_PROPRIETARY_MODULE := true
9+
LOCAL_MODULE_OWNER := mtk
10+
LOCAL_MODULE_TAGS := optional
11+
LOCAL_SRC_FILES := $(LOCAL_MODULE)
12+
# set class according to lib/file attribute
13+
LOCAL_MODULE_CLASS := ETC
14+
include $(BUILD_PREBUILT)
15+
16+
endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Config file of MTK performance feature.
2+
3+
4+
WHAT IT DOES?
5+
=============
6+
perfservscntbl.txt lists scenario config.
7+
Use this config file can customize scenario setting.
8+
9+
HOW IT WAS BUILT?
10+
==================
11+
N/A
12+
13+
HOW TO USE IT?
14+
==============
15+
Set scenario and its own setting.
16+
17+
All the source code of this library were written by MediaTek co..
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
CMD_SET_SCN_VALID, SCN_SW_FRAME_UPDATE, 0
2+
CMD_SET_CLUSTER_CPU_CORE_MIN, SCN_APP_SWITCH, 0, 4
3+
CMD_SET_CLUSTER_CPU_FREQ_MIN, SCN_APP_SWITCH, 0, 3000000
4+
CMD_SET_TA_BOOST_VALUE, SCN_APP_SWITCH, 1100
5+
CMD_SET_CLUSTER_CPU_CORE_MIN, SCN_PACKAGE_SWITCH, 0, 4
6+
CMD_SET_CLUSTER_CPU_FREQ_MIN, SCN_PACKAGE_SWITCH, 0, 3000000
7+
CMD_SET_VCORE_MIN, SCN_PACKAGE_SWITCH, 0
8+
CMD_SET_TA_BOOST_VALUE, SCN_PACKAGE_SWITCH, 1100
9+
CMD_SET_PPM_LIMIT_BIG_FREQ, SCN_PACKAGE_SWITCH, 0
10+
CMD_SET_CLUSTER_CPU_CORE_MIN, SCN_PROCESS_CREATE, 0, 4
11+
CMD_SET_CLUSTER_CPU_FREQ_MIN, SCN_PROCESS_CREATE, 0, 3000000
12+
CMD_SET_VCORE_MIN, SCN_PROCESS_CREATE, 0
13+
CMD_SET_TA_BOOST_VALUE, SCN_PROCESS_CREATE, 1100
14+
CMD_SET_PPM_LIMIT_BIG_FREQ, SCN_PROCESS_CREATE, 0
15+
CMD_SET_CLUSTER_CPU_CORE_MIN, SCN_APP_LAUNCH, 0, 4
16+
CMD_SET_CLUSTER_CPU_FREQ_MIN, SCN_APP_LAUNCH, 0, 3000000
17+
CMD_SET_VCORE_MIN, SCN_APP_LAUNCH, 0
18+
CMD_SET_TA_BOOST_VALUE, SCN_APP_LAUNCH, 1100
19+
CMD_SET_FPSGO_ENABLE, SCN_APP_LAUNCH, 0
20+
CMD_SET_CLUSTER_CPU_CORE_MIN, SCN_APP_INSTALL, 0, 4
21+
CMD_SET_CLUSTER_CPU_FREQ_MIN, SCN_APP_INSTALL, 0, 3000000
22+
CMD_SET_VCORE_MIN, SCN_APP_INSTALL, 0
23+
CMD_SET_TA_BOOST_VALUE, SCN_APP_INSTALL, 1100
24+
CMD_SET_FPSGO_ENABLE, SCN_APP_INSTALL, 0
25+
CMD_SET_CLUSTER_CPU_CORE_MIN, SCN_APP_ROTATE, 0, 4
26+
CMD_SET_CLUSTER_CPU_FREQ_MIN, SCN_APP_ROTATE, 0, 3000000
27+
CMD_SET_VCORE_MIN, SCN_APP_ROTATE, 0
28+
CMD_SET_TA_BOOST_VALUE, SCN_APP_ROTATE, 1100
29+
CMD_SET_CLUSTER_CPU_CORE_MIN, SCN_GAME_LAUNCH, 0, 4
30+
CMD_SET_CLUSTER_CPU_FREQ_MIN, SCN_GAME_LAUNCH, 0, 3000000
31+
CMD_SET_VCORE_MIN, SCN_GAME_LAUNCH, 0
32+
CMD_SET_TA_BOOST_VALUE, SCN_GAME_LAUNCH, 1100
33+
CMD_SET_PPM_LIMIT_BIG_FREQ, SCN_GAME_LAUNCH, 0
34+
CMD_SET_FPSGO_ENABLE, SCN_GAME_LAUNCH, 0
35+
CMD_SET_CLUSTER_CPU_CORE_MIN, SCN_GALLERY_BOOST, 0, 4
36+
CMD_SET_CLUSTER_CPU_FREQ_MIN, SCN_GALLERY_BOOST, 0, 3000000
37+
CMD_SET_TA_BOOST_VALUE, SCN_GALLERY_BOOST, 1100
38+
CMD_SET_GX_BOOST, SCN_GLSURFACE, 1
39+
CMD_SET_SCN_VALID, SCN_GLSURFACE, 1
40+
CMD_SET_CLUSTER_CPU_CORE_MIN, SCN_SP_MODE, 0, 0
41+
CMD_SET_CLUSTER_CPU_CORE_MIN, SCN_VR_MODE, 0, 0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright 2005 The Android Open Source Project
2+
3+
LOCAL_PATH:= $(call my-dir)
4+
include $(CLEAR_VARS)
5+
6+
LOCAL_SRC_FILES := \
7+
perf_native_test.cpp
8+
9+
#LOCAL_FORCE_STATIC_EXECUTABLE := true
10+
LOCAL_C_INCLUDES += $(MTK_PATH_SOURCE)/hardware/perfservice/perfservicenative
11+
LOCAL_SHARED_LIBRARIES += libc libdl libcutils
12+
LOCAL_MODULE := perf_native_test
13+
LOCAL_PROPRIETARY_MODULE := true
14+
LOCAL_MODULE_OWNER := mtk
15+
16+
LOCAL_MODULE_TAGS := eng
17+
include $(MTK_EXECUTABLE)
18+
19+
#$(call dist-for-goals,dist_files,$(LOCAL_BUILT_MODULE))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Test program of MTK performance feature.
2+
3+
This binary is pre-built by MediaTek internal.
4+
5+
6+
WHAT IT DOES?
7+
=============
8+
perf_native_test contains test program for libperfservice.so.
9+
It can also dump so debug information.
10+
11+
HOW IT WAS BUILT?
12+
==================
13+
It needs the following libs from AOSP:
14+
1. libc.so
15+
2. libdl.so
16+
17+
and the following libs from MediaTek:
18+
1. libperfservicenative.so
19+
20+
HOW TO USE IT?
21+
==============
22+
Refer to online usage manual
23+
24+
All the source code of this library were written by MediaTek co..

0 commit comments

Comments
 (0)