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

Commit b3b23ddb authored by Rajesh Kemisetti's avatar Rajesh Kemisetti
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 15447593
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -1004,6 +1004,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;
@@ -1830,7 +1832,12 @@ static int kgsl_pwrctrl_pwrrail(struct kgsl_device *device, int state)
	struct kgsl_pwrctrl *pwr = &device->pwrctrl;
	int status = 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) {