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

Commit 1fab2f8f authored by Rajesh Kemisetti's avatar Rajesh Kemisetti Committed by Lynus Vaz
Browse files

msm: kgsl: Make sure regulators are ON before GPU clocks are forced on



The debug option to always ON the GPU clocks does not check the regulator
state. If the user tries to set this option while GPU is in Slumber state
then enabling clocks will fail.

Make sure we enable the GPU regulators before enabling its clocks.

Change-Id: Id77773224c674fe2e1b6179a039750b24e5e5f87
Signed-off-by: default avatarRajesh Kemisetti <rajeshk@codeaurora.org>
parent 2eb74d74
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -1049,6 +1049,8 @@ static void __force_on(struct kgsl_device *device, int flag, int on)
	if (on) {
		switch (flag) {
		case KGSL_PWRFLAGS_CLK_ON:
			/* make sure pwrrail is ON before enabling clocks */
			kgsl_pwrctrl_pwrrail(device, KGSL_PWRFLAGS_ON);
			kgsl_pwrctrl_clk(device, KGSL_PWRFLAGS_ON,
				KGSL_STATE_ACTIVE);
			break;
@@ -1854,7 +1856,12 @@ static int kgsl_pwrctrl_pwrrail(struct kgsl_device *device, int state)

	if (kgsl_gmu_isenabled(device))
		return 0;
	if (test_bit(KGSL_PWRFLAGS_POWER_ON, &pwr->ctrl_flags))
	/*
	 * Disabling the regulator means also disabling dependent clocks.
	 * Hence don't disable it if force clock ON is set.
	 */
	if (test_bit(KGSL_PWRFLAGS_POWER_ON, &pwr->ctrl_flags) ||
		test_bit(KGSL_PWRFLAGS_CLK_ON, &pwr->ctrl_flags))
		return 0;

	if (state == KGSL_PWRFLAGS_OFF) {