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

Commit e177c8ba authored by Shubhraprakash Das's avatar Shubhraprakash Das
Browse files

msm: kgsl: Call adreno_init only once on startup



The adreno_init function initializes things that need to be initialized
only once on the first start up. After that until the device is removed
the adreno_init function does not need to called again. Make changes
to execute this function just once until the device is removed.

Change-Id: I1bd18dd9ec70146dc74da1ee9ad1186576344309
Signed-off-by: default avatarShubhraprakash Das <sadas@codeaurora.org>
parent 54938e72
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1630,6 +1630,8 @@ static int adreno_remove(struct platform_device *pdev)
	adreno_ringbuffer_close(&adreno_dev->ringbuffer);
	kgsl_device_platform_remove(device);

	clear_bit(ADRENO_DEVICE_INITIALIZED, &adreno_dev->priv);

	return 0;
}

@@ -1639,6 +1641,12 @@ static int adreno_init(struct kgsl_device *device)
	int i;

	kgsl_pwrctrl_set_state(device, KGSL_STATE_INIT);
	/*
	 * initialization only needs to be done once initially until
	 * device is shutdown
	 */
	if (test_bit(ADRENO_DEVICE_INITIALIZED, &adreno_dev->priv))
		return 0;

	/* Power up the device */
	kgsl_pwrctrl_enable(device);
@@ -1664,6 +1672,7 @@ static int adreno_init(struct kgsl_device *device)
		BUG_ON(1);
	}

	kgsl_pwrctrl_set_state(device, KGSL_STATE_INIT);
	/*
	 * Check if firmware supports the sync lock PM4 packets needed
	 * for IOMMUv1
@@ -1700,6 +1709,8 @@ static int adreno_init(struct kgsl_device *device)
	if (adreno_is_a330v2(adreno_dev))
		adreno_a3xx_pwron_fixup_init(adreno_dev);

	set_bit(ADRENO_DEVICE_INITIALIZED, &adreno_dev->priv);

	return 0;
}

+1 −0
Original line number Diff line number Diff line
@@ -199,6 +199,7 @@ struct adreno_device {
enum adreno_device_flags {
	ADRENO_DEVICE_PWRON = 0,
	ADRENO_DEVICE_PWRON_FIXUP = 1,
	ADRENO_DEVICE_INITIALIZED = 2,
};

#define PERFCOUNTER_FLAG_NONE 0x0