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: Shubhraprakash Das <sadas@codeaurora.org>
This commit is contained in:
Shubhraprakash Das
2013-09-11 15:18:04 -07:00
committed by Iliyan Malchev
parent 2d43dbf945
commit 89483ce81c
2 changed files with 12 additions and 0 deletions

View File

@@ -1558,6 +1558,8 @@ static int __devexit 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;
}
@@ -1568,6 +1570,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);
@@ -1593,6 +1601,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
@@ -1631,6 +1640,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;
}

View File

@@ -194,6 +194,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