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

Commit 7631272f authored by Shubhraprakash Das's avatar Shubhraprakash Das
Browse files

msm: kgsl: Do not enable/disable SPTP if already enabled/disabled



Keep track of whether the SPTP regulator is enabled/disabled
by using a flag and do not enable unless it has been disabled
and vice versa.

Change-Id: I8621fd355d23876aeeebe05764e94331caef0ec2
CRs-Fixed: 732647
Signed-off-by: default avatarShubhraprakash Das <sadas@codeaurora.org>
parent d2a8c71b
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -2766,8 +2766,13 @@ static void adreno_regulator_enable(struct kgsl_device *device)
{
	struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
	struct adreno_gpudev *gpudev  = ADRENO_GPU_DEVICE(adreno_dev);
	if (gpudev->regulator_enable)
	if (gpudev->regulator_enable &&
		!test_bit(ADRENO_DEVICE_GPU_REGULATOR_ENABLED,
			&adreno_dev->priv)) {
		gpudev->regulator_enable(adreno_dev);
		set_bit(ADRENO_DEVICE_GPU_REGULATOR_ENABLED,
			&adreno_dev->priv);
	}
}

static bool adreno_is_hw_collapsible(struct kgsl_device *device)
@@ -2783,8 +2788,13 @@ static void adreno_regulator_disable(struct kgsl_device *device)
{
	struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
	struct adreno_gpudev *gpudev  = ADRENO_GPU_DEVICE(adreno_dev);
	if (gpudev->regulator_disable)
	if (gpudev->regulator_disable &&
		test_bit(ADRENO_DEVICE_GPU_REGULATOR_ENABLED,
			&adreno_dev->priv)) {
		gpudev->regulator_disable(adreno_dev);
		clear_bit(ADRENO_DEVICE_GPU_REGULATOR_ENABLED,
			&adreno_dev->priv);
	}
}

static const struct kgsl_functable adreno_functable = {
+1 −0
Original line number Diff line number Diff line
@@ -271,6 +271,7 @@ enum adreno_device_flags {
	ADRENO_DEVICE_STARTED = 5,
	ADRENO_DEVICE_FAULT = 6,
	ADRENO_DEVICE_CMDBATCH_PROFILE = 7,
	ADRENO_DEVICE_GPU_REGULATOR_ENABLED = 8,
};

#define PERFCOUNTER_FLAG_NONE 0x0