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

Commit f13b0c5a authored by Harshdeep Dhatt's avatar Harshdeep Dhatt
Browse files

msm: kgsl: Wait for active count when last kgsl instance is closed



Move the wait one level up so that we wait for active count before
we call the target specific function to execute the last close.

Change-Id: I2e877cd9b66e37e4894789e22fa2fdabaf72ff96
Signed-off-by: default avatarHarshdeep Dhatt <hdhatt@codeaurora.org>
parent 2708cda7
Loading
Loading
Loading
Loading
+8 −9
Original line number Diff line number Diff line
@@ -1855,7 +1855,14 @@ static int adreno_first_open(struct kgsl_device *device)

static int adreno_close(struct adreno_device *adreno_dev)
{
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
	return kgsl_pwrctrl_change_state(KGSL_DEVICE(adreno_dev),
			KGSL_STATE_INIT);
}

static int adreno_last_close(struct kgsl_device *device)
{
	struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
	const struct adreno_power_ops *ops = ADRENO_POWER_OPS(adreno_dev);

	/*
	 * Wait up to 1 second for the active count to go low
@@ -1870,14 +1877,6 @@ static int adreno_close(struct adreno_device *adreno_dev)
				"Still waiting for the active count\n");
	}

	return kgsl_pwrctrl_change_state(device, KGSL_STATE_INIT);
}

static int adreno_last_close(struct kgsl_device *device)
{
	struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
	const struct adreno_power_ops *ops = ADRENO_POWER_OPS(adreno_dev);

	return ops->last_close(adreno_dev);
}