Loading drivers/gpu/msm/kgsl_pwrctrl.c +24 −1 Original line number Diff line number Diff line Loading @@ -1015,6 +1015,7 @@ EXPORT_SYMBOL(kgsl_pwrctrl_irq); int kgsl_pwrctrl_init(struct kgsl_device *device) { int i, k, m, n = 0, result = 0; int freq_i; struct clk *clk; struct platform_device *pdev = container_of(device->parentdev, struct platform_device, dev); Loading Loading @@ -1105,6 +1106,17 @@ int kgsl_pwrctrl_init(struct kgsl_device *device) /* Set if independent bus BW voting is supported */ pwr->bus_control = pdata->bus_control; /* * Set the range permitted for BIMC votes per-GPU frequency. * For the moment assume the BIMC votes are listed in order * per GPU frequency. If this is no longer needed in the bus * table the min/max values can be explicitly set in the dtsi * file. */ freq_i = pwr->min_pwrlevel; pwr->pwrlevels[freq_i].bus_min = 1; /* * Pull the BW vote out of the bus table. They will be used to * calculate the ratio between the votes. Loading @@ -1116,8 +1128,17 @@ int kgsl_pwrctrl_init(struct kgsl_device *device) if (vector->dst == MSM_BUS_SLAVE_EBI_CH0 && vector->ib != 0) { for (k = 0; k < n; k++) if (vector->ib == pwr->bus_ib[k]) if (vector->ib == pwr->bus_ib[k]) { static uint64_t last_ib = 0xFFFFFFFF; if (vector->ib <= last_ib) { pwr->pwrlevels[freq_i--]. bus_max = i - 1; pwr->pwrlevels[freq_i]. bus_min = i; } last_ib = vector->ib; break; } /* if this is a new ib value, save it */ if (k == n) { pwr->bus_ib[k] = vector->ib; Loading @@ -1133,6 +1154,8 @@ int kgsl_pwrctrl_init(struct kgsl_device *device) } } } pwr->pwrlevels[freq_i].bus_max = i - 1; return result; clk_err: Loading drivers/gpu/msm/kgsl_pwrscale.c +8 −6 Original line number Diff line number Diff line Loading @@ -185,6 +185,7 @@ int kgsl_devfreq_target(struct device *dev, unsigned long *freq, u32 flags) { struct kgsl_device *device = dev_get_drvdata(dev); struct kgsl_pwrctrl *pwr; struct kgsl_pwrlevel *pwr_level; int level, i, b; unsigned long cur_freq; Loading @@ -208,6 +209,7 @@ int kgsl_devfreq_target(struct device *dev, unsigned long *freq, u32 flags) mutex_lock(&device->mutex); cur_freq = kgsl_pwrctrl_active_freq(pwr); level = pwr->active_pwrlevel; pwr_level = &pwr->pwrlevels[level]; if (*freq != cur_freq) { level = pwr->max_pwrlevel; Loading @@ -224,13 +226,13 @@ int kgsl_devfreq_target(struct device *dev, unsigned long *freq, u32 flags) */ b = pwr->bus_mod; if ((flags & DEVFREQ_FLAG_FAST_HINT) && (pwr->bus_mod != FAST_BUS)) pwr->bus_mod = (pwr->bus_mod == SLOW_BUS) ? 0 : FAST_BUS; ((pwr_level->bus_freq + pwr->bus_mod) < pwr_level->bus_max)) pwr->bus_mod++; else if ((flags & DEVFREQ_FLAG_SLOW_HINT) && (pwr->bus_mod != SLOW_BUS)) pwr->bus_mod = (pwr->bus_mod == FAST_BUS) ? 0 : SLOW_BUS; ((pwr_level->bus_freq + pwr->bus_mod) > pwr_level->bus_min)) pwr->bus_mod--; if (pwr->bus_mod != b) kgsl_pwrctrl_buslevel_update(device, true); } Loading include/linux/msm_kgsl.h +5 −1 Original line number Diff line number Diff line Loading @@ -54,12 +54,16 @@ struct kgsl_device_iommu_data { * struct kgsl_pwrlevel - Struct holding different pwrlevel info obtained from * from dtsi file * @gpu_freq: GPU frequency vote in Hz * @bus_freq: Bus bandwidth vote in Mbps * @bus_freq: Bus bandwidth vote index * @bus_min: Min bus index @gpu_freq * @bus_max: Max bus index @gpu_freq * @io_fraction: IO percetage vote to the CPU */ struct kgsl_pwrlevel { unsigned int gpu_freq; unsigned int bus_freq; unsigned int bus_min; unsigned int bus_max; unsigned int io_fraction; }; Loading Loading
drivers/gpu/msm/kgsl_pwrctrl.c +24 −1 Original line number Diff line number Diff line Loading @@ -1015,6 +1015,7 @@ EXPORT_SYMBOL(kgsl_pwrctrl_irq); int kgsl_pwrctrl_init(struct kgsl_device *device) { int i, k, m, n = 0, result = 0; int freq_i; struct clk *clk; struct platform_device *pdev = container_of(device->parentdev, struct platform_device, dev); Loading Loading @@ -1105,6 +1106,17 @@ int kgsl_pwrctrl_init(struct kgsl_device *device) /* Set if independent bus BW voting is supported */ pwr->bus_control = pdata->bus_control; /* * Set the range permitted for BIMC votes per-GPU frequency. * For the moment assume the BIMC votes are listed in order * per GPU frequency. If this is no longer needed in the bus * table the min/max values can be explicitly set in the dtsi * file. */ freq_i = pwr->min_pwrlevel; pwr->pwrlevels[freq_i].bus_min = 1; /* * Pull the BW vote out of the bus table. They will be used to * calculate the ratio between the votes. Loading @@ -1116,8 +1128,17 @@ int kgsl_pwrctrl_init(struct kgsl_device *device) if (vector->dst == MSM_BUS_SLAVE_EBI_CH0 && vector->ib != 0) { for (k = 0; k < n; k++) if (vector->ib == pwr->bus_ib[k]) if (vector->ib == pwr->bus_ib[k]) { static uint64_t last_ib = 0xFFFFFFFF; if (vector->ib <= last_ib) { pwr->pwrlevels[freq_i--]. bus_max = i - 1; pwr->pwrlevels[freq_i]. bus_min = i; } last_ib = vector->ib; break; } /* if this is a new ib value, save it */ if (k == n) { pwr->bus_ib[k] = vector->ib; Loading @@ -1133,6 +1154,8 @@ int kgsl_pwrctrl_init(struct kgsl_device *device) } } } pwr->pwrlevels[freq_i].bus_max = i - 1; return result; clk_err: Loading
drivers/gpu/msm/kgsl_pwrscale.c +8 −6 Original line number Diff line number Diff line Loading @@ -185,6 +185,7 @@ int kgsl_devfreq_target(struct device *dev, unsigned long *freq, u32 flags) { struct kgsl_device *device = dev_get_drvdata(dev); struct kgsl_pwrctrl *pwr; struct kgsl_pwrlevel *pwr_level; int level, i, b; unsigned long cur_freq; Loading @@ -208,6 +209,7 @@ int kgsl_devfreq_target(struct device *dev, unsigned long *freq, u32 flags) mutex_lock(&device->mutex); cur_freq = kgsl_pwrctrl_active_freq(pwr); level = pwr->active_pwrlevel; pwr_level = &pwr->pwrlevels[level]; if (*freq != cur_freq) { level = pwr->max_pwrlevel; Loading @@ -224,13 +226,13 @@ int kgsl_devfreq_target(struct device *dev, unsigned long *freq, u32 flags) */ b = pwr->bus_mod; if ((flags & DEVFREQ_FLAG_FAST_HINT) && (pwr->bus_mod != FAST_BUS)) pwr->bus_mod = (pwr->bus_mod == SLOW_BUS) ? 0 : FAST_BUS; ((pwr_level->bus_freq + pwr->bus_mod) < pwr_level->bus_max)) pwr->bus_mod++; else if ((flags & DEVFREQ_FLAG_SLOW_HINT) && (pwr->bus_mod != SLOW_BUS)) pwr->bus_mod = (pwr->bus_mod == FAST_BUS) ? 0 : SLOW_BUS; ((pwr_level->bus_freq + pwr->bus_mod) > pwr_level->bus_min)) pwr->bus_mod--; if (pwr->bus_mod != b) kgsl_pwrctrl_buslevel_update(device, true); } Loading
include/linux/msm_kgsl.h +5 −1 Original line number Diff line number Diff line Loading @@ -54,12 +54,16 @@ struct kgsl_device_iommu_data { * struct kgsl_pwrlevel - Struct holding different pwrlevel info obtained from * from dtsi file * @gpu_freq: GPU frequency vote in Hz * @bus_freq: Bus bandwidth vote in Mbps * @bus_freq: Bus bandwidth vote index * @bus_min: Min bus index @gpu_freq * @bus_max: Max bus index @gpu_freq * @io_fraction: IO percetage vote to the CPU */ struct kgsl_pwrlevel { unsigned int gpu_freq; unsigned int bus_freq; unsigned int bus_min; unsigned int bus_max; unsigned int io_fraction; }; Loading