OSDN Git Service

Merge 72078891843ce0d5b8e95040d09ba92913916af9 on remote branch
[sagit-ice-cold/kernel_xiaomi_msm8998.git] / include / linux / msm_adreno_devfreq.h
1 #ifndef MSM_ADRENO_DEVFREQ_H
2 #define MSM_ADRENO_DEVFREQ_H
3
4 #include <linux/devfreq.h>
5 #include <linux/notifier.h>
6
7 #define ADRENO_DEVFREQ_NOTIFY_SUBMIT    1
8 #define ADRENO_DEVFREQ_NOTIFY_RETIRE    2
9 #define ADRENO_DEVFREQ_NOTIFY_IDLE      3
10
11 struct device;
12
13 int kgsl_devfreq_add_notifier(struct device *, struct notifier_block *);
14
15 int kgsl_devfreq_del_notifier(struct device *, struct notifier_block *);
16
17 /* same as KGSL_MAX_PWRLEVELS */
18 #define MSM_ADRENO_MAX_PWRLEVELS 10
19
20 struct xstats {
21         u64 ram_time;
22         u64 ram_wait;
23         int mod;
24 };
25
26 struct devfreq_msm_adreno_tz_data {
27         struct notifier_block nb;
28         struct {
29                 s64 total_time;
30                 s64 busy_time;
31                 u32 ctxt_aware_target_pwrlevel;
32                 u32 ctxt_aware_busy_penalty;
33         } bin;
34         struct {
35                 u64 total_time;
36                 u64 ram_time;
37                 u64 ram_wait;
38                 u64 gpu_time;
39                 u32 num;
40                 u32 max;
41                 u32 width;
42                 u32 *up;
43                 u32 *down;
44                 u32 *p_up;
45                 u32 *p_down;
46                 unsigned int *index;
47                 uint64_t *ib;
48         } bus;
49         unsigned int device_id;
50         bool is_64;
51         bool disable_busy_time_burst;
52         bool ctxt_aware_enable;
53 };
54
55 struct msm_adreno_extended_profile {
56         struct devfreq_msm_adreno_tz_data *private_data;
57         struct devfreq *bus_devfreq;
58         struct workqueue_struct *partner_wq;
59         struct work_struct partner_start_event_ws;
60         struct work_struct partner_stop_event_ws;
61         struct work_struct partner_suspend_event_ws;
62         struct work_struct partner_resume_event_ws;
63         struct devfreq_dev_profile profile;
64 };
65
66 struct msm_busmon_extended_profile {
67         u32 flag;
68         unsigned long percent_ab;
69         unsigned long ab_mbytes;
70         struct devfreq_msm_adreno_tz_data *private_data;
71         struct devfreq_dev_profile profile;
72 };
73
74 #ifdef CONFIG_DEVFREQ_GOV_QCOM_GPUBW_MON
75 int devfreq_vbif_update_bw(unsigned long ib, unsigned long ab);
76 int devfreq_vbif_register_callback(void *);
77 #endif
78
79 #endif