drm/panel: add support for Sharp F402 2048x1536 panel
[firefly-linux-kernel-4.4.55.git] / kernel / sched / walt.h
1 /*
2  * Copyright (c) 2016, The Linux Foundation. All rights reserved.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 and
6  * only version 2 as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  * GNU General Public License for more details.
12  */
13
14 #ifndef __WALT_H
15 #define __WALT_H
16
17 #ifdef CONFIG_SCHED_WALT
18
19 void walt_update_task_ravg(struct task_struct *p, struct rq *rq, int event,
20                 u64 wallclock, u64 irqtime);
21 void walt_inc_cumulative_runnable_avg(struct rq *rq, struct task_struct *p);
22 void walt_dec_cumulative_runnable_avg(struct rq *rq, struct task_struct *p);
23 void walt_inc_cfs_cumulative_runnable_avg(struct cfs_rq *rq,
24                 struct task_struct *p);
25 void walt_dec_cfs_cumulative_runnable_avg(struct cfs_rq *rq,
26                 struct task_struct *p);
27 void walt_fixup_busy_time(struct task_struct *p, int new_cpu);
28 void walt_init_new_task_load(struct task_struct *p);
29 void walt_mark_task_starting(struct task_struct *p);
30 void walt_set_window_start(struct rq *rq);
31 void walt_migrate_sync_cpu(int cpu);
32 void walt_init_cpu_efficiency(void);
33 u64 walt_ktime_clock(void);
34 void walt_account_irqtime(int cpu, struct task_struct *curr, u64 delta,
35                                   u64 wallclock);
36
37 u64 walt_irqload(int cpu);
38 int walt_cpu_high_irqload(int cpu);
39
40 #else /* CONFIG_SCHED_WALT */
41
42 static inline void walt_update_task_ravg(struct task_struct *p, struct rq *rq,
43                 int event, u64 wallclock, u64 irqtime) { }
44 static inline void walt_inc_cumulative_runnable_avg(struct rq *rq, struct task_struct *p) { }
45 static inline void walt_dec_cumulative_runnable_avg(struct rq *rq, struct task_struct *p) { }
46 static inline void walt_inc_cfs_cumulative_runnable_avg(struct cfs_rq *rq,
47                 struct task_struct *p) { }
48 static inline void walt_dec_cfs_cumulative_runnable_avg(struct cfs_rq *rq,
49                 struct task_struct *p) { }
50 static inline void walt_fixup_busy_time(struct task_struct *p, int new_cpu) { }
51 static inline void walt_init_new_task_load(struct task_struct *p) { }
52 static inline void walt_mark_task_starting(struct task_struct *p) { }
53 static inline void walt_set_window_start(struct rq *rq) { }
54 static inline void walt_migrate_sync_cpu(int cpu) { }
55 static inline void walt_init_cpu_efficiency(void) { }
56 static inline u64 walt_ktime_clock(void) { return 0; }
57
58 #endif /* CONFIG_SCHED_WALT */
59
60 extern unsigned int walt_disabled;
61
62 #endif