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

Commit b78f84d1 authored by Thomas (Wonyoung) Yun's avatar Thomas (Wonyoung) Yun
Browse files

msm: kgsl: clear GMU flags before hibernation



Clear GMU_BOOT_INIT_DONE and GMU_RSCC_SLEEP_SEQ_DONE bits
in gmu_core flags before hibernation, to force GMU power
up sequence after resuming.

Change-Id: I02a2d25dbb7dec2f9b06a8e6857326e8b40f62da
Signed-off-by: default avatarKasin Li <donglil@codeaurora.org>
Signed-off-by: default avatarThomas (Wonyoung) Yun <wyun@codeaurora.org>
parent be7b93d8
Loading
Loading
Loading
Loading
+14 −5
Original line number Diff line number Diff line
@@ -4029,16 +4029,25 @@ static void adreno_suspend_device(struct kgsl_device *device,
	struct adreno_gpudev *gpudev = ADRENO_GPU_DEVICE(adreno_dev);
	int pm_event = pm_state.event;

	if (device->state == KGSL_STATE_SUSPEND)
		adreno_dispatcher_halt(device);

	if ((pm_event != PM_EVENT_SUSPEND) &&
		(gpudev->zap_shader_unload != NULL))
	if (pm_event != PM_EVENT_SUSPEND) {
		if (gpudev->zap_shader_unload != NULL)
			gpudev->zap_shader_unload(adreno_dev);

		if (gmu_core_isenabled(device)) {
			clear_bit(GMU_BOOT_INIT_DONE, &device->gmu_core.flags);
			clear_bit(GMU_RSCC_SLEEP_SEQ_DONE,
						&device->gmu_core.flags);
		}
	}
}

static int adreno_resume_device(struct kgsl_device *device,
				pm_message_t pm_state)
{
	if (device->state == KGSL_STATE_SUSPEND)
		adreno_dispatcher_unhalt(device);

	return 0;
+3 −2
Original line number Diff line number Diff line
@@ -835,7 +835,7 @@ static int kgsl_suspend_device(struct kgsl_device *device, pm_message_t state)

	mutex_lock(&device->mutex);
	status = kgsl_pwrctrl_change_state(device, KGSL_STATE_SUSPEND);
	if (status == 0 && device->state == KGSL_STATE_SUSPEND)
	if (!status)
		device->ftbl->suspend_device(device, state);
	mutex_unlock(&device->mutex);

@@ -850,8 +850,9 @@ static int kgsl_resume_device(struct kgsl_device *device, pm_message_t state)

	KGSL_PWR_WARN(device, "resume start\n");
	mutex_lock(&device->mutex);
	if (device->state == KGSL_STATE_SUSPEND) {
	device->ftbl->resume_device(device, state);

	if (device->state == KGSL_STATE_SUSPEND) {
		kgsl_pwrctrl_change_state(device, KGSL_STATE_SLUMBER);
	} else if (device->state != KGSL_STATE_INIT) {
		/*