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

Commit 51c5feb2 authored by Kyle Piefer's avatar Kyle Piefer Committed by Gerrit - the friendly Code Review server
Browse files

msm: kgsl: Add RESET power state



During GMU start, the GMU driver needs to know whether a
reset has been done, because then memory is already initialized
and clocks/gdsc are enabled. Bypassing them speed up GPU warmboot.

To facilitate this, create a new power state named KGSL_STATE_RESET
and add all the state transitions.

CRs-Fixed: 2017390
Change-Id: Ie08012b31a1a701efa7b8907afcbd1fcf4fd8d89
Signed-off-by: default avatarKyle Piefer <kpiefer@codeaurora.org>
Signed-off-by: default avatarGeorge Shen <sqiao@codeaurora.org>
parent e923b7a8
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -2493,6 +2493,8 @@ static int _init(struct kgsl_device *device)
		/* Force power on to do the stop */
		status = kgsl_pwrctrl_enable(device);
	case KGSL_STATE_ACTIVE:
		/* fall through */
	case KGSL_STATE_RESET:
		kgsl_pwrctrl_irq(device, KGSL_PWRFLAGS_OFF);
		del_timer_sync(&device->idle_timer);
		kgsl_pwrscale_midframe_timer_cancel(device);
@@ -2595,6 +2597,11 @@ _aware(struct kgsl_device *device)
	int status = 0;

	switch (device->state) {
	case KGSL_STATE_RESET:
		if (!kgsl_gmu_isenabled(device))
			break;
		status = gmu_start(device);
		break;
	case KGSL_STATE_INIT:
		status = kgsl_pwrctrl_enable(device);
		break;
@@ -2645,6 +2652,7 @@ _nap(struct kgsl_device *device)
		kgsl_pwrctrl_set_state(device, KGSL_STATE_NAP);
		/* fallthrough */
	case KGSL_STATE_SLUMBER:
	case KGSL_STATE_RESET:
		break;
	case KGSL_STATE_AWARE:
		KGSL_PWR_WARN(device,
@@ -2787,6 +2795,8 @@ int kgsl_pwrctrl_change_state(struct kgsl_device *device, int state)
		break;
	case KGSL_STATE_SUSPEND:
		status = _suspend(device);
	case KGSL_STATE_RESET:
		kgsl_pwrctrl_set_state(device, KGSL_STATE_RESET);
		break;
	default:
		KGSL_PWR_INFO(device, "bad state request 0x%x\n", state);
@@ -2838,6 +2848,8 @@ const char *kgsl_pwrstate_to_str(unsigned int state)
		return "SUSPEND";
	case KGSL_STATE_SLUMBER:
		return "SLUMBER";
	case KGSL_STATE_RESET:
		return "RESET";
	default:
		break;
	}