From cffce96c189f7599fbd4338ef6d0b138a24e8a6f Mon Sep 17 00:00:00 2001 From: Wook Song Date: Wed, 8 Feb 2017 15:12:44 +0900 Subject: [PATCH 01/16] pass-hal: tm2: Add implementation of HAL for BUS This patch adds an implementation of the PASS HAL for BUS. Change-Id: Idf118b9df51c0fad13e0d5db8d1ff58a541a7aab Signed-off-by: Wook Song --- CMakeLists.txt | 1 + src/bus/CMakeLists.txt | 24 ++++++ src/bus/bus.c | 230 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 255 insertions(+) create mode 100644 src/bus/CMakeLists.txt create mode 100644 src/bus/bus.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 116648e..92efed1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,3 +16,4 @@ SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(DEST_DIR ${LIB_INSTALL_DIR}/pass) ADD_SUBDIRECTORY(src/cpu) +ADD_SUBDIRECTORY(src/bus) diff --git a/src/bus/CMakeLists.txt b/src/bus/CMakeLists.txt new file mode 100644 index 0000000..2bca621 --- /dev/null +++ b/src/bus/CMakeLists.txt @@ -0,0 +1,24 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +PROJECT(bus C) + +INCLUDE(FindPkgConfig) +pkg_check_modules(pkgs REQUIRED dlog glib-2.0) + +#HAL version +string(REPLACE "." ";" HAL_VERSION_LIST ${HAL_VERSION}) +list(GET HAL_VERSION_LIST 0 HAL_VERSION_MAJOR) +list(GET HAL_VERSION_LIST 1 HAL_VERSION_MINOR) +list(GET HAL_VERSION_LIST 2 HAL_VERSION_REVISION) +list(GET HAL_VERSION_LIST 3 HAL_VERSION_RELEASE) +add_definitions(-DVER_MAJOR=${HAL_VERSION_MAJOR} -DVER_MINOR=${HAL_VERSION_MINOR}) +add_definitions(-DVER_REVISION=${HAL_VERSION_REVISION} -DVER_RELEASE=${HAL_VERSION_RELEASE}) + +SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") + +SET(SRCS ${PROJECT_NAME}.c + ../shared/sysfs.c) + +ADD_LIBRARY(${PROJECT_NAME} MODULE ${SRCS}) +SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES PREFIX "") +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${DEST_DIR} COMPONENT RuntimeLibraries) diff --git a/src/bus/bus.c b/src/bus/bus.c new file mode 100644 index 0000000..b9d8c95 --- /dev/null +++ b/src/bus/bus.c @@ -0,0 +1,230 @@ +#include +#include +#include +#include +#include +#include +#include + +#include "../shared/sysfs.h" + +/* TODO: Version! */ +#define HAL_VERSION MAKE_2B_CODE_4(VER_MAJOR,VER_MINOR,VER_REVISION,VER_RELEASE) +#define DEV_VERSION_BUS MAKE_2B_CODE_2(1,0) + +#define DEVFREQ_BUS_PATH_PREFIX "/sys/devices/platform/soc/" +#define DEVFREQ_BUS_PATH_INFIX "/devfreq/" +#define DEVFREQ_BUS_CURR_GOVERNOR_PATH_SUFFIX "/governor" +#define DEVFREQ_BUS_CURR_FREQ_PATH_SUFFIX "/cur_freq" +#define DEVFREQ_BUS_MIN_FREQ_PATH_SUFFIX "/min_freq" +#define DEVFREQ_BUS_MAX_FREQ_PATH_SUFFIX "/max_freq" + +static int tm2_dvfs_get_curr_governor(char *res_name, char *governor) +{ + char path[PATH_MAX]; + int ret; + + if ((!res_name) || (!governor)) + return -EINVAL; + + snprintf(path, PATH_MAX, "%s%s%s%s%s", + DEVFREQ_BUS_PATH_PREFIX, + res_name, + DEVFREQ_BUS_PATH_INFIX, + res_name, + DEVFREQ_BUS_CURR_GOVERNOR_PATH_SUFFIX); + + ret = sysfs_read_str(path, governor, BUFF_MAX); + if (ret < 0) + return ret; + + return 0; +} + +static int tm2_dvfs_set_curr_governor(char *res_name, char *governor) +{ + char path[PATH_MAX]; + int ret; + + if ((!res_name) || (!governor)) + return -EINVAL; + + snprintf(path, PATH_MAX, "%s%s%s%s%s", + DEVFREQ_BUS_PATH_PREFIX, + res_name, + DEVFREQ_BUS_PATH_INFIX, + res_name, + DEVFREQ_BUS_CURR_GOVERNOR_PATH_SUFFIX); + + ret = sysfs_write_str(path, governor); + if (ret < 0) + return ret; + + return 0; +} + +static int tm2_dvfs_get_curr_freq(char *res_name) +{ + char path[PATH_MAX]; + int freq, ret; + + if (!res_name) + return -EINVAL; + + snprintf(path, PATH_MAX, "%s%s%s%s%s", + DEVFREQ_BUS_PATH_PREFIX, + res_name, + DEVFREQ_BUS_PATH_INFIX, + res_name, + DEVFREQ_BUS_CURR_FREQ_PATH_SUFFIX); + + ret = sysfs_read_int(path, &freq); + if (ret < 0) + return ret; + + return freq; +} + +static int tm2_dvfs_get_min_freq(char *res_name) +{ + char path[PATH_MAX]; + int freq, ret; + + if (!res_name) + return -EINVAL; + + snprintf(path, PATH_MAX, "%s%s%s%s%s", + DEVFREQ_BUS_PATH_PREFIX, + res_name, + DEVFREQ_BUS_PATH_INFIX, + res_name, + DEVFREQ_BUS_MIN_FREQ_PATH_SUFFIX); + + ret = sysfs_read_int(path, &freq); + if (ret < 0) + return ret; + + return freq; +} + +static int tm2_dvfs_set_min_freq(char *res_name, int freq) +{ + char path[PATH_MAX]; + int ret; + + if ((!res_name) || (freq < 0)) + return -EINVAL; + + snprintf(path, PATH_MAX, "%s%s%s%s%s", + DEVFREQ_BUS_PATH_PREFIX, + res_name, + DEVFREQ_BUS_PATH_INFIX, + res_name, + DEVFREQ_BUS_MIN_FREQ_PATH_SUFFIX); + + ret = sysfs_write_int(path, freq); + if (ret < 0) + return ret; + + return 0; +} + +static int tm2_dvfs_get_max_freq(char *res_name) +{ + char path[PATH_MAX]; + int freq, ret; + + if (!res_name) + return -EINVAL; + + snprintf(path, PATH_MAX, "%s%s%s%s%s", + DEVFREQ_BUS_PATH_PREFIX, + res_name, + DEVFREQ_BUS_PATH_INFIX, + res_name, + DEVFREQ_BUS_MAX_FREQ_PATH_SUFFIX); + + ret = sysfs_read_int(path, &freq); + if (ret < 0) + return ret; + + return freq; +} + +static int tm2_dvfs_set_max_freq(char *res_name, int freq) +{ + char path[PATH_MAX]; + int ret; + + if ((!res_name) || (freq < 0)) + return -EINVAL; + + snprintf(path, PATH_MAX, "%s%s%s%s%s", + DEVFREQ_BUS_PATH_PREFIX, + res_name, + DEVFREQ_BUS_PATH_INFIX, + res_name, + DEVFREQ_BUS_MAX_FREQ_PATH_SUFFIX); + + ret = sysfs_write_int(path, freq); + if (ret < 0) + return ret; + return 0; +} + + +static struct pass_resource_dvfs_ops tm2_bus_dvfs_ops = { + .get_curr_governor = tm2_dvfs_get_curr_governor, + .set_curr_governor = tm2_dvfs_set_curr_governor, + .get_avail_governor = NULL, + .get_curr_freq = tm2_dvfs_get_curr_freq, + .get_min_freq = tm2_dvfs_get_min_freq, + .set_min_freq = tm2_dvfs_set_min_freq, + .get_max_freq = tm2_dvfs_get_max_freq, + .set_max_freq = tm2_dvfs_set_max_freq, + .get_up_threshold = NULL, + .set_up_threshold = NULL, + .get_load_table = NULL, +}; + +static int tm2_bus_open(struct pass_resource_info *info, + struct pass_resource_common **common) +{ + struct pass_resource_bus *bus_res; + + if (!info) + return -EINVAL; + + /* TODO: Possibility of a memory leak */ + bus_res = calloc(1, sizeof(struct pass_resource_bus)); + if (!bus_res) + return -ENOMEM; + + bus_res->common.info = info; + bus_res->dvfs = tm2_bus_dvfs_ops; + + *common = (struct pass_resource_common *) bus_res; + + return 0; +} + +static int tm2_bus_close(struct pass_resource_common *common) +{ + if (!common) + return -EINVAL; + + free(common); + + return 0; +} + +HAL_MODULE_STRUCTURE = { + .magic = HAL_INFO_TAG, + .hal_version = HAL_VERSION, + .device_version = DEV_VERSION_BUS, + .id = PASS_RESOURCE_BUS_ID, + .name = PASS_RESOURCE_BUS_NAME, + .author = "Wook Song ", + .open = tm2_bus_open, + .close = tm2_bus_close, +}; -- 2.7.4 From a89a42404931ddc6a28fa2ea68beff3d7b57068a Mon Sep 17 00:00:00 2001 From: Wook Song Date: Wed, 8 Feb 2017 15:26:18 +0900 Subject: [PATCH 02/16] pass-hal: tm2: Add implementation of HAL for GPU This patch adds an implementation of the PASS HAL for GPU. Change-Id: I1002bcce81c7ff35ef46ab09ceaed27a255a5611 Signed-off-by: Wook Song --- CMakeLists.txt | 1 + src/gpu/CMakeLists.txt | 24 +++++ src/gpu/gpu.c | 283 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 308 insertions(+) create mode 100644 src/gpu/CMakeLists.txt create mode 100644 src/gpu/gpu.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 92efed1..e9131cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,3 +17,4 @@ SET(DEST_DIR ${LIB_INSTALL_DIR}/pass) ADD_SUBDIRECTORY(src/cpu) ADD_SUBDIRECTORY(src/bus) +ADD_SUBDIRECTORY(src/gpu) diff --git a/src/gpu/CMakeLists.txt b/src/gpu/CMakeLists.txt new file mode 100644 index 0000000..4425ca0 --- /dev/null +++ b/src/gpu/CMakeLists.txt @@ -0,0 +1,24 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +PROJECT(gpu C) + +INCLUDE(FindPkgConfig) +pkg_check_modules(pkgs REQUIRED dlog glib-2.0) + +#HAL version +string(REPLACE "." ";" HAL_VERSION_LIST ${HAL_VERSION}) +list(GET HAL_VERSION_LIST 0 HAL_VERSION_MAJOR) +list(GET HAL_VERSION_LIST 1 HAL_VERSION_MINOR) +list(GET HAL_VERSION_LIST 2 HAL_VERSION_REVISION) +list(GET HAL_VERSION_LIST 3 HAL_VERSION_RELEASE) +add_definitions(-DVER_MAJOR=${HAL_VERSION_MAJOR} -DVER_MINOR=${HAL_VERSION_MINOR}) +add_definitions(-DVER_REVISION=${HAL_VERSION_REVISION} -DVER_RELEASE=${HAL_VERSION_RELEASE}) + +SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") + +SET(SRCS ${PROJECT_NAME}.c + ../shared/sysfs.c) + +ADD_LIBRARY(${PROJECT_NAME} MODULE ${SRCS}) +SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES PREFIX "") +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${DEST_DIR} COMPONENT RuntimeLibraries) diff --git a/src/gpu/gpu.c b/src/gpu/gpu.c new file mode 100644 index 0000000..28a8ffd --- /dev/null +++ b/src/gpu/gpu.c @@ -0,0 +1,283 @@ +#include +#include +#include +#include +#include +#include +#include + +#include "../shared/sysfs.h" + +/* TODO: Version! */ +#define HAL_VERSION MAKE_2B_CODE_4(VER_MAJOR,VER_MINOR,VER_REVISION,VER_RELEASE) +#define DEV_VERSION_GPU MAKE_2B_CODE_2(1,0) + +#define DEVFREQ_GPU_PATH_PREFIX "/sys/devices/platform/soc/" +#define DEVFREQ_GPU_PATH_INFIX "/devfreq/" +#define DEVFREQ_GPU_CURR_GOVERNOR_PATH_SUFFIX "/governor" +#define DEVFREQ_GPU_CURR_FREQ_PATH_SUFFIX "/cur_freq" +#define DEVFREQ_GPU_MIN_FREQ_PATH_SUFFIX "/min_freq" +#define DEVFREQ_GPU_MAX_FREQ_PATH_SUFFIX "/max_freq" + +#define TMU_PATH_PREFIX "/sys/class/thermal/thermal_zone" +#define TMU_TEMP_PATH_SUFFIX "/temp" +#define TMU_POLICY_PATH_SUFFIX "/policy" + +#define TM2_GPU_THERMAL_ZONE_NUM 2 + +static int tm2_dvfs_get_curr_governor(char *res_name, char *governor) +{ + char path[PATH_MAX]; + int ret; + + if ((!res_name) || (!governor)) + return -EINVAL; + + snprintf(path, PATH_MAX, "%s%s%s%s%s", + DEVFREQ_GPU_PATH_PREFIX, + res_name, + DEVFREQ_GPU_PATH_INFIX, + res_name, + DEVFREQ_GPU_CURR_GOVERNOR_PATH_SUFFIX); + + ret = sysfs_read_str(path, governor, BUFF_MAX); + if (ret < 0) + return ret; + + return 0; +} + +static int tm2_dvfs_set_curr_governor(char *res_name, char *governor) +{ + char path[PATH_MAX]; + int ret; + + if ((!res_name) || (!governor)) + return -EINVAL; + + snprintf(path, PATH_MAX, "%s%s%s%s%s", + DEVFREQ_GPU_PATH_PREFIX, + res_name, + DEVFREQ_GPU_PATH_INFIX, + res_name, + DEVFREQ_GPU_CURR_GOVERNOR_PATH_SUFFIX); + + ret = sysfs_write_str(path, governor); + if (ret < 0) + return ret; + + return 0; +} + +static int tm2_dvfs_get_curr_freq(char *res_name) +{ + char path[PATH_MAX]; + int freq, ret; + + if (!res_name) + return -EINVAL; + + snprintf(path, PATH_MAX, "%s%s%s%s%s", + DEVFREQ_GPU_PATH_PREFIX, + res_name, + DEVFREQ_GPU_PATH_INFIX, + res_name, + DEVFREQ_GPU_CURR_FREQ_PATH_SUFFIX); + + ret = sysfs_read_int(path, &freq); + if (ret < 0) + return ret; + + return freq; +} + +static int tm2_dvfs_get_min_freq(char *res_name) +{ + char path[PATH_MAX]; + int freq, ret; + + if (!res_name) + return -EINVAL; + + snprintf(path, PATH_MAX, "%s%s%s%s%s", + DEVFREQ_GPU_PATH_PREFIX, + res_name, + DEVFREQ_GPU_PATH_INFIX, + res_name, + DEVFREQ_GPU_MIN_FREQ_PATH_SUFFIX); + + ret = sysfs_read_int(path, &freq); + if (ret < 0) + return ret; + + return freq; +} + +static int tm2_dvfs_set_min_freq(char *res_name, int freq) +{ + char path[PATH_MAX]; + int ret; + + if ((!res_name) || (freq < 0)) + return -EINVAL; + + snprintf(path, PATH_MAX, "%s%s%s%s%s", + DEVFREQ_GPU_PATH_PREFIX, + res_name, + DEVFREQ_GPU_PATH_INFIX, + res_name, + DEVFREQ_GPU_MIN_FREQ_PATH_SUFFIX); + + ret = sysfs_write_int(path, freq); + if (ret < 0) + return ret; + + return 0; +} + +static int tm2_dvfs_get_max_freq(char *res_name) +{ + char path[PATH_MAX]; + int freq, ret; + + if (!res_name) + return -EINVAL; + + snprintf(path, PATH_MAX, "%s%s%s%s%s", + DEVFREQ_GPU_PATH_PREFIX, + res_name, + DEVFREQ_GPU_PATH_INFIX, + res_name, + DEVFREQ_GPU_MAX_FREQ_PATH_SUFFIX); + + ret = sysfs_read_int(path, &freq); + if (ret < 0) + return ret; + + return freq; +} + +static int tm2_dvfs_set_max_freq(char *res_name, int freq) +{ + char path[PATH_MAX]; + int ret; + + if ((!res_name) || (freq < 0)) + return -EINVAL; + + snprintf(path, PATH_MAX, "%s%s%s%s%s", + DEVFREQ_GPU_PATH_PREFIX, + res_name, + DEVFREQ_GPU_PATH_INFIX, + res_name, + DEVFREQ_GPU_MAX_FREQ_PATH_SUFFIX); + + ret = sysfs_write_int(path, freq); + if (ret < 0) + return ret; + return 0; +} + + +static struct pass_resource_dvfs_ops tm2_gpu_dvfs_ops = { + .get_curr_governor = tm2_dvfs_get_curr_governor, + .set_curr_governor = tm2_dvfs_set_curr_governor, + .get_avail_governor = NULL, + .get_curr_freq = tm2_dvfs_get_curr_freq, + .get_min_freq = tm2_dvfs_get_min_freq, + .set_min_freq = tm2_dvfs_set_min_freq, + .get_max_freq = tm2_dvfs_get_max_freq, + .set_max_freq = tm2_dvfs_set_max_freq, + .get_up_threshold = NULL, + .set_up_threshold = NULL, + .get_load_table = NULL, +}; + +static int tm2_tmu_get_temp(char *res_name) +{ + char path[PATH_MAX]; + int temp; + int ret; + + if (!res_name) + return -EINVAL; + + snprintf(path, PATH_MAX, "%s%d%s", + TMU_PATH_PREFIX, + TM2_GPU_THERMAL_ZONE_NUM, + TMU_TEMP_PATH_SUFFIX); + + ret = sysfs_read_int(path, &temp); + if (ret < 0) + return ret; + + return temp; +} + +static int tm2_tmu_get_policy(char *res_name, char *policy) +{ + char path[PATH_MAX]; + int ret; + + if ((!res_name) || (!policy)) + return -EINVAL; + + snprintf(path, PATH_MAX, "%s%d%s", + TMU_PATH_PREFIX, + TM2_GPU_THERMAL_ZONE_NUM, + TMU_POLICY_PATH_SUFFIX); + + ret = sysfs_read_str(path, policy, BUFF_MAX); + if (ret < 0) + return ret; + + return 0; +} + +static struct pass_resource_tmu_ops tm2_gpu_tmu_ops = { + .get_temp = tm2_tmu_get_temp, + .get_policy = tm2_tmu_get_policy, +}; + +static int tm2_gpu_open(struct pass_resource_info *info, + struct pass_resource_common **common) +{ + struct pass_resource_gpu *gpu_res; + + if (!info) + return -EINVAL; + + /* TODO: Possibility of a memory leak */ + gpu_res = calloc(1, sizeof(struct pass_resource_gpu)); + if (!gpu_res) + return -ENOMEM; + + gpu_res->common.info = info; + gpu_res->dvfs = tm2_gpu_dvfs_ops; + gpu_res->tmu = tm2_gpu_tmu_ops; + + *common = (struct pass_resource_common *) gpu_res; + + return 0; +} + +static int tm2_gpu_close(struct pass_resource_common *common) +{ + if (!common) + return -EINVAL; + + free(common); + + return 0; +} + +HAL_MODULE_STRUCTURE = { + .magic = HAL_INFO_TAG, + .hal_version = HAL_VERSION, + .device_version = DEV_VERSION_GPU, + .id = PASS_RESOURCE_GPU_ID, + .name = PASS_RESOURCE_GPU_NAME, + .author = "Wook Song ", + .open = tm2_gpu_open, + .close = tm2_gpu_close, +}; -- 2.7.4 From 42d0c4fb6b84b4275cb931473723f04ce21abe16 Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Thu, 9 Feb 2017 18:52:25 +0900 Subject: [PATCH 03/16] pass-hal: tm2: Modify the sysfs path for BUS/GPU resource This patches modifes the default sysfs path for bus/gpu resource as following: Because TM2 uses the devfreq subsystem in Linux Kernel for memory bus and gpu. - /sys/class/devfreq/(devfreq device name) Signed-off-by: Chanwoo Choi --- src/bus/bus.c | 31 ++++++++----------------------- src/gpu/gpu.c | 31 ++++++++----------------------- 2 files changed, 16 insertions(+), 46 deletions(-) diff --git a/src/bus/bus.c b/src/bus/bus.c index b9d8c95..e4c7bbf 100644 --- a/src/bus/bus.c +++ b/src/bus/bus.c @@ -12,8 +12,7 @@ #define HAL_VERSION MAKE_2B_CODE_4(VER_MAJOR,VER_MINOR,VER_REVISION,VER_RELEASE) #define DEV_VERSION_BUS MAKE_2B_CODE_2(1,0) -#define DEVFREQ_BUS_PATH_PREFIX "/sys/devices/platform/soc/" -#define DEVFREQ_BUS_PATH_INFIX "/devfreq/" +#define DEVFREQ_BUS_PATH_PREFIX "/sys/class/devfreq/" #define DEVFREQ_BUS_CURR_GOVERNOR_PATH_SUFFIX "/governor" #define DEVFREQ_BUS_CURR_FREQ_PATH_SUFFIX "/cur_freq" #define DEVFREQ_BUS_MIN_FREQ_PATH_SUFFIX "/min_freq" @@ -27,11 +26,9 @@ static int tm2_dvfs_get_curr_governor(char *res_name, char *governor) if ((!res_name) || (!governor)) return -EINVAL; - snprintf(path, PATH_MAX, "%s%s%s%s%s", + snprintf(path, PATH_MAX, "%s%s%s", DEVFREQ_BUS_PATH_PREFIX, res_name, - DEVFREQ_BUS_PATH_INFIX, - res_name, DEVFREQ_BUS_CURR_GOVERNOR_PATH_SUFFIX); ret = sysfs_read_str(path, governor, BUFF_MAX); @@ -49,11 +46,9 @@ static int tm2_dvfs_set_curr_governor(char *res_name, char *governor) if ((!res_name) || (!governor)) return -EINVAL; - snprintf(path, PATH_MAX, "%s%s%s%s%s", + snprintf(path, PATH_MAX, "%s%s%s", DEVFREQ_BUS_PATH_PREFIX, res_name, - DEVFREQ_BUS_PATH_INFIX, - res_name, DEVFREQ_BUS_CURR_GOVERNOR_PATH_SUFFIX); ret = sysfs_write_str(path, governor); @@ -71,11 +66,9 @@ static int tm2_dvfs_get_curr_freq(char *res_name) if (!res_name) return -EINVAL; - snprintf(path, PATH_MAX, "%s%s%s%s%s", + snprintf(path, PATH_MAX, "%s%s%s", DEVFREQ_BUS_PATH_PREFIX, res_name, - DEVFREQ_BUS_PATH_INFIX, - res_name, DEVFREQ_BUS_CURR_FREQ_PATH_SUFFIX); ret = sysfs_read_int(path, &freq); @@ -93,11 +86,9 @@ static int tm2_dvfs_get_min_freq(char *res_name) if (!res_name) return -EINVAL; - snprintf(path, PATH_MAX, "%s%s%s%s%s", + snprintf(path, PATH_MAX, "%s%s%s", DEVFREQ_BUS_PATH_PREFIX, res_name, - DEVFREQ_BUS_PATH_INFIX, - res_name, DEVFREQ_BUS_MIN_FREQ_PATH_SUFFIX); ret = sysfs_read_int(path, &freq); @@ -115,11 +106,9 @@ static int tm2_dvfs_set_min_freq(char *res_name, int freq) if ((!res_name) || (freq < 0)) return -EINVAL; - snprintf(path, PATH_MAX, "%s%s%s%s%s", + snprintf(path, PATH_MAX, "%s%s%s", DEVFREQ_BUS_PATH_PREFIX, res_name, - DEVFREQ_BUS_PATH_INFIX, - res_name, DEVFREQ_BUS_MIN_FREQ_PATH_SUFFIX); ret = sysfs_write_int(path, freq); @@ -137,11 +126,9 @@ static int tm2_dvfs_get_max_freq(char *res_name) if (!res_name) return -EINVAL; - snprintf(path, PATH_MAX, "%s%s%s%s%s", + snprintf(path, PATH_MAX, "%s%s%s", DEVFREQ_BUS_PATH_PREFIX, res_name, - DEVFREQ_BUS_PATH_INFIX, - res_name, DEVFREQ_BUS_MAX_FREQ_PATH_SUFFIX); ret = sysfs_read_int(path, &freq); @@ -159,11 +146,9 @@ static int tm2_dvfs_set_max_freq(char *res_name, int freq) if ((!res_name) || (freq < 0)) return -EINVAL; - snprintf(path, PATH_MAX, "%s%s%s%s%s", + snprintf(path, PATH_MAX, "%s%s%s", DEVFREQ_BUS_PATH_PREFIX, res_name, - DEVFREQ_BUS_PATH_INFIX, - res_name, DEVFREQ_BUS_MAX_FREQ_PATH_SUFFIX); ret = sysfs_write_int(path, freq); diff --git a/src/gpu/gpu.c b/src/gpu/gpu.c index 28a8ffd..3ef3c10 100644 --- a/src/gpu/gpu.c +++ b/src/gpu/gpu.c @@ -12,8 +12,7 @@ #define HAL_VERSION MAKE_2B_CODE_4(VER_MAJOR,VER_MINOR,VER_REVISION,VER_RELEASE) #define DEV_VERSION_GPU MAKE_2B_CODE_2(1,0) -#define DEVFREQ_GPU_PATH_PREFIX "/sys/devices/platform/soc/" -#define DEVFREQ_GPU_PATH_INFIX "/devfreq/" +#define DEVFREQ_GPU_PATH_PREFIX "/sys/class/devfreq/" #define DEVFREQ_GPU_CURR_GOVERNOR_PATH_SUFFIX "/governor" #define DEVFREQ_GPU_CURR_FREQ_PATH_SUFFIX "/cur_freq" #define DEVFREQ_GPU_MIN_FREQ_PATH_SUFFIX "/min_freq" @@ -33,11 +32,9 @@ static int tm2_dvfs_get_curr_governor(char *res_name, char *governor) if ((!res_name) || (!governor)) return -EINVAL; - snprintf(path, PATH_MAX, "%s%s%s%s%s", + snprintf(path, PATH_MAX, "%s%s%s", DEVFREQ_GPU_PATH_PREFIX, res_name, - DEVFREQ_GPU_PATH_INFIX, - res_name, DEVFREQ_GPU_CURR_GOVERNOR_PATH_SUFFIX); ret = sysfs_read_str(path, governor, BUFF_MAX); @@ -55,11 +52,9 @@ static int tm2_dvfs_set_curr_governor(char *res_name, char *governor) if ((!res_name) || (!governor)) return -EINVAL; - snprintf(path, PATH_MAX, "%s%s%s%s%s", + snprintf(path, PATH_MAX, "%s%s%s", DEVFREQ_GPU_PATH_PREFIX, res_name, - DEVFREQ_GPU_PATH_INFIX, - res_name, DEVFREQ_GPU_CURR_GOVERNOR_PATH_SUFFIX); ret = sysfs_write_str(path, governor); @@ -77,11 +72,9 @@ static int tm2_dvfs_get_curr_freq(char *res_name) if (!res_name) return -EINVAL; - snprintf(path, PATH_MAX, "%s%s%s%s%s", + snprintf(path, PATH_MAX, "%s%s%s", DEVFREQ_GPU_PATH_PREFIX, res_name, - DEVFREQ_GPU_PATH_INFIX, - res_name, DEVFREQ_GPU_CURR_FREQ_PATH_SUFFIX); ret = sysfs_read_int(path, &freq); @@ -99,11 +92,9 @@ static int tm2_dvfs_get_min_freq(char *res_name) if (!res_name) return -EINVAL; - snprintf(path, PATH_MAX, "%s%s%s%s%s", + snprintf(path, PATH_MAX, "%s%s%s", DEVFREQ_GPU_PATH_PREFIX, res_name, - DEVFREQ_GPU_PATH_INFIX, - res_name, DEVFREQ_GPU_MIN_FREQ_PATH_SUFFIX); ret = sysfs_read_int(path, &freq); @@ -121,11 +112,9 @@ static int tm2_dvfs_set_min_freq(char *res_name, int freq) if ((!res_name) || (freq < 0)) return -EINVAL; - snprintf(path, PATH_MAX, "%s%s%s%s%s", + snprintf(path, PATH_MAX, "%s%s%s", DEVFREQ_GPU_PATH_PREFIX, res_name, - DEVFREQ_GPU_PATH_INFIX, - res_name, DEVFREQ_GPU_MIN_FREQ_PATH_SUFFIX); ret = sysfs_write_int(path, freq); @@ -143,11 +132,9 @@ static int tm2_dvfs_get_max_freq(char *res_name) if (!res_name) return -EINVAL; - snprintf(path, PATH_MAX, "%s%s%s%s%s", + snprintf(path, PATH_MAX, "%s%s%s", DEVFREQ_GPU_PATH_PREFIX, res_name, - DEVFREQ_GPU_PATH_INFIX, - res_name, DEVFREQ_GPU_MAX_FREQ_PATH_SUFFIX); ret = sysfs_read_int(path, &freq); @@ -165,11 +152,9 @@ static int tm2_dvfs_set_max_freq(char *res_name, int freq) if ((!res_name) || (freq < 0)) return -EINVAL; - snprintf(path, PATH_MAX, "%s%s%s%s%s", + snprintf(path, PATH_MAX, "%s%s%s", DEVFREQ_GPU_PATH_PREFIX, res_name, - DEVFREQ_GPU_PATH_INFIX, - res_name, DEVFREQ_GPU_MAX_FREQ_PATH_SUFFIX); ret = sysfs_write_int(path, freq); -- 2.7.4 From daed400de5365da7bc22cfbf024ea3f1c19ad72a Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Fri, 10 Feb 2017 13:10:07 +0900 Subject: [PATCH 04/16] pass-hal: tm2: Add the configuration files for resources This patch adds the new configuration files for resources of TM2 board. - pass.conf contains the number of supported resources and the information of each resource such as CPU, BUS and GPU. - pass-resource0.conf is the configuration file for LITTLE Cores on TM2. - pass-resource1.conf is the configuration file for big Cores on TM2. - pass-resource2.conf is the configuration file for Memory Bus (INT block) on TM2. - pass-resource3.conf is the configuration file for Memory Bus (MFI block) on TM2. - pass-resource4.conf is the configuration file for MALI GPU on TM2. Change-Id: Idd77b63c12a96633ed1feed327513db92e4ead33 Signed-off-by: Chanwoo Choi --- CMakeLists.txt | 7 + packaging/pass-hal-tm2.spec | 7 + scripts/pass-resource0.conf | 409 +++++++++++++++++++++++++++++++++++ scripts/pass-resource1.conf | 509 ++++++++++++++++++++++++++++++++++++++++++++ scripts/pass-resource2.conf | 260 ++++++++++++++++++++++ scripts/pass-resource3.conf | 263 +++++++++++++++++++++++ scripts/pass-resource4.conf | 263 +++++++++++++++++++++++ scripts/pass.conf | 37 ++++ 8 files changed, 1755 insertions(+) create mode 100644 scripts/pass-resource0.conf create mode 100644 scripts/pass-resource1.conf create mode 100644 scripts/pass-resource2.conf create mode 100644 scripts/pass-resource3.conf create mode 100644 scripts/pass-resource4.conf create mode 100644 scripts/pass.conf diff --git a/CMakeLists.txt b/CMakeLists.txt index e9131cf..35033cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,3 +18,10 @@ SET(DEST_DIR ${LIB_INSTALL_DIR}/pass) ADD_SUBDIRECTORY(src/cpu) ADD_SUBDIRECTORY(src/bus) ADD_SUBDIRECTORY(src/gpu) + +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/pass.conf DESTINATION /etc/pass) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/pass-resource0.conf DESTINATION /etc/pass) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/pass-resource1.conf DESTINATION /etc/pass) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/pass-resource2.conf DESTINATION /etc/pass) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/pass-resource3.conf DESTINATION /etc/pass) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/pass-resource4.conf DESTINATION /etc/pass) diff --git a/packaging/pass-hal-tm2.spec b/packaging/pass-hal-tm2.spec index 2752cf8..77e2b4c 100644 --- a/packaging/pass-hal-tm2.spec +++ b/packaging/pass-hal-tm2.spec @@ -40,3 +40,10 @@ rm -rf %{buildroot} %files %manifest %{name}.manifest %{_libdir}/pass/*.so + +%config %{_sysconfdir}/pass/pass.conf +%config %{_sysconfdir}/pass/pass-resource0.conf +%config %{_sysconfdir}/pass/pass-resource1.conf +%config %{_sysconfdir}/pass/pass-resource2.conf +%config %{_sysconfdir}/pass/pass-resource3.conf +%config %{_sysconfdir}/pass/pass-resource4.conf diff --git a/scripts/pass-resource0.conf b/scripts/pass-resource0.conf new file mode 100644 index 0000000..98a73d6 --- /dev/null +++ b/scripts/pass-resource0.conf @@ -0,0 +1,409 @@ +[Pass] +pass_compatible=samsung,tm2 +pass_support=1 +pass_gov_type=2 + +pass_num_levels=12 +pass_init_level=4 +pass_min_level=4 +pass_max_level=11 + +pass_cpu_threshold=60 +pass_up_threshold=50 +pass_down_threshold=30 + +pass_num_cpu_stats=20 + +pass_level_up_threshold=1 +pass_governor_timeout=0.4 + +[Level0] +limit_max_freq=1000000 +limit_min_cpu=1 +num_down_cond=0 +num_up_cond=1 +num_up_cond_freq=800000 +num_left_cond=0 +num_right_cond=1 +num_right_cond_nr_running=100 +num_right_cond_busy_cpu=1 + +[Level1] +limit_max_freq=1000000 +limit_min_cpu=2 +num_down_cond=0 +num_up_cond=1 +num_up_cond_freq=800000 +num_left_cond=1 +num_left_cond_nr_running=100 +num_left_cond_busy_cpu=1 +num_right_cond=1 +num_right_cond_nr_running=200 +num_right_cond_busy_cpu=2 + +[Level2] +limit_max_freq=1000000 +limit_min_cpu=3 +num_down_cond=0 +num_up_cond=1 +num_up_cond_freq=800000 +num_left_cond=1 +num_left_cond_nr_running=200 +num_left_cond_busy_cpu=2 +num_right_cond=1 +num_right_cond_nr_running=300 +num_right_cond_busy_cpu=3 + +[Level3] +limit_max_freq=1000000 +limit_min_cpu=4 +num_down_cond=0 +num_up_cond=1 +num_up_cond_freq=800000 +num_left_cond=1 +num_left_cond_nr_running=300 +num_left_cond_busy_cpu=3 +num_right_cond=0 + +[Level4] +limit_max_freq=1200000 +limit_min_cpu=1 +num_down_cond=1 +num_down_cond_freq=1000000 +num_up_cond=1 +num_up_cond_freq=1200000 +num_left_cond=0 +num_right_cond=1 +num_right_cond_nr_running=100 +num_right_cond_busy_cpu=1 + +[Level5] +limit_max_freq=1200000 +limit_min_cpu=2 +num_down_cond=1 +num_down_cond_freq=1000000 +num_up_cond=1 +num_up_cond_freq=1200000 +num_left_cond=1 +num_left_cond_nr_running=100 +num_left_cond_busy_cpu=1 +num_right_cond=1 +num_right_cond_nr_running=200 +num_right_cond_busy_cpu=2 + +[Level6] +limit_max_freq=1200000 +limit_min_cpu=3 +num_down_cond=1 +num_down_cond_freq=1000000 +num_up_cond=1 +num_up_cond_freq=1200000 +num_left_cond=1 +num_left_cond_nr_running=200 +num_left_cond_busy_cpu=2 +num_right_cond=1 +num_right_cond_nr_running=300 +num_right_cond_busy_cpu=3 + +[Level7] +limit_max_freq=1200000 +limit_min_cpu=4 +num_down_cond=1 +num_down_cond_freq=1000000 +num_up_cond=1 +num_up_cond_freq=1200000 +num_left_cond=1 +num_left_cond_nr_running=300 +num_left_cond_busy_cpu=3 +num_right_cond=0 + +[Level8] +limit_max_freq=1300000 +limit_min_cpu=1 +num_down_cond=1 +num_down_cond_freq=1200000 +num_up_cond=1 +num_up_cond_freq=1300000 +num_left_cond=0 +num_right_cond=1 +num_right_cond_nr_running=100 +num_right_cond_busy_cpu=1 + +[Level9] +limit_max_freq=1300000 +limit_min_cpu=2 +num_down_cond=1 +num_down_cond_freq=1200000 +num_up_cond=1 +num_up_cond_freq=1300000 +num_left_cond=1 +num_left_cond_nr_running=100 +num_left_cond_busy_cpu=1 +num_right_cond=1 +num_right_cond_nr_running=200 +num_right_cond_busy_cpu=2 + +[Level10] +limit_max_freq=1300000 +limit_min_cpu=3 +num_down_cond=1 +num_down_cond_freq=1200000 +num_up_cond=1 +num_up_cond_freq=1300000 +num_left_cond=1 +num_left_cond_nr_running=200 +num_left_cond_busy_cpu=2 +num_right_cond=1 +num_right_cond_nr_running=300 +num_right_cond_busy_cpu=3 + +[Level11] +limit_max_freq=1300000 +limit_min_cpu=4 +num_down_cond=1 +num_down_cond_freq=1200000 +num_up_cond=1 +num_up_cond_freq=1300000 +num_left_cond=1 +num_left_cond_nr_running=300 +num_left_cond_busy_cpu=3 +num_right_cond=0 + +############################ +### Add list of scenario ### +############################ +[PassScenario] +pass_scenario_support=yes +pass_num_scenarios=52 + +[Scenario0] +name=AppLaunch +support=yes + +min_level=9 +max_level=11 + +[Scenario1] +name=AppLaunchHome +support=yes + +min_level=9 +max_level=11 + +[Scenario2] +name=BeautyShot +support=no + +[Scenario3] +name=Browser +support=no + +[Scenario4] +name=BrowserDash +support=no + +[Scenario5] +name=BrowserJavaScript +support=yes + +min_level=9 +max_level=11 + +[Scenario6] +name=BrowserLoading +support=no + +[Scenario7] +name=BrowserScroll +support=no + +[Scenario8] +name=CallSound +support=no + +[Scenario9] +name=CameraBurstShot +support=no + +[Scenario10] +name=CameraCaptureAtRec +support=no + +[Scenario11] +name=CameraPreview +support=no + +[Scenario12] +name=CameraSoundAndShot +support=no + +[Scenario13] +name=ContactSearch +support=no + +[Scenario14] +name=Emergency +support=no + +[Scenario15] +name=GalleryScroll +support=no + +[Scenario16] +name=GalleryRotation +support=no + +[Scenario17] +name=GetDefaultLockTime +support=no + +[Scenario18] +name=GpsSerialCno +support=no + +[Scenario19] +name=GpuBoost +support=no + +[Scenario20] +name=GpuWakeup +support=no + +[Scenario21] +name=HomeScreen +support=no + +[Scenario22] +name=ImageViewer +support=no + +[Scenario23] +name=IMEInput +support=no + +[Scenario24] +name=LockScreen +support=no + +[Scenario25] +name=LowBattery +support=no + +[Scenario26] +name=MtpSendFile +support=no + +[Scenario27] +name=MusicPlayLcdOn +support=no + +[Scenario28] +name=PowerSaving +support=no + +[Scenario29] +name=ProcessCrashed +support=no + +[Scenario30] +name=ReservedMode +support=no + +[Scenario31] +name=ScreenMirroring +support=no + +[Scenario32] +name=SmemoZoom +support=no + +[Scenario33] +name=SVoice +support=no + +[Scenario34] +name=WebappLaunch +support=no + +[Scenario35] +name=WifiThroughput +support=no + +[Scenario36] +name=PowerOff +support=no + +[Scenario37] +name=WebAppDrag +support=no + +[Scenario38] +name=WebAppFlick +support=no + +[Scenario39] +name=SensorWakeup +support=no + +[Scenario40] +name=UgLaunch +support=no + +[Scenario41] +name=MusicScroll +support=no + +[Scenario42] +name=FileScroll +support=no + +[Scenario43] +name=VideoScroll +support=no + +[Scenario44] +name=EmailScroll +support=yes + +min_level=9 +max_level=11 + +[Scenario45] +name=ContactScroll +support=no + +[Scenario46] +name=TizenStoreScroll +support=yes + +min_level=9 +max_level=11 + +[Scenario47] +name=CallLogScroll +support=yes + +min_level=9 +max_level=11 + +[Scenario48] +name=MyfilesScroll +support=yes + +min_level=9 +max_level=11 + +[Scenario49] +name=MessageScroll +support=yes + +min_level=9 +max_level=11 + +[Scenario50] +name=SIOP +support=no + +[Scenario51] +name=UltraPowerSaving +support=no diff --git a/scripts/pass-resource1.conf b/scripts/pass-resource1.conf new file mode 100644 index 0000000..9f65eee --- /dev/null +++ b/scripts/pass-resource1.conf @@ -0,0 +1,509 @@ +[Pass] +pass_compatible=samsung,tm2 +pass_support=1 +pass_gov_type=2 + +pass_num_levels=20 +pass_init_level=4 +pass_min_level=4 +pass_max_level=19 + +pass_cpu_threshold=80 +pass_up_threshold=60 +pass_down_threshold=30 + +pass_num_cpu_stats=20 + +pass_level_up_threshold=1 +pass_governor_timeout=0.4 + +[Level0] +limit_max_freq=1000000 +limit_min_cpu=1 +num_down_cond=0 +num_up_cond=1 +num_up_cond_freq=1000000 +num_left_cond=0 +num_right_cond=1 +num_right_cond_nr_running=100 +num_right_cond_busy_cpu=1 + +[Level1] +limit_max_freq=1000000 +limit_min_cpu=2 +num_down_cond=0 +num_up_cond=1 +num_up_cond_freq=1000000 +num_left_cond=1 +num_left_cond_nr_running=100 +num_left_cond_busy_cpu=1 +num_right_cond=1 +num_right_cond_nr_running=200 +num_right_cond_busy_cpu=2 + +[Level2] +limit_max_freq=1000000 +limit_min_cpu=3 +num_down_cond=0 +num_up_cond=1 +num_up_cond_freq=1000000 +num_left_cond=1 +num_left_cond_nr_running=200 +num_left_cond_busy_cpu=2 +num_right_cond=1 +num_right_cond_nr_running=300 +num_right_cond_busy_cpu=3 + +[Level3] +limit_max_freq=1000000 +limit_min_cpu=4 +num_down_cond=0 +num_up_cond=1 +num_up_cond_freq=1000000 +num_left_cond=1 +num_left_cond_nr_running=300 +num_left_cond_busy_cpu=3 +num_right_cond=0 + +[Level4] +limit_max_freq=1200000 +limit_min_cpu=1 +num_down_cond=1 +num_down_cond_freq=1000000 +num_up_cond=1 +num_up_cond_freq=1200000 +num_left_cond=0 +num_right_cond=1 +num_right_cond_nr_running=100 +num_right_cond_busy_cpu=1 + +[Level5] +limit_max_freq=1200000 +limit_min_cpu=2 +num_down_cond=1 +num_down_cond_freq=1000000 +num_up_cond=1 +num_up_cond_freq=1200000 +num_left_cond=1 +num_left_cond_nr_running=100 +num_left_cond_busy_cpu=1 +num_right_cond=1 +num_right_cond_nr_running=200 +num_right_cond_busy_cpu=2 + +[Level6] +limit_max_freq=1200000 +limit_min_cpu=3 +num_down_cond=1 +num_down_cond_freq=1000000 +num_up_cond=1 +num_up_cond_freq=1200000 +num_left_cond=1 +num_left_cond_nr_running=200 +num_left_cond_busy_cpu=2 +num_right_cond=1 +num_right_cond_nr_running=300 +num_right_cond_busy_cpu=3 + +[Level7] +limit_max_freq=1200000 +limit_min_cpu=4 +num_down_cond=1 +num_down_cond_freq=1000000 +num_up_cond=1 +num_up_cond_freq=1200000 +num_left_cond=1 +num_left_cond_nr_running=300 +num_left_cond_busy_cpu=3 +num_right_cond=0 + +[Level8] +limit_max_freq=1300000 +limit_min_cpu=1 +num_down_cond=1 +num_down_cond_freq=1100000 +num_up_cond=1 +num_up_cond_freq=1300000 +num_left_cond=0 +num_right_cond=1 +num_right_cond_nr_running=100 +num_right_cond_busy_cpu=1 + +[Level9] +limit_max_freq=1300000 +limit_min_cpu=2 +num_down_cond=1 +num_down_cond_freq=1100000 +num_up_cond=1 +num_up_cond_freq=1300000 +num_left_cond=1 +num_left_cond_nr_running=100 +num_left_cond_busy_cpu=1 +num_right_cond=1 +num_right_cond_nr_running=200 +num_right_cond_busy_cpu=2 + +[Level10] +limit_max_freq=1300000 +limit_min_cpu=3 +num_down_cond=1 +num_down_cond_freq=1100000 +num_up_cond=1 +num_up_cond_freq=1300000 +num_left_cond=1 +num_left_cond_nr_running=200 +num_left_cond_busy_cpu=2 +num_right_cond=1 +num_right_cond_nr_running=300 +num_right_cond_busy_cpu=3 + +[Level11] +limit_max_freq=1300000 +limit_min_cpu=4 +num_down_cond=1 +num_down_cond_freq=1100000 +num_up_cond=1 +num_up_cond_freq=1300000 +num_left_cond=1 +num_left_cond_nr_running=300 +num_left_cond_busy_cpu=3 +num_right_cond=0 + +[Level12] +limit_max_freq=1500000 +limit_min_cpu=1 +num_down_cond=1 +num_down_cond_freq=1300000 +num_up_cond=1 +num_up_cond_freq=1500000 +num_left_cond=0 +num_right_cond=1 +num_right_cond_nr_running=100 +num_right_cond_busy_cpu=1 + +[Level13] +limit_max_freq=1500000 +limit_min_cpu=2 +num_down_cond=1 +num_down_cond_freq=1300000 +num_up_cond=1 +num_up_cond_freq=1500000 +num_left_cond=1 +num_left_cond_nr_running=100 +num_left_cond_busy_cpu=1 +num_right_cond=1 +num_right_cond_nr_running=200 +num_right_cond_busy_cpu=2 + +[Level14] +limit_max_freq=1500000 +limit_min_cpu=3 +num_down_cond=1 +num_down_cond_freq=1300000 +num_up_cond=1 +num_up_cond_freq=1500000 +num_left_cond=1 +num_left_cond_nr_running=200 +num_left_cond_busy_cpu=2 +num_right_cond=1 +num_right_cond_nr_running=300 +num_right_cond_busy_cpu=3 + +[Level15] +limit_max_freq=1500000 +limit_min_cpu=4 +num_down_cond=1 +num_down_cond_freq=1300000 +num_up_cond=1 +num_up_cond_freq=1500000 +num_left_cond=1 +num_left_cond_nr_running=300 +num_left_cond_busy_cpu=3 +num_right_cond=0 + +[Level16] +limit_max_freq=1700000 +limit_min_cpu=1 +num_down_cond=1 +num_down_cond_freq=1500000 +num_up_cond=0 +num_left_cond=0 +num_right_cond=1 +num_right_cond_nr_running=100 +num_right_cond_busy_cpu=1 + +[Level17] +limit_max_freq=1700000 +limit_min_cpu=2 +num_down_cond=1 +num_down_cond_freq=1500000 +num_up_cond=0 +num_left_cond=1 +num_left_cond_nr_running=100 +num_left_cond_busy_cpu=1 +num_right_cond=1 +num_right_cond_nr_running=200 +num_right_cond_busy_cpu=2 + +[Level18] +limit_max_freq=1700000 +limit_min_cpu=3 +num_down_cond=1 +num_down_cond_freq=1500000 +num_up_cond=0 +num_left_cond=1 +num_left_cond_nr_running=200 +num_left_cond_busy_cpu=2 +num_right_cond=1 +num_right_cond_nr_running=300 +num_right_cond_busy_cpu=3 + +[Level19] +limit_max_freq=1700000 +limit_min_cpu=4 +num_down_cond=1 +num_down_cond_freq=1500000 +num_up_cond=0 +num_left_cond=1 +num_left_cond_nr_running=300 +num_left_cond_busy_cpu=3 +num_right_cond=0 + +############################ +### Add list of scenario ### +############################ +[PassScenario] +pass_scenario_support=yes +pass_num_scenarios=52 + +[Scenario0] +name=AppLaunch +support=yes + +min_level=13 +max_level=15 + +[Scenario1] +name=AppLaunchHome +support=yes + +min_level=13 +max_level=15 + +[Scenario2] +name=BeautyShot +support=no + +[Scenario3] +name=Browser +support=no + +[Scenario4] +name=BrowserDash +support=no + +[Scenario5] +name=BrowserJavaScript +support=yes + +min_level=13 +max_level=15 + +[Scenario6] +name=BrowserLoading +support=no + +[Scenario7] +name=BrowserScroll +support=no + +[Scenario8] +name=CallSound +support=no + +[Scenario9] +name=CameraBurstShot +support=no + +[Scenario10] +name=CameraCaptureAtRec +support=no + +[Scenario11] +name=CameraPreview +support=no + +[Scenario12] +name=CameraSoundAndShot +support=no + +[Scenario13] +name=ContactSearch +support=no + +[Scenario14] +name=Emergency +support=no + +[Scenario15] +name=GalleryScroll +support=no + +[Scenario16] +name=GalleryRotation +support=no + +[Scenario17] +name=GetDefaultLockTime +support=no + +[Scenario18] +name=GpsSerialCno +support=no + +[Scenario19] +name=GpuBoost +support=no + +[Scenario20] +name=GpuWakeup +support=no + +[Scenario21] +name=HomeScreen +support=no + +[Scenario22] +name=ImageViewer +support=no + +[Scenario23] +name=IMEInput +support=no + +[Scenario24] +name=LockScreen +support=no + +[Scenario25] +name=LowBattery +support=no + +[Scenario26] +name=MtpSendFile +support=no + +[Scenario27] +name=MusicPlayLcdOn +support=no + +[Scenario28] +name=PowerSaving +support=no + +[Scenario29] +name=ProcessCrashed +support=no + +[Scenario30] +name=ReservedMode +support=no + +[Scenario31] +name=ScreenMirroring +support=no + +[Scenario32] +name=SmemoZoom +support=no + +[Scenario33] +name=SVoice +support=no + +[Scenario34] +name=WebappLaunch +support=no + +[Scenario35] +name=WifiThroughput +support=no + +[Scenario36] +name=PowerOff +support=no + +[Scenario37] +name=WebAppDrag +support=no + +[Scenario38] +name=WebAppFlick +support=no + +[Scenario39] +name=SensorWakeup +support=no + +[Scenario40] +name=UgLaunch +support=no + +[Scenario41] +name=MusicScroll +support=no + +[Scenario42] +name=FileScroll +support=no + +[Scenario43] +name=VideoScroll +support=no + +[Scenario44] +name=EmailScroll +support=yes + +min_level=13 +max_level=15 + +[Scenario45] +name=ContactScroll +support=no + +[Scenario46] +name=TizenStoreScroll +support=yes + +min_level=13 +max_level=15 + +[Scenario47] +name=CallLogScroll +support=yes + +min_level=13 +max_level=15 + +[Scenario48] +name=MyfilesScroll +support=yes + +min_level=13 +max_level=15 + +[Scenario49] +name=MessageScroll +support=yes + +min_level=13 +max_level=15 + +[Scenario50] +name=SIOP +support=no + +[Scenario51] +name=UltraPowerSaving +support=no diff --git a/scripts/pass-resource2.conf b/scripts/pass-resource2.conf new file mode 100644 index 0000000..47e42ae --- /dev/null +++ b/scripts/pass-resource2.conf @@ -0,0 +1,260 @@ +[Pass] +pass_compatible=samsung,tm2 +pass_support=1 +pass_gov_type=0 + +pass_num_levels=4 +pass_init_level=0 +pass_min_level=0 +pass_max_level=3 + +[Level0] +limit_min_freq=100000000 + +[Level1] +limit_min_freq=267000000 + +[Level2] +limit_min_freq=334000000 + +[Level3] +limit_min_freq=400000000 + +############################ +### Add list of scenario ### +############################ +[PassScenario] +pass_scenario_support=yes +pass_num_scenarios=52 + +[Scenario0] +name=AppLaunch +support=yes + +min_level=3 +max_level=3 + +[Scenario1] +name=AppLaunchHome +support=yes + +min_level=3 +max_level=3 + +[Scenario2] +name=BeautyShot +support=no + +[Scenario3] +name=Browser +support=no + +[Scenario4] +name=BrowserDash +support=no + +[Scenario5] +name=BrowserJavaScript +support=yes + +min_level=3 +max_level=3 + +[Scenario6] +name=BrowserLoading +support=no + +[Scenario7] +name=BrowserScroll +support=no + +[Scenario8] +name=CallSound +support=no + +[Scenario9] +name=CameraBurstShot +support=no + +[Scenario10] +name=CameraCaptureAtRec +support=no + +[Scenario11] +name=CameraPreview +support=no + +[Scenario12] +name=CameraSoundAndShot +support=no + +[Scenario13] +name=ContactSearch +support=no + +[Scenario14] +name=Emergency +support=no + +[Scenario15] +name=GalleryScroll +support=no + +[Scenario16] +name=GalleryRotation +support=no + +[Scenario17] +name=GetDefaultLockTime +support=no + +[Scenario18] +name=GpsSerialCno +support=no + +[Scenario19] +name=GpuBoost +support=no + +[Scenario20] +name=GpuWakeup +support=no + +[Scenario21] +name=HomeScreen +support=no + +[Scenario22] +name=ImageViewer +support=no + +[Scenario23] +name=IMEInput +support=no + +[Scenario24] +name=LockScreen +support=no + +[Scenario25] +name=LowBattery +support=no + +[Scenario26] +name=MtpSendFile +support=no + +[Scenario27] +name=MusicPlayLcdOn +support=no + +[Scenario28] +name=PowerSaving +support=no + +[Scenario29] +name=ProcessCrashed +support=no + +[Scenario30] +name=ReservedMode +support=no + +[Scenario31] +name=ScreenMirroring +support=no + +[Scenario32] +name=SmemoZoom +support=no + +[Scenario33] +name=SVoice +support=no + +[Scenario34] +name=WebappLaunch +support=no + +[Scenario35] +name=WifiThroughput +support=no + +[Scenario36] +name=PowerOff +support=no + +[Scenario37] +name=WebAppDrag +support=no + +[Scenario38] +name=WebAppFlick +support=no + +[Scenario39] +name=SensorWakeup +support=no + +[Scenario40] +name=UgLaunch +support=no + +[Scenario41] +name=MusicScroll +support=no + +[Scenario42] +name=FileScroll +support=no + +[Scenario43] +name=VideoScroll +support=no + +[Scenario44] +name=EmailScroll +support=yes + +min_level=3 +max_level=3 + +[Scenario45] +name=ContactScroll +support=no + +[Scenario46] +name=TizenStoreScroll +support=yes + +min_level=3 +max_level=3 + +[Scenario47] +name=CallLogScroll +support=yes + +min_level=3 +max_level=3 + +[Scenario48] +name=MyfilesScroll +support=yes + +min_level=3 +max_level=3 + +[Scenario49] +name=MessageScroll +support=yes + +min_level=3 +max_level=3 + +[Scenario50] +name=SIOP +support=no + +[Scenario51] +name=UltraPowerSaving +support=no diff --git a/scripts/pass-resource3.conf b/scripts/pass-resource3.conf new file mode 100644 index 0000000..543fe24 --- /dev/null +++ b/scripts/pass-resource3.conf @@ -0,0 +1,263 @@ +[Pass] +pass_compatible=samsung,tm2 +pass_support=1 +pass_gov_type=0 + +pass_num_levels=5 +pass_init_level=0 +pass_min_level=0 +pass_max_level=4 + +[Level0] +limit_min_freq=78000000 + +[Level1] +limit_min_freq=413000000 + +[Level2] +limit_min_freq=543000000 + +[Level3] +limit_min_freq=667000000 + +[Level4] +limit_min_freq=825000000 + +############################ +### Add list of scenario ### +############################ +[PassScenario] +pass_scenario_support=yes +pass_num_scenarios=52 + +[Scenario0] +name=AppLaunch +support=yes + +min_level=4 +max_level=4 + +[Scenario1] +name=AppLaunchHome +support=yes + +min_level=4 +max_level=4 + +[Scenario2] +name=BeautyShot +support=no + +[Scenario3] +name=Browser +support=no + +[Scenario4] +name=BrowserDash +support=no + +[Scenario5] +name=BrowserJavaScript +support=yes + +min_level=4 +max_level=4 + +[Scenario6] +name=BrowserLoading +support=no + +[Scenario7] +name=BrowserScroll +support=no + +[Scenario8] +name=CallSound +support=no + +[Scenario9] +name=CameraBurstShot +support=no + +[Scenario10] +name=CameraCaptureAtRec +support=no + +[Scenario11] +name=CameraPreview +support=no + +[Scenario12] +name=CameraSoundAndShot +support=no + +[Scenario13] +name=ContactSearch +support=no + +[Scenario14] +name=Emergency +support=no + +[Scenario15] +name=GalleryScroll +support=no + +[Scenario16] +name=GalleryRotation +support=no + +[Scenario17] +name=GetDefaultLockTime +support=no + +[Scenario18] +name=GpsSerialCno +support=no + +[Scenario19] +name=GpuBoost +support=no + +[Scenario20] +name=GpuWakeup +support=no + +[Scenario21] +name=HomeScreen +support=no + +[Scenario22] +name=ImageViewer +support=no + +[Scenario23] +name=IMEInput +support=no + +[Scenario24] +name=LockScreen +support=no + +[Scenario25] +name=LowBattery +support=no + +[Scenario26] +name=MtpSendFile +support=no + +[Scenario27] +name=MusicPlayLcdOn +support=no + +[Scenario28] +name=PowerSaving +support=no + +[Scenario29] +name=ProcessCrashed +support=no + +[Scenario30] +name=ReservedMode +support=no + +[Scenario31] +name=ScreenMirroring +support=no + +[Scenario32] +name=SmemoZoom +support=no + +[Scenario33] +name=SVoice +support=no + +[Scenario34] +name=WebappLaunch +support=no + +[Scenario35] +name=WifiThroughput +support=no + +[Scenario36] +name=PowerOff +support=no + +[Scenario37] +name=WebAppDrag +support=no + +[Scenario38] +name=WebAppFlick +support=no + +[Scenario39] +name=SensorWakeup +support=no + +[Scenario40] +name=UgLaunch +support=no + +[Scenario41] +name=MusicScroll +support=no + +[Scenario42] +name=FileScroll +support=no + +[Scenario43] +name=VideoScroll +support=no + +[Scenario44] +name=EmailScroll +support=yes + +min_level=4 +max_level=4 + +[Scenario45] +name=ContactScroll +support=no + +[Scenario46] +name=TizenStoreScroll +support=yes + +min_level=4 +max_level=4 + +[Scenario47] +name=CallLogScroll +support=yes + +min_level=4 +max_level=4 + +[Scenario48] +name=MyfilesScroll +support=yes + +min_level=4 +max_level=4 + +[Scenario49] +name=MessageScroll +support=yes + +min_level=4 +max_level=4 + +[Scenario50] +name=SIOP +support=no + +[Scenario51] +name=UltraPowerSaving +support=no diff --git a/scripts/pass-resource4.conf b/scripts/pass-resource4.conf new file mode 100644 index 0000000..31855d1 --- /dev/null +++ b/scripts/pass-resource4.conf @@ -0,0 +1,263 @@ +[Pass] +pass_compatible=samsung,tm2 +pass_support=1 +pass_gov_type=0 + +pass_num_levels=5 +pass_init_level=0 +pass_min_level=0 +pass_max_level=4 + +[Level0] +limit_min_freq=160000000 + +[Level1] +limit_min_freq=500000000 + +[Level2] +limit_min_freq=550000000 + +[Level3] +limit_min_freq=600000000 + +[Level4] +limit_min_freq=700000000 + +############################ +### Add list of scenario ### +############################ +[PassScenario] +pass_scenario_support=yes +pass_num_scenarios=52 + +[Scenario0] +name=AppLaunch +support=yes + +min_level=3 +max_level=3 + +[Scenario1] +name=AppLaunchHome +support=yes + +min_level=3 +max_level=3 + +[Scenario2] +name=BeautyShot +support=no + +[Scenario3] +name=Browser +support=no + +[Scenario4] +name=BrowserDash +support=no + +[Scenario5] +name=BrowserJavaScript +support=yes + +min_level=3 +max_level=3 + +[Scenario6] +name=BrowserLoading +support=no + +[Scenario7] +name=BrowserScroll +support=no + +[Scenario8] +name=CallSound +support=no + +[Scenario9] +name=CameraBurstShot +support=no + +[Scenario10] +name=CameraCaptureAtRec +support=no + +[Scenario11] +name=CameraPreview +support=no + +[Scenario12] +name=CameraSoundAndShot +support=no + +[Scenario13] +name=ContactSearch +support=no + +[Scenario14] +name=Emergency +support=no + +[Scenario15] +name=GalleryScroll +support=no + +[Scenario16] +name=GalleryRotation +support=no + +[Scenario17] +name=GetDefaultLockTime +support=no + +[Scenario18] +name=GpsSerialCno +support=no + +[Scenario19] +name=GpuBoost +support=no + +[Scenario20] +name=GpuWakeup +support=no + +[Scenario21] +name=HomeScreen +support=no + +[Scenario22] +name=ImageViewer +support=no + +[Scenario23] +name=IMEInput +support=no + +[Scenario24] +name=LockScreen +support=no + +[Scenario25] +name=LowBattery +support=no + +[Scenario26] +name=MtpSendFile +support=no + +[Scenario27] +name=MusicPlayLcdOn +support=no + +[Scenario28] +name=PowerSaving +support=no + +[Scenario29] +name=ProcessCrashed +support=no + +[Scenario30] +name=ReservedMode +support=no + +[Scenario31] +name=ScreenMirroring +support=no + +[Scenario32] +name=SmemoZoom +support=no + +[Scenario33] +name=SVoice +support=no + +[Scenario34] +name=WebappLaunch +support=no + +[Scenario35] +name=WifiThroughput +support=no + +[Scenario36] +name=PowerOff +support=no + +[Scenario37] +name=WebAppDrag +support=no + +[Scenario38] +name=WebAppFlick +support=no + +[Scenario39] +name=SensorWakeup +support=no + +[Scenario40] +name=UgLaunch +support=no + +[Scenario41] +name=MusicScroll +support=no + +[Scenario42] +name=FileScroll +support=no + +[Scenario43] +name=VideoScroll +support=no + +[Scenario44] +name=EmailScroll +support=yes + +min_level=3 +max_level=3 + +[Scenario45] +name=ContactScroll +support=no + +[Scenario46] +name=TizenStoreScroll +support=yes + +min_level=3 +max_level=3 + +[Scenario47] +name=CallLogScroll +support=yes + +min_level=3 +max_level=3 + +[Scenario48] +name=MyfilesScroll +support=yes + +min_level=3 +max_level=3 + +[Scenario49] +name=MessageScroll +support=yes + +min_level=3 +max_level=3 + +[Scenario50] +name=SIOP +support=no + +[Scenario51] +name=UltraPowerSaving +support=no diff --git a/scripts/pass.conf b/scripts/pass.conf new file mode 100644 index 0000000..a40cb5e --- /dev/null +++ b/scripts/pass.conf @@ -0,0 +1,37 @@ +# Default pass.conf +# - If you want to use PASS(Power Aware System Service), you have to create +# new 'pass-[target type].conf' configuration file. +[PassResource] +pass_compatible=samsung,tm2 +pass_num_resources=5 + +[PassResource0] +pass_res_type=1 +pass_res_name=cpu0 +pass_path_conf_file=/etc/pass/pass-resource0.conf +pass_path_load_table=/sys/kernel/debug/cpufreq/cpu0/load_table +pass_first_cpu=0 +pass_num_cpus=4 + +[PassResource1] +pass_res_type=1 +pass_res_name=cpu4 +pass_path_conf_file=/etc/pass/pass-resource1.conf +pass_path_load_table=/sys/kernel/debug/cpufreq/cpu4/load_table +pass_first_cpu=4 +pass_num_cpus=4 + +[PassResource2] +pass_res_type=2 +pass_res_name=soc:memory_bus@0 +pass_path_conf_file=/etc/pass/pass-resource2.conf + +[PassResource3] +pass_res_type=2 +pass_res_name=soc:memory_bus@1 +pass_path_conf_file=/etc/pass/pass-resource3.conf + +[PassResource4] +pass_res_type=3 +pass_res_name=14ac0000.mali +pass_path_conf_file=/etc/pass/pass-resource4.conf -- 2.7.4 From 35917ef15f0172fdc80560f51869fad872ee928b Mon Sep 17 00:00:00 2001 From: Wook Song Date: Tue, 14 Feb 2017 17:43:24 +0900 Subject: [PATCH 05/16] pass-hal: tm2: Update hotplug ops for set/get functions of min/max online CPUs This patch updates the hotplug ops for the CPU resource in order to include the new functions which set and get the minimum/maximum number of online CPUs. Change-Id: Ied59bdf57db5be3f4d7600198d79d17802a2af7d Signed-off-by: Wook Song --- src/cpu/cpu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index a9e23bc..83bdde0 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -296,6 +296,10 @@ static int tm2_hotplug_set_online_state(char *res_name, int cpu, int on) static struct pass_resource_hotplug_ops tm2_cpu_hotplus_ops = { .get_online_state = tm2_hotplug_get_online_state, .set_online_state = tm2_hotplug_set_online_state, + .get_online_min_num = NULL, + .set_online_min_num = NULL, + .get_online_max_num = NULL, + .set_online_max_num = NULL, }; static int tm2_tmu_get_temp(char *res_name) -- 2.7.4 From 0ddbb2a96dd40778f4bb8bd493093526406e78ae Mon Sep 17 00:00:00 2001 From: Wook Song Date: Wed, 15 Feb 2017 14:29:12 +0900 Subject: [PATCH 06/16] pass-hal: tm2: Add new path_compatible entry to conf file This patch adds the new pass_path_compatible entry, that indicates the path where the pass can get the compatible board information, to the PassResource section in the pass.conf file. If the following patch (895f20b pass: parser: Add parsing of pass_path_compatible) is applied to the pass, you should apply this patch to the pass-hal-tm2 in order to make the pass work correctly. Change-Id: I563c6f451918765bd282e4c9b8a1edaee606cd3b Signed-off-by: Wook Song --- scripts/pass.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/pass.conf b/scripts/pass.conf index a40cb5e..9d09bc9 100644 --- a/scripts/pass.conf +++ b/scripts/pass.conf @@ -3,6 +3,7 @@ # new 'pass-[target type].conf' configuration file. [PassResource] pass_compatible=samsung,tm2 +pass_path_compatible=/proc/device-tree/compatible pass_num_resources=5 [PassResource0] -- 2.7.4 From 6c55220f676257f91e28e8b43fcf1301bfa4d8a3 Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Wed, 15 Feb 2017 16:03:35 +0900 Subject: [PATCH 07/16] pass-hal: tm2: Remove unneeded pass_compatible from pass-resource*.conf This patch removes the unneeded the 'pass_compatible' entry from the pass-resource*.conf because it is not required any more. Change-Id: I0a3772cf14c627844e44e17a8663190328ca7727 Signed-off-by: Chanwoo Choi --- scripts/pass-resource0.conf | 1 - scripts/pass-resource1.conf | 1 - scripts/pass-resource2.conf | 1 - scripts/pass-resource3.conf | 1 - scripts/pass-resource4.conf | 1 - 5 files changed, 5 deletions(-) diff --git a/scripts/pass-resource0.conf b/scripts/pass-resource0.conf index 98a73d6..e422130 100644 --- a/scripts/pass-resource0.conf +++ b/scripts/pass-resource0.conf @@ -1,5 +1,4 @@ [Pass] -pass_compatible=samsung,tm2 pass_support=1 pass_gov_type=2 diff --git a/scripts/pass-resource1.conf b/scripts/pass-resource1.conf index 9f65eee..0baf9c0 100644 --- a/scripts/pass-resource1.conf +++ b/scripts/pass-resource1.conf @@ -1,5 +1,4 @@ [Pass] -pass_compatible=samsung,tm2 pass_support=1 pass_gov_type=2 diff --git a/scripts/pass-resource2.conf b/scripts/pass-resource2.conf index 47e42ae..e525d7c 100644 --- a/scripts/pass-resource2.conf +++ b/scripts/pass-resource2.conf @@ -1,5 +1,4 @@ [Pass] -pass_compatible=samsung,tm2 pass_support=1 pass_gov_type=0 diff --git a/scripts/pass-resource3.conf b/scripts/pass-resource3.conf index 543fe24..9469f74 100644 --- a/scripts/pass-resource3.conf +++ b/scripts/pass-resource3.conf @@ -1,5 +1,4 @@ [Pass] -pass_compatible=samsung,tm2 pass_support=1 pass_gov_type=0 diff --git a/scripts/pass-resource4.conf b/scripts/pass-resource4.conf index 31855d1..e7675b3 100644 --- a/scripts/pass-resource4.conf +++ b/scripts/pass-resource4.conf @@ -1,5 +1,4 @@ [Pass] -pass_compatible=samsung,tm2 pass_support=1 pass_gov_type=0 -- 2.7.4 From 78fee1066da9c0e58e13951d6a8bd67d097e14fd Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Fri, 17 Feb 2017 15:39:11 +0900 Subject: [PATCH 08/16] pass-hal: tm2: Fix value of governor type for bus/gpu resource This patch fixes the value of governor type for BUS/GPU h/w resource because PASS core redefines the governor types as following: - PASS_GOV_DUMMY : -1 - PASS_GOV_BASIC : 0 - PASS_GOV_HOTPLUG_ONLY : 1 - PASS_GOV_RADIATION : 2 - PASS_GOV_STEP : 3 The BUS/GPU resource on TM2 use the PASS_GOV_BASIC governor which uses both HAL interface and Resource controller. Change-Id: I408784aa0a1539b32b83b87b6f621655d504784f Signed-off-by: Chanwoo Choi --- scripts/pass-resource0.conf | 2 +- scripts/pass-resource1.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/pass-resource0.conf b/scripts/pass-resource0.conf index e422130..eb29b81 100644 --- a/scripts/pass-resource0.conf +++ b/scripts/pass-resource0.conf @@ -1,6 +1,6 @@ [Pass] pass_support=1 -pass_gov_type=2 +pass_gov_type=3 pass_num_levels=12 pass_init_level=4 diff --git a/scripts/pass-resource1.conf b/scripts/pass-resource1.conf index 0baf9c0..dac8029 100644 --- a/scripts/pass-resource1.conf +++ b/scripts/pass-resource1.conf @@ -1,6 +1,6 @@ [Pass] pass_support=1 -pass_gov_type=2 +pass_gov_type=3 pass_num_levels=20 pass_init_level=4 -- 2.7.4 From 3ed0e8b6169b5c15b1e48857b262d9fe90b9de47 Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Tue, 28 Mar 2017 14:18:58 +0900 Subject: [PATCH 09/16] packaging: Add ExclusiveArch property to build on armv7l and aarch64 This patch adds the 'ExclusiveArch' property in order to build this package only for both armv7l and aarch64. Change-Id: I232653570a88e6ef5bfb48c6cdbd084efdd7ac3d Signed-off-by: Chanwoo Choi --- packaging/pass-hal-tm2.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packaging/pass-hal-tm2.spec b/packaging/pass-hal-tm2.spec index 77e2b4c..c5bed67 100644 --- a/packaging/pass-hal-tm2.spec +++ b/packaging/pass-hal-tm2.spec @@ -9,6 +9,9 @@ Group: System/Hardware Adaptation License: Apache-2.0 Source0: %{name}-%{version}.tar.gz Source1: %{name}.manifest + +ExclusiveArch: %{arm} aarch64 + Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig BuildRequires: cmake -- 2.7.4 From be39886e397460c0def610cb0a9723a07929cb14 Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Tue, 28 Mar 2017 20:05:50 +0900 Subject: [PATCH 10/16] pass-hal: tm2: Adjust the condition to improve the performance This patch adjusts the condition value of each pass level for big.LITTLE core in order to improve the performance - pass-resource0.conf for LITTLE core - pass-resource1.conf for big core And this patch contains the simple test result according to the test case. - Test 1: Enable PASS with the adjustment of this patch. - Test 2: Enable PASS without the adjustment. - Test 3: Disable PASS (Normal state) [Test result with TPMS] ---------------------------------------------------------------------------------------- |Test 1 |Test 2 |Test 3 | TPMS test case |PASS enable |PASS enable |PASS disable | ---------------------------------------------------------------------------------------- App Launching Time - org.tizen.helloworld | 0.378 (s) | 0.425 (s) | 0.421 (s) | Booting Time | 21.13 (s) | 21.16 (s) | 21.15 (s) | GLBench - Egypt_Offscreen | 161.08 (fps) | 158.24 (fps) | 147.71 (fps)| GLBench - Egypt_Standard | 42.0 (fps) | 38.94 (fps) | 41.7 (fps)| GLBench - Pro_Offscreen | 263.23 (fps) | 243.52 (fps) | 210.77 (fps)| GLBench - Pro_Standard | 53.24 (fps) | 52.11 (fps) | 53.84 (fps)| Web App Launching Time - 5OPuG0pfe7.basic | 0.528 (s) | 0.516 (s) | 0.55 (s) | ---------------------------------------------------------------------------------------- Change-Id: I8290c3f9078f388338786672ff5b83bed96c1ff1 Signed-off-by: Chanwoo Choi --- scripts/pass-resource0.conf | 62 +++++++------- scripts/pass-resource1.conf | 192 ++++++++++++++++---------------------------- 2 files changed, 101 insertions(+), 153 deletions(-) diff --git a/scripts/pass-resource0.conf b/scripts/pass-resource0.conf index eb29b81..2e88730 100644 --- a/scripts/pass-resource0.conf +++ b/scripts/pass-resource0.conf @@ -3,13 +3,13 @@ pass_support=1 pass_gov_type=3 pass_num_levels=12 -pass_init_level=4 -pass_min_level=4 +pass_init_level=0 +pass_min_level=0 pass_max_level=11 -pass_cpu_threshold=60 -pass_up_threshold=50 -pass_down_threshold=30 +pass_cpu_threshold=30 +pass_up_threshold=30 +pass_down_threshold=80 pass_num_cpu_stats=20 @@ -21,7 +21,7 @@ limit_max_freq=1000000 limit_min_cpu=1 num_down_cond=0 num_up_cond=1 -num_up_cond_freq=800000 +num_up_cond_freq=600000 num_left_cond=0 num_right_cond=1 num_right_cond_nr_running=100 @@ -32,9 +32,9 @@ limit_max_freq=1000000 limit_min_cpu=2 num_down_cond=0 num_up_cond=1 -num_up_cond_freq=800000 +num_up_cond_freq=600000 num_left_cond=1 -num_left_cond_nr_running=100 +num_left_cond_nr_running=150 num_left_cond_busy_cpu=1 num_right_cond=1 num_right_cond_nr_running=200 @@ -45,7 +45,7 @@ limit_max_freq=1000000 limit_min_cpu=3 num_down_cond=0 num_up_cond=1 -num_up_cond_freq=800000 +num_up_cond_freq=600000 num_left_cond=1 num_left_cond_nr_running=200 num_left_cond_busy_cpu=2 @@ -58,7 +58,7 @@ limit_max_freq=1000000 limit_min_cpu=4 num_down_cond=0 num_up_cond=1 -num_up_cond_freq=800000 +num_up_cond_freq=600000 num_left_cond=1 num_left_cond_nr_running=300 num_left_cond_busy_cpu=3 @@ -68,9 +68,9 @@ num_right_cond=0 limit_max_freq=1200000 limit_min_cpu=1 num_down_cond=1 -num_down_cond_freq=1000000 +num_down_cond_freq=800000 num_up_cond=1 -num_up_cond_freq=1200000 +num_up_cond_freq=800000 num_left_cond=0 num_right_cond=1 num_right_cond_nr_running=100 @@ -80,11 +80,11 @@ num_right_cond_busy_cpu=1 limit_max_freq=1200000 limit_min_cpu=2 num_down_cond=1 -num_down_cond_freq=1000000 +num_down_cond_freq=800000 num_up_cond=1 -num_up_cond_freq=1200000 +num_up_cond_freq=800000 num_left_cond=1 -num_left_cond_nr_running=100 +num_left_cond_nr_running=150 num_left_cond_busy_cpu=1 num_right_cond=1 num_right_cond_nr_running=200 @@ -94,25 +94,25 @@ num_right_cond_busy_cpu=2 limit_max_freq=1200000 limit_min_cpu=3 num_down_cond=1 -num_down_cond_freq=1000000 +num_down_cond_freq=800000 num_up_cond=1 -num_up_cond_freq=1200000 +num_up_cond_freq=800000 num_left_cond=1 num_left_cond_nr_running=200 num_left_cond_busy_cpu=2 num_right_cond=1 -num_right_cond_nr_running=300 +num_right_cond_nr_running=250 num_right_cond_busy_cpu=3 [Level7] limit_max_freq=1200000 limit_min_cpu=4 num_down_cond=1 -num_down_cond_freq=1000000 +num_down_cond_freq=800000 num_up_cond=1 -num_up_cond_freq=1200000 +num_up_cond_freq=800000 num_left_cond=1 -num_left_cond_nr_running=300 +num_left_cond_nr_running=250 num_left_cond_busy_cpu=3 num_right_cond=0 @@ -120,9 +120,9 @@ num_right_cond=0 limit_max_freq=1300000 limit_min_cpu=1 num_down_cond=1 -num_down_cond_freq=1200000 +num_down_cond_freq=900000 num_up_cond=1 -num_up_cond_freq=1300000 +num_up_cond_freq=900000 num_left_cond=0 num_right_cond=1 num_right_cond_nr_running=100 @@ -132,11 +132,11 @@ num_right_cond_busy_cpu=1 limit_max_freq=1300000 limit_min_cpu=2 num_down_cond=1 -num_down_cond_freq=1200000 +num_down_cond_freq=900000 num_up_cond=1 -num_up_cond_freq=1300000 +num_up_cond_freq=900000 num_left_cond=1 -num_left_cond_nr_running=100 +num_left_cond_nr_running=150 num_left_cond_busy_cpu=1 num_right_cond=1 num_right_cond_nr_running=200 @@ -146,25 +146,25 @@ num_right_cond_busy_cpu=2 limit_max_freq=1300000 limit_min_cpu=3 num_down_cond=1 -num_down_cond_freq=1200000 +num_down_cond_freq=900000 num_up_cond=1 -num_up_cond_freq=1300000 +num_up_cond_freq=900000 num_left_cond=1 num_left_cond_nr_running=200 num_left_cond_busy_cpu=2 num_right_cond=1 -num_right_cond_nr_running=300 +num_right_cond_nr_running=250 num_right_cond_busy_cpu=3 [Level11] limit_max_freq=1300000 limit_min_cpu=4 num_down_cond=1 -num_down_cond_freq=1200000 +num_down_cond_freq=900000 num_up_cond=1 num_up_cond_freq=1300000 num_left_cond=1 -num_left_cond_nr_running=300 +num_left_cond_nr_running=250 num_left_cond_busy_cpu=3 num_right_cond=0 diff --git a/scripts/pass-resource1.conf b/scripts/pass-resource1.conf index dac8029..040388d 100644 --- a/scripts/pass-resource1.conf +++ b/scripts/pass-resource1.conf @@ -2,14 +2,14 @@ pass_support=1 pass_gov_type=3 -pass_num_levels=20 -pass_init_level=4 -pass_min_level=4 -pass_max_level=19 +pass_num_levels=16 +pass_init_level=0 +pass_min_level=0 +pass_max_level=15 -pass_cpu_threshold=80 -pass_up_threshold=60 -pass_down_threshold=30 +pass_cpu_threshold=30 +pass_up_threshold=30 +pass_down_threshold=80 pass_num_cpu_stats=20 @@ -21,7 +21,7 @@ limit_max_freq=1000000 limit_min_cpu=1 num_down_cond=0 num_up_cond=1 -num_up_cond_freq=1000000 +num_up_cond_freq=600000 num_left_cond=0 num_right_cond=1 num_right_cond_nr_running=100 @@ -32,12 +32,12 @@ limit_max_freq=1000000 limit_min_cpu=2 num_down_cond=0 num_up_cond=1 -num_up_cond_freq=1000000 +num_up_cond_freq=600000 num_left_cond=1 num_left_cond_nr_running=100 num_left_cond_busy_cpu=1 num_right_cond=1 -num_right_cond_nr_running=200 +num_right_cond_nr_running=150 num_right_cond_busy_cpu=2 [Level2] @@ -45,12 +45,12 @@ limit_max_freq=1000000 limit_min_cpu=3 num_down_cond=0 num_up_cond=1 -num_up_cond_freq=1000000 +num_up_cond_freq=600000 num_left_cond=1 num_left_cond_nr_running=200 num_left_cond_busy_cpu=2 num_right_cond=1 -num_right_cond_nr_running=300 +num_right_cond_nr_running=250 num_right_cond_busy_cpu=3 [Level3] @@ -58,213 +58,161 @@ limit_max_freq=1000000 limit_min_cpu=4 num_down_cond=0 num_up_cond=1 -num_up_cond_freq=1000000 +num_up_cond_freq=600000 num_left_cond=1 -num_left_cond_nr_running=300 +num_left_cond_nr_running=250 num_left_cond_busy_cpu=3 num_right_cond=0 [Level4] -limit_max_freq=1200000 -limit_min_cpu=1 -num_down_cond=1 -num_down_cond_freq=1000000 -num_up_cond=1 -num_up_cond_freq=1200000 -num_left_cond=0 -num_right_cond=1 -num_right_cond_nr_running=100 -num_right_cond_busy_cpu=1 - -[Level5] -limit_max_freq=1200000 -limit_min_cpu=2 -num_down_cond=1 -num_down_cond_freq=1000000 -num_up_cond=1 -num_up_cond_freq=1200000 -num_left_cond=1 -num_left_cond_nr_running=100 -num_left_cond_busy_cpu=1 -num_right_cond=1 -num_right_cond_nr_running=200 -num_right_cond_busy_cpu=2 - -[Level6] -limit_max_freq=1200000 -limit_min_cpu=3 -num_down_cond=1 -num_down_cond_freq=1000000 -num_up_cond=1 -num_up_cond_freq=1200000 -num_left_cond=1 -num_left_cond_nr_running=200 -num_left_cond_busy_cpu=2 -num_right_cond=1 -num_right_cond_nr_running=300 -num_right_cond_busy_cpu=3 - -[Level7] -limit_max_freq=1200000 -limit_min_cpu=4 -num_down_cond=1 -num_down_cond_freq=1000000 -num_up_cond=1 -num_up_cond_freq=1200000 -num_left_cond=1 -num_left_cond_nr_running=300 -num_left_cond_busy_cpu=3 -num_right_cond=0 - -[Level8] limit_max_freq=1300000 limit_min_cpu=1 num_down_cond=1 -num_down_cond_freq=1100000 +num_down_cond_freq=800000 num_up_cond=1 -num_up_cond_freq=1300000 +num_up_cond_freq=800000 num_left_cond=0 num_right_cond=1 num_right_cond_nr_running=100 num_right_cond_busy_cpu=1 -[Level9] +[Level5] limit_max_freq=1300000 limit_min_cpu=2 num_down_cond=1 -num_down_cond_freq=1100000 +num_down_cond_freq=800000 num_up_cond=1 -num_up_cond_freq=1300000 +num_up_cond_freq=800000 num_left_cond=1 num_left_cond_nr_running=100 num_left_cond_busy_cpu=1 num_right_cond=1 -num_right_cond_nr_running=200 +num_right_cond_nr_running=150 num_right_cond_busy_cpu=2 -[Level10] +[Level6] limit_max_freq=1300000 limit_min_cpu=3 num_down_cond=1 -num_down_cond_freq=1100000 +num_down_cond_freq=800000 num_up_cond=1 -num_up_cond_freq=1300000 +num_up_cond_freq=800000 num_left_cond=1 num_left_cond_nr_running=200 num_left_cond_busy_cpu=2 num_right_cond=1 -num_right_cond_nr_running=300 +num_right_cond_nr_running=250 num_right_cond_busy_cpu=3 -[Level11] +[Level7] limit_max_freq=1300000 limit_min_cpu=4 num_down_cond=1 -num_down_cond_freq=1100000 +num_down_cond_freq=800000 num_up_cond=1 -num_up_cond_freq=1300000 +num_up_cond_freq=800000 num_left_cond=1 -num_left_cond_nr_running=300 +num_left_cond_nr_running=250 num_left_cond_busy_cpu=3 num_right_cond=0 -[Level12] +[Level8] limit_max_freq=1500000 limit_min_cpu=1 num_down_cond=1 -num_down_cond_freq=1300000 +num_down_cond_freq=1000000 num_up_cond=1 -num_up_cond_freq=1500000 +num_up_cond_freq=1000000 num_left_cond=0 num_right_cond=1 num_right_cond_nr_running=100 num_right_cond_busy_cpu=1 -[Level13] +[Level9] limit_max_freq=1500000 limit_min_cpu=2 num_down_cond=1 -num_down_cond_freq=1300000 +num_down_cond_freq=1000000 num_up_cond=1 -num_up_cond_freq=1500000 +num_up_cond_freq=1000000 num_left_cond=1 num_left_cond_nr_running=100 num_left_cond_busy_cpu=1 num_right_cond=1 -num_right_cond_nr_running=200 +num_right_cond_nr_running=150 num_right_cond_busy_cpu=2 -[Level14] +[Level10] limit_max_freq=1500000 limit_min_cpu=3 num_down_cond=1 -num_down_cond_freq=1300000 +num_down_cond_freq=1000000 num_up_cond=1 -num_up_cond_freq=1500000 +num_up_cond_freq=1000000 num_left_cond=1 num_left_cond_nr_running=200 num_left_cond_busy_cpu=2 num_right_cond=1 -num_right_cond_nr_running=300 +num_right_cond_nr_running=250 num_right_cond_busy_cpu=3 -[Level15] +[Level11] limit_max_freq=1500000 limit_min_cpu=4 num_down_cond=1 -num_down_cond_freq=1300000 +num_down_cond_freq=1000000 num_up_cond=1 -num_up_cond_freq=1500000 +num_up_cond_freq=1000000 num_left_cond=1 -num_left_cond_nr_running=300 +num_left_cond_nr_running=250 num_left_cond_busy_cpu=3 num_right_cond=0 -[Level16] +[Level12] limit_max_freq=1700000 limit_min_cpu=1 num_down_cond=1 -num_down_cond_freq=1500000 +num_down_cond_freq=1000000 num_up_cond=0 num_left_cond=0 num_right_cond=1 num_right_cond_nr_running=100 num_right_cond_busy_cpu=1 -[Level17] +[Level13] limit_max_freq=1700000 limit_min_cpu=2 num_down_cond=1 -num_down_cond_freq=1500000 +num_down_cond_freq=1000000 num_up_cond=0 num_left_cond=1 num_left_cond_nr_running=100 num_left_cond_busy_cpu=1 num_right_cond=1 -num_right_cond_nr_running=200 +num_right_cond_nr_running=150 num_right_cond_busy_cpu=2 -[Level18] +[Level14] limit_max_freq=1700000 limit_min_cpu=3 num_down_cond=1 -num_down_cond_freq=1500000 +num_down_cond_freq=1000000 num_up_cond=0 num_left_cond=1 num_left_cond_nr_running=200 num_left_cond_busy_cpu=2 num_right_cond=1 -num_right_cond_nr_running=300 +num_right_cond_nr_running=250 num_right_cond_busy_cpu=3 -[Level19] +[Level15] limit_max_freq=1700000 limit_min_cpu=4 num_down_cond=1 -num_down_cond_freq=1500000 +num_down_cond_freq=1000000 num_up_cond=0 num_left_cond=1 -num_left_cond_nr_running=300 +num_left_cond_nr_running=250 num_left_cond_busy_cpu=3 num_right_cond=0 @@ -279,15 +227,15 @@ pass_num_scenarios=52 name=AppLaunch support=yes -min_level=13 -max_level=15 +min_level=9 +max_level=11 [Scenario1] name=AppLaunchHome support=yes -min_level=13 -max_level=15 +min_level=9 +max_level=11 [Scenario2] name=BeautyShot @@ -305,8 +253,8 @@ support=no name=BrowserJavaScript support=yes -min_level=13 -max_level=15 +min_level=9 +max_level=11 [Scenario6] name=BrowserLoading @@ -464,8 +412,8 @@ support=no name=EmailScroll support=yes -min_level=13 -max_level=15 +min_level=9 +max_level=11 [Scenario45] name=ContactScroll @@ -475,29 +423,29 @@ support=no name=TizenStoreScroll support=yes -min_level=13 -max_level=15 +min_level=9 +max_level=11 [Scenario47] name=CallLogScroll support=yes -min_level=13 -max_level=15 +min_level=9 +max_level=11 [Scenario48] name=MyfilesScroll support=yes -min_level=13 -max_level=15 +min_level=9 +max_level=11 [Scenario49] name=MessageScroll support=yes -min_level=13 -max_level=15 +min_level=9 +max_level=11 [Scenario50] name=SIOP -- 2.7.4 From 1e2823dc0bf7309efe73207b7295a00e703c2fda Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Tue, 28 Mar 2017 20:17:49 +0900 Subject: [PATCH 11/16] pass-hal: tm2: Prevent attempt to turn off CPU0 This patch prevents the attempt to turn off CPU0 because TM2 uses the Exynos5433 SoC which doesn't permit to turn off the CPU0 due to the h/w design issue. Change-Id: I6795aad5ff80c1728db42bc808bac8806d5daa76 Signed-off-by: Chanwoo Choi --- src/cpu/cpu.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index 83bdde0..c837688 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -271,7 +271,6 @@ static int tm2_hotplug_set_online_state(char *res_name, int cpu, int on) char path[PATH_MAX]; int ret; - if ((!res_name)) return -EINVAL; if ((cpu < TM2_CPU_MIN_NUM) || (cpu > TM2_CPU_MAX_NUM)) @@ -279,7 +278,16 @@ static int tm2_hotplug_set_online_state(char *res_name, int cpu, int on) if ((on != CPU_ONLINE_STATE_ON) && (on != CPU_ONLINE_STATE_OFF)) return -EINVAL; - /* TODO: Can we turn off CPU0? */ + /* + * NOTE: Exynos SoC series cannot turn off the CPU0 + * because of h/w design. To prevent the critical problem, + * if someone try to turn off the CPU0, just return without any + * opertaion. + */ + if (on == 0 && cpu == 0) { + _E("cannot turn off the CPU0"); + return 0; + } snprintf(path, PATH_MAX, "%s%d%s", CPU_ONLINE_PATH_PREFIX, -- 2.7.4 From 114211745cd4bac6d6cb953d1d88f1ce7b75c454 Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Wed, 26 Apr 2017 16:33:44 +0900 Subject: [PATCH 12/16] pass-hal: tm2: Add resource name for open and close function This patch just adds the new argument of h/w resource name when calling the open and close functions. The resource name will be used to identify the h/w resource. Change-Id: I4a96eb44dbea3afbc221472a5c51fd0dfc53ca59 Signed-off-by: Chanwoo Choi --- src/bus/bus.c | 4 ++-- src/cpu/cpu.c | 4 ++-- src/gpu/gpu.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bus/bus.c b/src/bus/bus.c index e4c7bbf..989b78e 100644 --- a/src/bus/bus.c +++ b/src/bus/bus.c @@ -172,7 +172,7 @@ static struct pass_resource_dvfs_ops tm2_bus_dvfs_ops = { .get_load_table = NULL, }; -static int tm2_bus_open(struct pass_resource_info *info, +static int tm2_bus_open(char *res_name, struct pass_resource_info *info, struct pass_resource_common **common) { struct pass_resource_bus *bus_res; @@ -193,7 +193,7 @@ static int tm2_bus_open(struct pass_resource_info *info, return 0; } -static int tm2_bus_close(struct pass_resource_common *common) +static int tm2_bus_close(char *res_name, struct pass_resource_common *common) { if (!common) return -EINVAL; diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index c837688..b3a7b77 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -370,7 +370,7 @@ static struct pass_resource_tmu_ops tm2_cpu_tmu_ops = { .get_policy = tm2_tmu_get_policy, }; -static int tm2_cpu_open(struct pass_resource_info *info, +static int tm2_cpu_open(char *res_name, struct pass_resource_info *info, struct pass_resource_common **common) { struct pass_resource_cpu *cpu_res; @@ -393,7 +393,7 @@ static int tm2_cpu_open(struct pass_resource_info *info, return 0; } -static int tm2_cpu_close(struct pass_resource_common *common) +static int tm2_cpu_close(char *res_name, struct pass_resource_common *common) { if (!common) return -EINVAL; diff --git a/src/gpu/gpu.c b/src/gpu/gpu.c index 3ef3c10..7954031 100644 --- a/src/gpu/gpu.c +++ b/src/gpu/gpu.c @@ -224,7 +224,7 @@ static struct pass_resource_tmu_ops tm2_gpu_tmu_ops = { .get_policy = tm2_tmu_get_policy, }; -static int tm2_gpu_open(struct pass_resource_info *info, +static int tm2_gpu_open(char *res_name, struct pass_resource_info *info, struct pass_resource_common **common) { struct pass_resource_gpu *gpu_res; @@ -246,7 +246,7 @@ static int tm2_gpu_open(struct pass_resource_info *info, return 0; } -static int tm2_gpu_close(struct pass_resource_common *common) +static int tm2_gpu_close(char *res_name, struct pass_resource_common *common) { if (!common) return -EINVAL; -- 2.7.4 From ad6ae5ba2e0691ddeb4d3846492cca318a574202 Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Mon, 5 Jun 2017 15:08:11 +0900 Subject: [PATCH 13/16] pass-hal: tm2: Add missing LICENSE file and license information This patch adds the missing license information for *.(c|h). and pass-hal-tm2 uses the Apache-2.0 License. Also, this patch adds the LICENSE file for Apache-2.0. Change-Id: Iec366e8a9cbc4ab6b0fb5c37bfae75d2c23205a4 Signed-off-by: Chanwoo Choi --- LICENSE | 203 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/bus/bus.c | 17 +++++ src/cpu/cpu.c | 17 +++++ src/gpu/gpu.c | 17 +++++ src/shared/sysfs.c | 17 +++++ 5 files changed, 271 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..247c97d --- /dev/null +++ b/LICENSE @@ -0,0 +1,203 @@ +Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/src/bus/bus.c b/src/bus/bus.c index 989b78e..82ca526 100644 --- a/src/bus/bus.c +++ b/src/bus/bus.c @@ -1,3 +1,20 @@ +/* + * PASS (Power Aware System Service) + * + * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #include #include #include diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index b3a7b77..1683cfe 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -1,3 +1,20 @@ +/* + * PASS (Power Aware System Service) + * + * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #include #include #include diff --git a/src/gpu/gpu.c b/src/gpu/gpu.c index 7954031..aaf9cc4 100644 --- a/src/gpu/gpu.c +++ b/src/gpu/gpu.c @@ -1,3 +1,20 @@ +/* + * PASS (Power Aware System Service) + * + * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #include #include #include diff --git a/src/shared/sysfs.c b/src/shared/sysfs.c index 9217b40..57a168b 100644 --- a/src/shared/sysfs.c +++ b/src/shared/sysfs.c @@ -1,3 +1,20 @@ +/* + * PASS (Power Aware System Service) + * + * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #include #include #include -- 2.7.4 From fdc5fb642199d0011134d48e4fe790f178541056 Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Fri, 9 Jun 2017 17:59:31 +0900 Subject: [PATCH 14/16] pass-hal: tm2: Remove unused scenarios This patch removes the unused scenarios except for AppLaunch and UltraPowerSaving. Change-Id: Ic2f1570bf22bd9d2cc5043ff5bb72d9f2fc0abb7 Signed-off-by: Chanwoo Choi --- scripts/pass-resource0.conf | 228 +------------------------------------------- scripts/pass-resource1.conf | 228 +------------------------------------------- scripts/pass-resource2.conf | 228 +------------------------------------------- scripts/pass-resource3.conf | 228 +------------------------------------------- scripts/pass-resource4.conf | 228 +------------------------------------------- 5 files changed, 20 insertions(+), 1120 deletions(-) diff --git a/scripts/pass-resource0.conf b/scripts/pass-resource0.conf index 2e88730..d4223d4 100644 --- a/scripts/pass-resource0.conf +++ b/scripts/pass-resource0.conf @@ -173,236 +173,16 @@ num_right_cond=0 ############################ [PassScenario] pass_scenario_support=yes -pass_num_scenarios=52 +pass_num_scenarios=2 [Scenario0] name=AppLaunch support=yes - min_level=9 max_level=11 [Scenario1] -name=AppLaunchHome -support=yes - -min_level=9 -max_level=11 - -[Scenario2] -name=BeautyShot -support=no - -[Scenario3] -name=Browser -support=no - -[Scenario4] -name=BrowserDash -support=no - -[Scenario5] -name=BrowserJavaScript -support=yes - -min_level=9 -max_level=11 - -[Scenario6] -name=BrowserLoading -support=no - -[Scenario7] -name=BrowserScroll -support=no - -[Scenario8] -name=CallSound -support=no - -[Scenario9] -name=CameraBurstShot -support=no - -[Scenario10] -name=CameraCaptureAtRec -support=no - -[Scenario11] -name=CameraPreview -support=no - -[Scenario12] -name=CameraSoundAndShot -support=no - -[Scenario13] -name=ContactSearch -support=no - -[Scenario14] -name=Emergency -support=no - -[Scenario15] -name=GalleryScroll -support=no - -[Scenario16] -name=GalleryRotation -support=no - -[Scenario17] -name=GetDefaultLockTime -support=no - -[Scenario18] -name=GpsSerialCno -support=no - -[Scenario19] -name=GpuBoost -support=no - -[Scenario20] -name=GpuWakeup -support=no - -[Scenario21] -name=HomeScreen -support=no - -[Scenario22] -name=ImageViewer -support=no - -[Scenario23] -name=IMEInput -support=no - -[Scenario24] -name=LockScreen -support=no - -[Scenario25] -name=LowBattery -support=no - -[Scenario26] -name=MtpSendFile -support=no - -[Scenario27] -name=MusicPlayLcdOn -support=no - -[Scenario28] -name=PowerSaving -support=no - -[Scenario29] -name=ProcessCrashed -support=no - -[Scenario30] -name=ReservedMode -support=no - -[Scenario31] -name=ScreenMirroring -support=no - -[Scenario32] -name=SmemoZoom -support=no - -[Scenario33] -name=SVoice -support=no - -[Scenario34] -name=WebappLaunch -support=no - -[Scenario35] -name=WifiThroughput -support=no - -[Scenario36] -name=PowerOff -support=no - -[Scenario37] -name=WebAppDrag -support=no - -[Scenario38] -name=WebAppFlick -support=no - -[Scenario39] -name=SensorWakeup -support=no - -[Scenario40] -name=UgLaunch -support=no - -[Scenario41] -name=MusicScroll -support=no - -[Scenario42] -name=FileScroll -support=no - -[Scenario43] -name=VideoScroll -support=no - -[Scenario44] -name=EmailScroll -support=yes - -min_level=9 -max_level=11 - -[Scenario45] -name=ContactScroll -support=no - -[Scenario46] -name=TizenStoreScroll -support=yes - -min_level=9 -max_level=11 - -[Scenario47] -name=CallLogScroll -support=yes - -min_level=9 -max_level=11 - -[Scenario48] -name=MyfilesScroll -support=yes - -min_level=9 -max_level=11 - -[Scenario49] -name=MessageScroll -support=yes - -min_level=9 -max_level=11 - -[Scenario50] -name=SIOP -support=no - -[Scenario51] name=UltraPowerSaving -support=no +support=yes +min_level=0 +max_level=0 diff --git a/scripts/pass-resource1.conf b/scripts/pass-resource1.conf index 040388d..0468abd 100644 --- a/scripts/pass-resource1.conf +++ b/scripts/pass-resource1.conf @@ -221,236 +221,16 @@ num_right_cond=0 ############################ [PassScenario] pass_scenario_support=yes -pass_num_scenarios=52 +pass_num_scenarios=2 [Scenario0] name=AppLaunch support=yes - min_level=9 max_level=11 [Scenario1] -name=AppLaunchHome -support=yes - -min_level=9 -max_level=11 - -[Scenario2] -name=BeautyShot -support=no - -[Scenario3] -name=Browser -support=no - -[Scenario4] -name=BrowserDash -support=no - -[Scenario5] -name=BrowserJavaScript -support=yes - -min_level=9 -max_level=11 - -[Scenario6] -name=BrowserLoading -support=no - -[Scenario7] -name=BrowserScroll -support=no - -[Scenario8] -name=CallSound -support=no - -[Scenario9] -name=CameraBurstShot -support=no - -[Scenario10] -name=CameraCaptureAtRec -support=no - -[Scenario11] -name=CameraPreview -support=no - -[Scenario12] -name=CameraSoundAndShot -support=no - -[Scenario13] -name=ContactSearch -support=no - -[Scenario14] -name=Emergency -support=no - -[Scenario15] -name=GalleryScroll -support=no - -[Scenario16] -name=GalleryRotation -support=no - -[Scenario17] -name=GetDefaultLockTime -support=no - -[Scenario18] -name=GpsSerialCno -support=no - -[Scenario19] -name=GpuBoost -support=no - -[Scenario20] -name=GpuWakeup -support=no - -[Scenario21] -name=HomeScreen -support=no - -[Scenario22] -name=ImageViewer -support=no - -[Scenario23] -name=IMEInput -support=no - -[Scenario24] -name=LockScreen -support=no - -[Scenario25] -name=LowBattery -support=no - -[Scenario26] -name=MtpSendFile -support=no - -[Scenario27] -name=MusicPlayLcdOn -support=no - -[Scenario28] -name=PowerSaving -support=no - -[Scenario29] -name=ProcessCrashed -support=no - -[Scenario30] -name=ReservedMode -support=no - -[Scenario31] -name=ScreenMirroring -support=no - -[Scenario32] -name=SmemoZoom -support=no - -[Scenario33] -name=SVoice -support=no - -[Scenario34] -name=WebappLaunch -support=no - -[Scenario35] -name=WifiThroughput -support=no - -[Scenario36] -name=PowerOff -support=no - -[Scenario37] -name=WebAppDrag -support=no - -[Scenario38] -name=WebAppFlick -support=no - -[Scenario39] -name=SensorWakeup -support=no - -[Scenario40] -name=UgLaunch -support=no - -[Scenario41] -name=MusicScroll -support=no - -[Scenario42] -name=FileScroll -support=no - -[Scenario43] -name=VideoScroll -support=no - -[Scenario44] -name=EmailScroll -support=yes - -min_level=9 -max_level=11 - -[Scenario45] -name=ContactScroll -support=no - -[Scenario46] -name=TizenStoreScroll -support=yes - -min_level=9 -max_level=11 - -[Scenario47] -name=CallLogScroll -support=yes - -min_level=9 -max_level=11 - -[Scenario48] -name=MyfilesScroll -support=yes - -min_level=9 -max_level=11 - -[Scenario49] -name=MessageScroll -support=yes - -min_level=9 -max_level=11 - -[Scenario50] -name=SIOP -support=no - -[Scenario51] name=UltraPowerSaving -support=no +support=yes +min_level=0 +max_level=0 diff --git a/scripts/pass-resource2.conf b/scripts/pass-resource2.conf index e525d7c..ed1c893 100644 --- a/scripts/pass-resource2.conf +++ b/scripts/pass-resource2.conf @@ -24,236 +24,16 @@ limit_min_freq=400000000 ############################ [PassScenario] pass_scenario_support=yes -pass_num_scenarios=52 +pass_num_scenarios=2 [Scenario0] name=AppLaunch support=yes - min_level=3 max_level=3 [Scenario1] -name=AppLaunchHome -support=yes - -min_level=3 -max_level=3 - -[Scenario2] -name=BeautyShot -support=no - -[Scenario3] -name=Browser -support=no - -[Scenario4] -name=BrowserDash -support=no - -[Scenario5] -name=BrowserJavaScript -support=yes - -min_level=3 -max_level=3 - -[Scenario6] -name=BrowserLoading -support=no - -[Scenario7] -name=BrowserScroll -support=no - -[Scenario8] -name=CallSound -support=no - -[Scenario9] -name=CameraBurstShot -support=no - -[Scenario10] -name=CameraCaptureAtRec -support=no - -[Scenario11] -name=CameraPreview -support=no - -[Scenario12] -name=CameraSoundAndShot -support=no - -[Scenario13] -name=ContactSearch -support=no - -[Scenario14] -name=Emergency -support=no - -[Scenario15] -name=GalleryScroll -support=no - -[Scenario16] -name=GalleryRotation -support=no - -[Scenario17] -name=GetDefaultLockTime -support=no - -[Scenario18] -name=GpsSerialCno -support=no - -[Scenario19] -name=GpuBoost -support=no - -[Scenario20] -name=GpuWakeup -support=no - -[Scenario21] -name=HomeScreen -support=no - -[Scenario22] -name=ImageViewer -support=no - -[Scenario23] -name=IMEInput -support=no - -[Scenario24] -name=LockScreen -support=no - -[Scenario25] -name=LowBattery -support=no - -[Scenario26] -name=MtpSendFile -support=no - -[Scenario27] -name=MusicPlayLcdOn -support=no - -[Scenario28] -name=PowerSaving -support=no - -[Scenario29] -name=ProcessCrashed -support=no - -[Scenario30] -name=ReservedMode -support=no - -[Scenario31] -name=ScreenMirroring -support=no - -[Scenario32] -name=SmemoZoom -support=no - -[Scenario33] -name=SVoice -support=no - -[Scenario34] -name=WebappLaunch -support=no - -[Scenario35] -name=WifiThroughput -support=no - -[Scenario36] -name=PowerOff -support=no - -[Scenario37] -name=WebAppDrag -support=no - -[Scenario38] -name=WebAppFlick -support=no - -[Scenario39] -name=SensorWakeup -support=no - -[Scenario40] -name=UgLaunch -support=no - -[Scenario41] -name=MusicScroll -support=no - -[Scenario42] -name=FileScroll -support=no - -[Scenario43] -name=VideoScroll -support=no - -[Scenario44] -name=EmailScroll -support=yes - -min_level=3 -max_level=3 - -[Scenario45] -name=ContactScroll -support=no - -[Scenario46] -name=TizenStoreScroll -support=yes - -min_level=3 -max_level=3 - -[Scenario47] -name=CallLogScroll -support=yes - -min_level=3 -max_level=3 - -[Scenario48] -name=MyfilesScroll -support=yes - -min_level=3 -max_level=3 - -[Scenario49] -name=MessageScroll -support=yes - -min_level=3 -max_level=3 - -[Scenario50] -name=SIOP -support=no - -[Scenario51] name=UltraPowerSaving -support=no +support=yes +min_level=0 +max_level=0 diff --git a/scripts/pass-resource3.conf b/scripts/pass-resource3.conf index 9469f74..2b8b368 100644 --- a/scripts/pass-resource3.conf +++ b/scripts/pass-resource3.conf @@ -27,236 +27,16 @@ limit_min_freq=825000000 ############################ [PassScenario] pass_scenario_support=yes -pass_num_scenarios=52 +pass_num_scenarios=2 [Scenario0] name=AppLaunch support=yes - min_level=4 max_level=4 [Scenario1] -name=AppLaunchHome -support=yes - -min_level=4 -max_level=4 - -[Scenario2] -name=BeautyShot -support=no - -[Scenario3] -name=Browser -support=no - -[Scenario4] -name=BrowserDash -support=no - -[Scenario5] -name=BrowserJavaScript -support=yes - -min_level=4 -max_level=4 - -[Scenario6] -name=BrowserLoading -support=no - -[Scenario7] -name=BrowserScroll -support=no - -[Scenario8] -name=CallSound -support=no - -[Scenario9] -name=CameraBurstShot -support=no - -[Scenario10] -name=CameraCaptureAtRec -support=no - -[Scenario11] -name=CameraPreview -support=no - -[Scenario12] -name=CameraSoundAndShot -support=no - -[Scenario13] -name=ContactSearch -support=no - -[Scenario14] -name=Emergency -support=no - -[Scenario15] -name=GalleryScroll -support=no - -[Scenario16] -name=GalleryRotation -support=no - -[Scenario17] -name=GetDefaultLockTime -support=no - -[Scenario18] -name=GpsSerialCno -support=no - -[Scenario19] -name=GpuBoost -support=no - -[Scenario20] -name=GpuWakeup -support=no - -[Scenario21] -name=HomeScreen -support=no - -[Scenario22] -name=ImageViewer -support=no - -[Scenario23] -name=IMEInput -support=no - -[Scenario24] -name=LockScreen -support=no - -[Scenario25] -name=LowBattery -support=no - -[Scenario26] -name=MtpSendFile -support=no - -[Scenario27] -name=MusicPlayLcdOn -support=no - -[Scenario28] -name=PowerSaving -support=no - -[Scenario29] -name=ProcessCrashed -support=no - -[Scenario30] -name=ReservedMode -support=no - -[Scenario31] -name=ScreenMirroring -support=no - -[Scenario32] -name=SmemoZoom -support=no - -[Scenario33] -name=SVoice -support=no - -[Scenario34] -name=WebappLaunch -support=no - -[Scenario35] -name=WifiThroughput -support=no - -[Scenario36] -name=PowerOff -support=no - -[Scenario37] -name=WebAppDrag -support=no - -[Scenario38] -name=WebAppFlick -support=no - -[Scenario39] -name=SensorWakeup -support=no - -[Scenario40] -name=UgLaunch -support=no - -[Scenario41] -name=MusicScroll -support=no - -[Scenario42] -name=FileScroll -support=no - -[Scenario43] -name=VideoScroll -support=no - -[Scenario44] -name=EmailScroll -support=yes - -min_level=4 -max_level=4 - -[Scenario45] -name=ContactScroll -support=no - -[Scenario46] -name=TizenStoreScroll -support=yes - -min_level=4 -max_level=4 - -[Scenario47] -name=CallLogScroll -support=yes - -min_level=4 -max_level=4 - -[Scenario48] -name=MyfilesScroll -support=yes - -min_level=4 -max_level=4 - -[Scenario49] -name=MessageScroll -support=yes - -min_level=4 -max_level=4 - -[Scenario50] -name=SIOP -support=no - -[Scenario51] name=UltraPowerSaving -support=no +support=yes +min_level=0 +max_level=0 diff --git a/scripts/pass-resource4.conf b/scripts/pass-resource4.conf index e7675b3..18cced1 100644 --- a/scripts/pass-resource4.conf +++ b/scripts/pass-resource4.conf @@ -27,236 +27,16 @@ limit_min_freq=700000000 ############################ [PassScenario] pass_scenario_support=yes -pass_num_scenarios=52 +pass_num_scenarios=2 [Scenario0] name=AppLaunch support=yes - min_level=3 max_level=3 [Scenario1] -name=AppLaunchHome -support=yes - -min_level=3 -max_level=3 - -[Scenario2] -name=BeautyShot -support=no - -[Scenario3] -name=Browser -support=no - -[Scenario4] -name=BrowserDash -support=no - -[Scenario5] -name=BrowserJavaScript -support=yes - -min_level=3 -max_level=3 - -[Scenario6] -name=BrowserLoading -support=no - -[Scenario7] -name=BrowserScroll -support=no - -[Scenario8] -name=CallSound -support=no - -[Scenario9] -name=CameraBurstShot -support=no - -[Scenario10] -name=CameraCaptureAtRec -support=no - -[Scenario11] -name=CameraPreview -support=no - -[Scenario12] -name=CameraSoundAndShot -support=no - -[Scenario13] -name=ContactSearch -support=no - -[Scenario14] -name=Emergency -support=no - -[Scenario15] -name=GalleryScroll -support=no - -[Scenario16] -name=GalleryRotation -support=no - -[Scenario17] -name=GetDefaultLockTime -support=no - -[Scenario18] -name=GpsSerialCno -support=no - -[Scenario19] -name=GpuBoost -support=no - -[Scenario20] -name=GpuWakeup -support=no - -[Scenario21] -name=HomeScreen -support=no - -[Scenario22] -name=ImageViewer -support=no - -[Scenario23] -name=IMEInput -support=no - -[Scenario24] -name=LockScreen -support=no - -[Scenario25] -name=LowBattery -support=no - -[Scenario26] -name=MtpSendFile -support=no - -[Scenario27] -name=MusicPlayLcdOn -support=no - -[Scenario28] -name=PowerSaving -support=no - -[Scenario29] -name=ProcessCrashed -support=no - -[Scenario30] -name=ReservedMode -support=no - -[Scenario31] -name=ScreenMirroring -support=no - -[Scenario32] -name=SmemoZoom -support=no - -[Scenario33] -name=SVoice -support=no - -[Scenario34] -name=WebappLaunch -support=no - -[Scenario35] -name=WifiThroughput -support=no - -[Scenario36] -name=PowerOff -support=no - -[Scenario37] -name=WebAppDrag -support=no - -[Scenario38] -name=WebAppFlick -support=no - -[Scenario39] -name=SensorWakeup -support=no - -[Scenario40] -name=UgLaunch -support=no - -[Scenario41] -name=MusicScroll -support=no - -[Scenario42] -name=FileScroll -support=no - -[Scenario43] -name=VideoScroll -support=no - -[Scenario44] -name=EmailScroll -support=yes - -min_level=3 -max_level=3 - -[Scenario45] -name=ContactScroll -support=no - -[Scenario46] -name=TizenStoreScroll -support=yes - -min_level=3 -max_level=3 - -[Scenario47] -name=CallLogScroll -support=yes - -min_level=3 -max_level=3 - -[Scenario48] -name=MyfilesScroll -support=yes - -min_level=3 -max_level=3 - -[Scenario49] -name=MessageScroll -support=yes - -min_level=3 -max_level=3 - -[Scenario50] -name=SIOP -support=no - -[Scenario51] name=UltraPowerSaving -support=no +support=yes +min_level=0 +max_level=0 -- 2.7.4 From a8ae18e9c2ac5108cf5d8381b43723880dfb012b Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Thu, 15 Jun 2017 18:57:04 +0900 Subject: [PATCH 15/16] pass-hal: tm2: Add pass-hal.conf to change the permission of sysfs nodes The pass-hal-tm2 package handles the many sysfs nodes in order to change the state of h/w resources. All sysfs node should be required to change the permission from root to system_fw because PASS daemon has the system_fw permission. So, this patch adds new pass-hal.conf which contains the permission information for the required sysfs nodes. Change-Id: Iab55cdc120e3283e35f2d97b4f3e887400a2fcfd Signed-off-by: Chanwoo Choi --- CMakeLists.txt | 1 + packaging/pass-hal-tm2.spec | 5 ++++- scripts/pass-hal.conf | 30 ++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 scripts/pass-hal.conf diff --git a/CMakeLists.txt b/CMakeLists.txt index 35033cc..edef99c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,3 +25,4 @@ INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/pass-resource1.conf DESTINATIO INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/pass-resource2.conf DESTINATION /etc/pass) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/pass-resource3.conf DESTINATION /etc/pass) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/pass-resource4.conf DESTINATION /etc/pass) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/pass-hal.conf DESTINATION ${LIB_INSTALL_DIR}/tmpfiles.d) diff --git a/packaging/pass-hal-tm2.spec b/packaging/pass-hal-tm2.spec index c5bed67..fe46ef7 100644 --- a/packaging/pass-hal-tm2.spec +++ b/packaging/pass-hal-tm2.spec @@ -36,13 +36,16 @@ rm -rf %{buildroot} %make_install -%post -p /sbin/ldconfig +%post +/sbin/ldconfig +systemd-tmpfiles /usr/lib/tmpfiles.d/pass-hal.conf --create %postun -p /sbin/ldconfig %files %manifest %{name}.manifest %{_libdir}/pass/*.so +%{_libdir}/tmpfiles.d/pass-hal.conf %config %{_sysconfdir}/pass/pass.conf %config %{_sysconfdir}/pass/pass-resource0.conf diff --git a/scripts/pass-hal.conf b/scripts/pass-hal.conf new file mode 100644 index 0000000..5d823db --- /dev/null +++ b/scripts/pass-hal.conf @@ -0,0 +1,30 @@ +z /sys/devices/system/cpu/*/online 0660 root system_fw - +t /sys/devices/system/cpu/*/online - - - - security.SMACK64="System" +z /sys/devices/system/cpu/*/cpufreq/scaling_available_governors 0440 root system_fw - +t /sys/devices/system/cpu/*/cpufreq/scaling_available_governors - - - - security.SMACK64="System" +z /sys/devices/system/cpu/*/cpufreq/cpuinfo_cur_freq 0440 root system_fw - +t /sys/devices/system/cpu/*/cpufreq/cpuinfo_cur_freq - - - - security.SMACK64="System" +z /sys/devices/system/cpu/*/cpufreq/scaling_governor 0660 root system_fw - +t /sys/devices/system/cpu/*/cpufreq/scaling_governor - - - - security.SMACK64="System" +z /sys/devices/system/cpu/*/cpufreq/scaling_min_freq 0660 root system_fw - +t /sys/devices/system/cpu/*/cpufreq/scaling_min_freq - - - - security.SMACK64="System" +z /sys/devices/system/cpu/*/cpufreq/scaling_max_freq 0660 root system_fw - +t /sys/devices/system/cpu/*/cpufreq/scaling_max_freq - - - - security.SMACK64="System" +z /sys/devices/system/cpu/*/cpufreq/ondemand/up_threshold 0660 root system_fw - +t /sys/devices/system/cpu/*/cpufreq/ondemand/up_threshold - - - - security.SMACK64="System" +z /sys/class/thermal/*/temp 0440 root system_fw - +t /sys/class/thermal/*/temp - - - - security.SMACK64="System" +z /sys/class/thermal/*/policy 0440 root system_fw - +t /sys/class/thermal/*/policy - - - - security.SMACK64="System" +z /sys/kernel/debug/cpufreq/*/load_table 0440 root system_fw - +t /sys/kernel/debug/cpufreq/*/load_table - - - - security.SMACK64="System" +z /sys/kernel/debug/cpufreq/*/load_table 0440 root system_fw - +t /sys/kernel/debug/cpufreq/*/load_table - - - - security.SMACK64="System" +z /sys/devices/platform/soc/*/devfreq/*/cur_freq 0440 root system_fw - +t /sys/devices/platform/soc/*/devfreq/*/cur_freq - - - - security.SMACK64="System" +z /sys/devices/platform/soc/*/devfreq/*/governor 0440 root system_fw - +t /sys/devices/platform/soc/*/devfreq/*/governor - - - - security.SMACK64="System" +z /sys/devices/platform/soc/*/devfreq/*/min_freq 0660 root system_fw - +t /sys/devices/platform/soc/*/devfreq/*/min_freq - - - - security.SMACK64="System" +z /sys/devices/platform/soc/*/devfreq/*/max_freq 0660 root system_fw - +t /sys/devices/platform/soc/*/devfreq/*/max_freq - - - - security.SMACK64="System" -- 2.7.4 From e64bfcb2a383029a6c732835c3be5798967e1ab3 Mon Sep 17 00:00:00 2001 From: Wook Song Date: Thu, 22 Jun 2017 14:43:34 +0900 Subject: [PATCH 16/16] pass-hal: tm2: packaging: Fix bug in applying systemd-tmpfiles This patch changes the path which systemd-tmpfiles uses in %post from /usr/lib to %{_libdir}. Since the defualt path for the libraries is /usr/lib64 for aarch64, the daemon does not work properly with the hard-coded path used before. Change-Id: If18c89efe327ec2afc8ee3d974af269dadf56837 Signed-off-by: Wook Song --- packaging/pass-hal-tm2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/pass-hal-tm2.spec b/packaging/pass-hal-tm2.spec index fe46ef7..374a548 100644 --- a/packaging/pass-hal-tm2.spec +++ b/packaging/pass-hal-tm2.spec @@ -38,7 +38,7 @@ rm -rf %{buildroot} %post /sbin/ldconfig -systemd-tmpfiles /usr/lib/tmpfiles.d/pass-hal.conf --create +systemd-tmpfiles %{_libdir}/tmpfiles.d/pass-hal.conf --create %postun -p /sbin/ldconfig -- 2.7.4