1
0
Fork 0
mirror of https://github.com/followmsi/android_kernel_google_msm.git synced 2024-11-06 23:17:41 +00:00

msm: kgsl: Get rid of KGSL_FLAGS_STARTED

The KGSL_FLAGS_STARTED is just redundant since the device start
and stop already set a flag to indicate device start/stop state.

Change-Id: I17f3ab7fc2aca7b58b610c3b3414c125babc273e
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
This commit is contained in:
Shubhraprakash Das 2014-05-06 17:38:00 -07:00 committed by Iliyan Malchev
parent c56d10a6d4
commit fbe4de5b7b
4 changed files with 17 additions and 58 deletions

View file

@ -1761,14 +1761,12 @@ static int adreno_start(struct kgsl_device *device)
kgsl_pwrctrl_irq(device, KGSL_PWRFLAGS_ON);
device->ftbl->irqctrl(device, 1);
adreno_perfcounter_start(adreno_dev);
status = adreno_ringbuffer_cold_start(&adreno_dev->ringbuffer);
if (status)
goto error_irq_off;
status = adreno_perfcounter_start(adreno_dev);
if (status)
goto error_rb_stop;
/* Start the dispatcher */
adreno_dispatcher_start(device);
@ -1778,8 +1776,6 @@ static int adreno_start(struct kgsl_device *device)
return 0;
error_rb_stop:
adreno_ringbuffer_stop(&adreno_dev->ringbuffer);
error_irq_off:
kgsl_pwrctrl_irq(device, KGSL_PWRFLAGS_OFF);
@ -1832,7 +1828,6 @@ static int adreno_stop(struct kgsl_device *device)
adreno_dev->drawctxt_active = NULL;
adreno_dispatcher_stop(adreno_dev);
adreno_ringbuffer_stop(&adreno_dev->ringbuffer);
device->ftbl->irqctrl(device, 0);
kgsl_pwrctrl_irq(device, KGSL_PWRFLAGS_OFF);
@ -2437,9 +2432,6 @@ int adreno_soft_reset(struct kgsl_device *device)
adreno_dev->drawctxt_active = NULL;
/* Stop the ringbuffer */
adreno_ringbuffer_stop(&adreno_dev->ringbuffer);
if (kgsl_pwrctrl_isenabled(device))
device->ftbl->irqctrl(device, 0);

View file

@ -436,9 +436,6 @@ int _ringbuffer_start_common(struct adreno_ringbuffer *rb)
/* idle device to validate ME INIT */
status = adreno_idle(device);
if (status == 0)
rb->flags |= KGSL_FLAGS_STARTED;
return status;
}
@ -455,9 +452,6 @@ int adreno_ringbuffer_warm_start(struct adreno_ringbuffer *rb)
struct kgsl_device *device = rb->device;
struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
if (rb->flags & KGSL_FLAGS_STARTED)
return 0;
_ringbuffer_setup_common(rb);
/* If bootstrapping if supported to load jump tables */
@ -499,8 +493,6 @@ int adreno_ringbuffer_cold_start(struct adreno_ringbuffer *rb)
struct kgsl_device *device = rb->device;
struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
if (rb->flags & KGSL_FLAGS_STARTED)
return 0;
_ringbuffer_setup_common(rb);
@ -550,19 +542,6 @@ int adreno_ringbuffer_cold_start(struct adreno_ringbuffer *rb)
return status;
}
void adreno_ringbuffer_stop(struct adreno_ringbuffer *rb)
{
struct kgsl_device *device = rb->device;
struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
if (rb->flags & KGSL_FLAGS_STARTED) {
if (adreno_is_a200(adreno_dev))
kgsl_regwrite(rb->device, REG_CP_ME_CNTL, 0x10000000);
rb->flags &= ~KGSL_FLAGS_STARTED;
}
}
int adreno_ringbuffer_init(struct kgsl_device *device)
{
int status;

View file

@ -75,8 +75,6 @@ int adreno_ringbuffer_warm_start(struct adreno_ringbuffer *rb);
int adreno_ringbuffer_cold_start(struct adreno_ringbuffer *rb);
void adreno_ringbuffer_stop(struct adreno_ringbuffer *rb);
void adreno_ringbuffer_close(struct adreno_ringbuffer *rb);
unsigned int adreno_ringbuffer_issuecmds(struct kgsl_device *device,

View file

@ -1256,19 +1256,17 @@ static int kgsl_iommu_setstate(struct kgsl_mmu *mmu,
{
int ret = 0;
if (mmu->flags & KGSL_FLAGS_STARTED) {
/* page table not current, then setup mmu to use new
* specified page table
*/
if (mmu->hwpagetable != pagetable) {
unsigned int flags = 0;
mmu->hwpagetable = pagetable;
flags |= kgsl_mmu_pt_get_flags(mmu->hwpagetable,
mmu->device->id) |
KGSL_MMUFLAGS_TLBFLUSH;
ret = kgsl_setstate(mmu, context_id,
KGSL_MMUFLAGS_PTUPDATE | flags);
}
/* page table not current, then setup mmu to use new
* specified page table
*/
if (mmu->hwpagetable != pagetable) {
unsigned int flags = 0;
mmu->hwpagetable = pagetable;
flags |= kgsl_mmu_pt_get_flags(mmu->hwpagetable,
mmu->device->id) |
KGSL_MMUFLAGS_TLBFLUSH;
ret = kgsl_setstate(mmu, context_id,
KGSL_MMUFLAGS_PTUPDATE | flags);
}
return ret;
@ -1660,9 +1658,6 @@ static int kgsl_iommu_start(struct kgsl_mmu *mmu)
int sctlr_val = 0;
struct adreno_device *adreno_dev = ADRENO_DEVICE(mmu->device);
if (mmu->flags & KGSL_FLAGS_STARTED)
return 0;
if (mmu->defaultpagetable == NULL) {
status = kgsl_iommu_setup_defaultpagetable(mmu);
if (status)
@ -1740,7 +1735,6 @@ static int kgsl_iommu_start(struct kgsl_mmu *mmu)
cp_nop_packet(1), sizeof(unsigned int));
kgsl_iommu_disable_clk(mmu, KGSL_IOMMU_MAX_UNITS);
mmu->flags |= KGSL_FLAGS_STARTED;
done:
return status;
@ -1884,16 +1878,12 @@ static void kgsl_iommu_stop(struct kgsl_mmu *mmu)
* stop device mmu
*
* call this with the global lock held
* detach iommu attachment
*/
if (mmu->flags & KGSL_FLAGS_STARTED) {
/* detach iommu attachment */
kgsl_detach_pagetable_iommu_domain(mmu);
mmu->hwpagetable = NULL;
kgsl_detach_pagetable_iommu_domain(mmu);
mmu->hwpagetable = NULL;
mmu->flags &= ~KGSL_FLAGS_STARTED;
kgsl_iommu_pagefault_resume(mmu);
}
kgsl_iommu_pagefault_resume(mmu);
/* switch off MMU clocks and cancel any events it has queued */
kgsl_cancel_events(mmu->device, mmu);
}