android_kernel_samsung_msm8976/include/linux/msm_adreno_devfreq.h
Mihir Patel 72c4388425 msm: kgsl: Dynamic AB voting based on actual bus transactions
Right now AB vote is calulated as a percentage of total possible BW
which causes higher AB vote than actual GPU bus transactions in some
use cases. We can calculate actual GPU bus BW if we know bus_width
for the target. This change will derive AB vote based on bus_width
defined in dtsi and VBIF counters.

Define bus_width in number of bytes in target gpu dtsi file to use
this new AB vote calculation.

Change-Id: I75d19c18649d9a87d20e3dbf7b623b772265fb5b
Signed-off-by: Mihir Patel <mihirp@codeaurora.org>
2015-05-12 14:58:23 +05:30

75 lines
1.7 KiB
C

#ifndef MSM_ADRENO_DEVFREQ_H
#define MSM_ADRENO_DEVFREQ_H
#include <linux/devfreq.h>
#include <linux/notifier.h>
#define ADRENO_DEVFREQ_NOTIFY_SUBMIT 1
#define ADRENO_DEVFREQ_NOTIFY_RETIRE 2
#define ADRENO_DEVFREQ_NOTIFY_IDLE 3
struct device;
int kgsl_devfreq_add_notifier(struct device *, struct notifier_block *);
int kgsl_devfreq_del_notifier(struct device *, struct notifier_block *);
/* same as KGSL_MAX_PWRLEVELS */
#define MSM_ADRENO_MAX_PWRLEVELS 10
struct xstats {
u64 ram_time;
u64 ram_wait;
int mod;
};
struct devfreq_msm_adreno_tz_data {
struct notifier_block nb;
struct {
s64 total_time;
s64 busy_time;
} bin;
struct {
u64 total_time;
u64 ram_time;
u64 ram_wait;
u64 gpu_time;
u32 num;
u32 max;
u32 width;
u32 up[MSM_ADRENO_MAX_PWRLEVELS];
u32 down[MSM_ADRENO_MAX_PWRLEVELS];
u32 p_up[MSM_ADRENO_MAX_PWRLEVELS];
u32 p_down[MSM_ADRENO_MAX_PWRLEVELS];
unsigned int *index;
uint64_t *ib;
} bus;
unsigned int device_id;
bool is_64;
};
struct msm_adreno_extended_profile {
struct devfreq_msm_adreno_tz_data *private_data;
struct devfreq *bus_devfreq;
struct workqueue_struct *partner_wq;
struct work_struct partner_start_event_ws;
struct work_struct partner_stop_event_ws;
struct work_struct partner_suspend_event_ws;
struct work_struct partner_resume_event_ws;
struct devfreq_dev_profile profile;
};
struct msm_busmon_extended_profile {
u32 flag;
unsigned long percent_ab;
unsigned long ab_mbytes;
struct devfreq_msm_adreno_tz_data *private_data;
struct devfreq_dev_profile profile;
};
#ifdef CONFIG_DEVFREQ_GOV_MSM_GPUBW_MON
int devfreq_vbif_update_bw(unsigned long ib, unsigned long ab);
int devfreq_vbif_register_callback(void *);
#endif
#endif