Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 83665503 authored by Deepak Kumar's avatar Deepak Kumar
Browse files

msm: kgsl: Disable unused GPU OPP for bus_devfreq



GPU HW supports multiple OPP but SW doesn't use all
of them always. SW uses only certain OPP based on
requirements or speed-bins. Because of this, in current
code, frequency table passed to devfreq_add_device as
part of bus_devfreq profile won't match the OPP table
added to same device if we have speed-bins, resulting
in incorrect min and max freq values on devfreq side.

This change disables OPP which SW doesn't use to make
sure frequency table and OPP table for bus_devfreq
matches.

Change-Id: I06d5ce16e17c95b1ab1254b2bd54c4c2efa89fe3
Signed-off-by: default avatarDeepak Kumar <dkumar@codeaurora.org>
parent 5cad42a8
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1991,9 +1991,9 @@ static bool _gpu_freq_supported(struct kgsl_pwrctrl *pwr, unsigned int freq)
	return false;
}

static void kgsl_pwrctrl_disable_unused_opp(struct kgsl_device *device)
void kgsl_pwrctrl_disable_unused_opp(struct kgsl_device *device,
		struct device *dev)
{
	struct device *dev = &device->pdev->dev;
	struct dev_pm_opp *opp;
	unsigned long freq = 0;
	int ret;
@@ -2083,7 +2083,7 @@ int kgsl_pwrctrl_init(struct kgsl_device *device)
			pwr->pwrlevels[i].gpu_freq = freq;
	}

	kgsl_pwrctrl_disable_unused_opp(device);
	kgsl_pwrctrl_disable_unused_opp(device, &pdev->dev);

	kgsl_clk_set_rate(device, pwr->num_pwrlevels - 1);

+3 −0
Original line number Diff line number Diff line
@@ -267,4 +267,7 @@ void kgsl_pwrctrl_set_constraint(struct kgsl_device *device,
void kgsl_pwrctrl_update_l2pc(struct kgsl_device *device,
			unsigned long timeout_us);
void kgsl_pwrctrl_set_default_gpu_pwrlevel(struct kgsl_device *device);
void kgsl_pwrctrl_disable_unused_opp(struct kgsl_device *device,
		struct device *dev);

#endif /* __KGSL_PWRCTRL_H */
+6 −0
Original line number Diff line number Diff line
@@ -1041,6 +1041,12 @@ int kgsl_pwrscale_init(struct device *dev, const char *governor)
		 * frequency.
		 */
		ret = dev_pm_opp_of_add_table(device->busmondev);
		/*
		 * Disable OPP which are not supported as per GPU freq plan.
		 * This is need to ensure freq_table specified in bus_profile
		 * above matches OPP table.
		 */
		kgsl_pwrctrl_disable_unused_opp(device, device->busmondev);
		if (!ret)
			bus_devfreq = devfreq_add_device(device->busmondev,
				&pwrscale->bus_profile.profile, "gpubw_mon",