From: Soomin Kim Date: Mon, 22 May 2017 05:35:58 +0000 (+0900) Subject: [COMMON] power: qos: Add new qos class for devfreq X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ec3b0a5c2144435fffa699905f34feb88772509b;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] power: qos: Add new qos class for devfreq Change-Id: I16d41ed16242fe4abc8c11301af5ca41eaa13ef8 Signed-off-by: Soomin Kim --- diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h index 032d4d824ee5..7b2919afe017 100644 --- a/include/linux/pm_qos.h +++ b/include/linux/pm_qos.h @@ -29,10 +29,17 @@ enum { PM_QOS_DISPLAY_THROUGHPUT_MAX, #endif PM_QOS_CAM_THROUGHPUT, + PM_QOS_AUD_THROUGHPUT, + PM_QOS_IVA_THROUGHPUT, + PM_QOS_SCORE_THROUGHPUT, + PM_QOS_FSYS0_THROUGHPUT, #ifdef CONFIG_ARM_EXYNOS_DEVFREQ_DEBUG PM_QOS_CAM_THROUGHPUT_MAX, + PM_QOS_AUD_THROUGHPUT_MAX, + PM_QOS_IVA_THROUGHPUT_MAX, + PM_QOS_SCORE_THROUGHPUT_MAX, + PM_QOS_FSYS0_THROUGHPUT_MAX, #endif - /* insert new class ID */ PM_QOS_NUM_CLASSES, }; @@ -61,8 +68,16 @@ enum pm_qos_flags_status { #define PM_QOS_DISPLAY_THROUGHPUT_MAX_DEFAULT_VALUE INT_MAX #endif #define PM_QOS_CAM_THROUGHPUT_DEFAULT_VALUE 0 +#define PM_QOS_AUD_THROUGHPUT_DEFAULT_VALUE 0 +#define PM_QOS_IVA_THROUGHPUT_DEFAULT_VALUE 0 +#define PM_QOS_SCORE_THROUGHPUT_DEFAULT_VALUE 0 +#define PM_QOS_FSYS0_THROUGHPUT_DEFAULT_VALUE 0 #ifdef CONFIG_ARM_EXYNOS_DEVFREQ_DEBUG -#define PM_QOS_CAM_THROUGHPUT_MAX_DEFAULT_VALUE INT_MAX +#define PM_QOS_CAM_THROUGHPUT_MAX_DEFAULT_VALUE INT_MAX +#define PM_QOS_AUD_THROUGHPUT_MAX_DEFAULT_VALUE INT_MAX +#define PM_QOS_IVA_THROUGHPUT_MAX_DEFAULT_VALUE INT_MAX +#define PM_QOS_SCORE_THROUGHPUT_MAX_DEFAULT_VALUE INT_MAX +#define PM_QOS_FSYS0_THROUGHPUT_MAX_DEFAULT_VALUE INT_MAX #endif #define PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE 0 #define PM_QOS_MEMORY_BANDWIDTH_DEFAULT_VALUE 0 diff --git a/kernel/power/qos.c b/kernel/power/qos.c index 0135a63515b8..c63e1c5ee1a5 100644 --- a/kernel/power/qos.c +++ b/kernel/power/qos.c @@ -245,6 +245,58 @@ static struct pm_qos_object cam_throughput_pm_qos = { .name = "cam_throughput", }; +static BLOCKING_NOTIFIER_HEAD(aud_throughput_notifier); +static struct pm_qos_constraints aud_tput_constraints = { + .list = PLIST_HEAD_INIT(aud_tput_constraints.list), + .target_value = PM_QOS_AUD_THROUGHPUT_DEFAULT_VALUE, + .default_value = PM_QOS_AUD_THROUGHPUT_DEFAULT_VALUE, + .type = PM_QOS_MAX, + .notifiers = &aud_throughput_notifier, +}; +static struct pm_qos_object aud_throughput_pm_qos = { + .constraints = &aud_tput_constraints, + .name = "aud_throughput", +}; + +static BLOCKING_NOTIFIER_HEAD(iva_throughput_notifier); +static struct pm_qos_constraints iva_tput_constraints = { + .list = PLIST_HEAD_INIT(iva_tput_constraints.list), + .target_value = PM_QOS_IVA_THROUGHPUT_DEFAULT_VALUE, + .default_value = PM_QOS_IVA_THROUGHPUT_DEFAULT_VALUE, + .type = PM_QOS_MAX, + .notifiers = &iva_throughput_notifier, +}; +static struct pm_qos_object iva_throughput_pm_qos = { + .constraints = &iva_tput_constraints, + .name = "iva_throughput", +}; + +static BLOCKING_NOTIFIER_HEAD(score_throughput_notifier); +static struct pm_qos_constraints score_tput_constraints = { + .list = PLIST_HEAD_INIT(score_tput_constraints.list), + .target_value = PM_QOS_SCORE_THROUGHPUT_DEFAULT_VALUE, + .default_value = PM_QOS_SCORE_THROUGHPUT_DEFAULT_VALUE, + .type = PM_QOS_MAX, + .notifiers = &score_throughput_notifier, +}; +static struct pm_qos_object score_throughput_pm_qos = { + .constraints = &score_tput_constraints, + .name = "score_throughput", +}; + +static BLOCKING_NOTIFIER_HEAD(fsys0_throughput_notifier); +static struct pm_qos_constraints fsys0_tput_constraints = { + .list = PLIST_HEAD_INIT(fsys0_tput_constraints.list), + .target_value = PM_QOS_FSYS0_THROUGHPUT_DEFAULT_VALUE, + .default_value = PM_QOS_FSYS0_THROUGHPUT_DEFAULT_VALUE, + .type = PM_QOS_MAX, + .notifiers = &fsys0_throughput_notifier, +}; +static struct pm_qos_object fsys0_throughput_pm_qos = { + .constraints = &fsys0_tput_constraints, + .name = "fsys0_throughput", +}; + #ifdef CONFIG_ARM_EXYNOS_DEVFREQ_DEBUG static BLOCKING_NOTIFIER_HEAD(cam_throughput_max_notifier); static struct pm_qos_constraints cam_tput_max_constraints = { @@ -258,6 +310,58 @@ static struct pm_qos_object cam_throughput_max_pm_qos = { .constraints = &cam_tput_max_constraints, .name = "cam_throughput_max", }; + +static BLOCKING_NOTIFIER_HEAD(aud_throughput_max_notifier); +static struct pm_qos_constraints aud_tput_max_constraints = { + .list = PLIST_HEAD_INIT(aud_tput_max_constraints.list), + .target_value = PM_QOS_AUD_THROUGHPUT_MAX_DEFAULT_VALUE, + .default_value = PM_QOS_AUD_THROUGHPUT_MAX_DEFAULT_VALUE, + .type = PM_QOS_MIN, + .notifiers = &aud_throughput_max_notifier, +}; +static struct pm_qos_object aud_throughput_max_pm_qos = { + .constraints = &aud_tput_max_constraints, + .name = "aud_throughput_max", +}; + +static BLOCKING_NOTIFIER_HEAD(iva_throughput_max_notifier); +static struct pm_qos_constraints iva_tput_max_constraints = { + .list = PLIST_HEAD_INIT(iva_tput_max_constraints.list), + .target_value = PM_QOS_IVA_THROUGHPUT_MAX_DEFAULT_VALUE, + .default_value = PM_QOS_IVA_THROUGHPUT_MAX_DEFAULT_VALUE, + .type = PM_QOS_MIN, + .notifiers = &iva_throughput_max_notifier, +}; +static struct pm_qos_object iva_throughput_max_pm_qos = { + .constraints = &iva_tput_max_constraints, + .name = "iva_throughput_max", +}; + +static BLOCKING_NOTIFIER_HEAD(score_throughput_max_notifier); +static struct pm_qos_constraints score_tput_max_constraints = { + .list = PLIST_HEAD_INIT(score_tput_max_constraints.list), + .target_value = PM_QOS_SCORE_THROUGHPUT_MAX_DEFAULT_VALUE, + .default_value = PM_QOS_SCORE_THROUGHPUT_MAX_DEFAULT_VALUE, + .type = PM_QOS_MIN, + .notifiers = &score_throughput_max_notifier, +}; +static struct pm_qos_object score_throughput_max_pm_qos = { + .constraints = &score_tput_max_constraints, + .name = "score_throughput_max", +}; + +static BLOCKING_NOTIFIER_HEAD(fsys0_throughput_max_notifier); +static struct pm_qos_constraints fsys0_tput_max_constraints = { + .list = PLIST_HEAD_INIT(fsys0_tput_max_constraints.list), + .target_value = PM_QOS_FSYS0_THROUGHPUT_MAX_DEFAULT_VALUE, + .default_value = PM_QOS_FSYS0_THROUGHPUT_MAX_DEFAULT_VALUE, + .type = PM_QOS_MIN, + .notifiers = &fsys0_throughput_max_notifier, +}; +static struct pm_qos_object fsys0_throughput_max_pm_qos = { + .constraints = &fsys0_tput_max_constraints, + .name = "fsys0_throughput_max", +}; #endif static struct pm_qos_object *pm_qos_array[] = { @@ -279,8 +383,16 @@ static struct pm_qos_object *pm_qos_array[] = { &display_throughput_max_pm_qos, #endif &cam_throughput_pm_qos, + &aud_throughput_pm_qos, + &iva_throughput_pm_qos, + &score_throughput_pm_qos, + &fsys0_throughput_pm_qos, #ifdef CONFIG_ARM_EXYNOS_DEVFREQ_DEBUG &cam_throughput_max_pm_qos, + &aud_throughput_max_pm_qos, + &iva_throughput_max_pm_qos, + &score_throughput_max_pm_qos, + &fsys0_throughput_max_pm_qos, #endif };