mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
Revert "MALI: midgard: avoid GPU voltage domain keeping the initial voltage"
This reverts commit 57984d5318.
Change-Id: If538c9bbeb5d3fc7302f9683cb85f8acdd309a09
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
This commit is contained in:
@@ -53,7 +53,6 @@ kbase_devfreq_target(struct device *dev, unsigned long *target_freq, u32 flags)
|
||||
struct kbase_device *kbdev = dev_get_drvdata(dev);
|
||||
struct dev_pm_opp *opp;
|
||||
unsigned long freq = 0;
|
||||
unsigned long old_freq = kbdev->current_freq;
|
||||
unsigned long voltage;
|
||||
int err = 0;
|
||||
|
||||
@@ -71,24 +70,14 @@ kbase_devfreq_target(struct device *dev, unsigned long *target_freq, u32 flags)
|
||||
/*
|
||||
* Only update if there is a change of frequency
|
||||
*/
|
||||
if (old_freq == freq) {
|
||||
if (kbdev->current_freq == freq) {
|
||||
*target_freq = freq;
|
||||
#ifdef CONFIG_REGULATOR
|
||||
if (kbdev->current_voltage == voltage)
|
||||
return 0;
|
||||
err = regulator_set_voltage(kbdev->regulator, voltage, voltage);
|
||||
if (err) {
|
||||
dev_err(dev, "Failed to set voltage (%d)\n", err);
|
||||
return err;
|
||||
}
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONFIG_REGULATOR
|
||||
if (kbdev->regulator && kbdev->current_voltage != voltage &&
|
||||
old_freq < freq) {
|
||||
if (kbdev->regulator && kbdev->current_voltage != voltage
|
||||
&& kbdev->current_freq < freq) {
|
||||
err = regulator_set_voltage(kbdev->regulator, voltage, voltage);
|
||||
if (err) {
|
||||
dev_err(dev, "Failed to increase voltage (%d)\n", err);
|
||||
@@ -107,12 +96,10 @@ kbase_devfreq_target(struct device *dev, unsigned long *target_freq, u32 flags)
|
||||
freq, *target_freq);
|
||||
return err;
|
||||
}
|
||||
*target_freq = freq;
|
||||
kbdev->current_freq = freq;
|
||||
|
||||
#ifdef CONFIG_REGULATOR
|
||||
if (kbdev->regulator && kbdev->current_voltage != voltage &&
|
||||
old_freq > freq) {
|
||||
if (kbdev->regulator && kbdev->current_voltage != voltage
|
||||
&& kbdev->current_freq > freq) {
|
||||
err = regulator_set_voltage(kbdev->regulator, voltage, voltage);
|
||||
if (err) {
|
||||
dev_err(dev, "Failed to decrease voltage (%d)\n", err);
|
||||
@@ -121,7 +108,9 @@ kbase_devfreq_target(struct device *dev, unsigned long *target_freq, u32 flags)
|
||||
}
|
||||
#endif
|
||||
|
||||
*target_freq = freq;
|
||||
kbdev->current_voltage = voltage;
|
||||
kbdev->current_freq = freq;
|
||||
|
||||
kbase_pm_reset_dvfs_utilisation(kbdev);
|
||||
|
||||
@@ -224,11 +213,6 @@ int kbase_devfreq_init(struct kbase_device *kbdev)
|
||||
return -ENODEV;
|
||||
|
||||
kbdev->current_freq = clk_get_rate(kbdev->clock);
|
||||
#ifdef CONFIG_REGULATOR
|
||||
if (kbdev->regulator)
|
||||
kbdev->current_voltage =
|
||||
regulator_get_voltage(kbdev->regulator);
|
||||
#endif
|
||||
|
||||
dp = &kbdev->devfreq_profile;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user