From 9e425a41944cd0ca1720969ef8648c8a0fbb5546 Mon Sep 17 00:00:00 2001 From: Sangkyu Kim Date: Thu, 12 Sep 2013 13:49:45 +0900 Subject: [PATCH] PM Qos: add display class and cam class to control qos Change-Id: I7467993168c62e3ae215c43800ebf95559b5e8f8 Signed-off-by: Sangkyu Kim --- include/linux/pm_qos.h | 4 ++++ kernel/power/qos.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h index 2b6db0abe70a..b4ece3c86581 100644 --- a/include/linux/pm_qos.h +++ b/include/linux/pm_qos.h @@ -18,6 +18,8 @@ enum { PM_QOS_BUS_THROUGHPUT, PM_QOS_NETWORK_THROUGHPUT, PM_QOS_MEMORY_BANDWIDTH, + PM_QOS_DISPLAY_THROUGHPUT, + PM_QOS_CAM_THROUGHPUT, /* insert new class ID */ PM_QOS_NUM_CLASSES, @@ -36,6 +38,8 @@ enum pm_qos_flags_status { #define PM_QOS_NETWORK_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC) #define PM_QOS_DEVICE_THROUGHPUT_DEFAULT_VALUE 0 #define PM_QOS_BUS_THROUGHPUT_DEFAULT_VALUE 0 +#define PM_QOS_DISPLAY_THROUGHPUT_DEFAULT_VALUE 0 +#define PM_QOS_CAM_THROUGHPUT_DEFAULT_VALUE 0 #define PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE 0 #define PM_QOS_MEMORY_BANDWIDTH_DEFAULT_VALUE 0 #define PM_QOS_RESUME_LATENCY_DEFAULT_VALUE 0 diff --git a/kernel/power/qos.c b/kernel/power/qos.c index b5c010b6db50..555709dd8198 100644 --- a/kernel/power/qos.c +++ b/kernel/power/qos.c @@ -148,6 +148,33 @@ static struct pm_qos_object memory_bandwidth_pm_qos = { }; +static BLOCKING_NOTIFIER_HEAD(display_throughput_notifier); +static struct pm_qos_constraints display_tput_constraints = { + .list = PLIST_HEAD_INIT(display_tput_constraints.list), + .target_value = PM_QOS_DISPLAY_THROUGHPUT_DEFAULT_VALUE, + .default_value = PM_QOS_DISPLAY_THROUGHPUT_DEFAULT_VALUE, + .type = PM_QOS_MAX, + .notifiers = &display_throughput_notifier, +}; +static struct pm_qos_object display_throughput_pm_qos = { + .constraints = &display_tput_constraints, + .name = "display_throughput", +}; + +static BLOCKING_NOTIFIER_HEAD(cam_throughput_notifier); +static struct pm_qos_constraints cam_tput_constraints = { + .list = PLIST_HEAD_INIT(cam_tput_constraints.list), + .target_value = PM_QOS_CAM_THROUGHPUT_DEFAULT_VALUE, + .default_value = PM_QOS_CAM_THROUGHPUT_DEFAULT_VALUE, + .type = PM_QOS_MAX, + .notifiers = &cam_throughput_notifier, +}; +static struct pm_qos_object cam_throughput_pm_qos = { + .constraints = &cam_tput_constraints, + .name = "cam_throughput", +}; + + static struct pm_qos_object *pm_qos_array[] = { &null_pm_qos, &cpu_dma_pm_qos, @@ -156,6 +183,8 @@ static struct pm_qos_object *pm_qos_array[] = { &bus_throughput_pm_qos, &network_throughput_pm_qos, &memory_bandwidth_pm_qos, + &display_throughput_pm_qos, + &cam_throughput_pm_qos, }; static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf, -- 2.20.1