mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 00:24:41 -04:00
Merge "msm: kgsl: Add back power tracepoints to gmu and rgmu targets"
This commit is contained in:
commit
908cc36e3f
3 changed files with 55 additions and 9 deletions
|
|
@ -457,15 +457,8 @@ static int a6xx_gmu_device_start(struct adreno_device *adreno_dev)
|
|||
if (timed_poll_check(device,
|
||||
A6XX_GMU_CM3_FW_INIT_RESULT,
|
||||
val, GMU_START_TIMEOUT, mask)) {
|
||||
u32 val;
|
||||
|
||||
/*
|
||||
* The breadcrumb is written to a gmu virtual mapping
|
||||
* which points to dtcm byte offset 0x3fdc.
|
||||
*/
|
||||
gmu_core_regread(device,
|
||||
A6XX_GMU_CM3_DTCM_START + (0x3fdc >> 2), &val);
|
||||
dev_err(&gmu->pdev->dev, "GMU doesn't boot: 0x%x\n", val);
|
||||
dev_err(&gmu->pdev->dev, "GMU doesn't boot\n");
|
||||
gmu_fault_snapshot(device);
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
|
@ -2145,6 +2138,8 @@ static int a6xx_gmu_first_boot(struct adreno_device *adreno_dev)
|
|||
struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
|
||||
int level, ret;
|
||||
|
||||
trace_kgsl_pwr_request_state(device, KGSL_STATE_AWARE);
|
||||
|
||||
ret = a6xx_gmu_aop_send_acd_state(gmu->mailbox.channel,
|
||||
adreno_dev->acd_enabled);
|
||||
if (ret) {
|
||||
|
|
@ -2209,6 +2204,8 @@ static int a6xx_gmu_first_boot(struct adreno_device *adreno_dev)
|
|||
|
||||
device->gmu_fault = false;
|
||||
|
||||
trace_kgsl_pwr_set_state(device, KGSL_STATE_AWARE);
|
||||
|
||||
return 0;
|
||||
|
||||
err:
|
||||
|
|
@ -2234,6 +2231,8 @@ static int a6xx_gmu_boot(struct adreno_device *adreno_dev)
|
|||
struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
|
||||
int ret = 0;
|
||||
|
||||
trace_kgsl_pwr_request_state(device, KGSL_STATE_AWARE);
|
||||
|
||||
ret = a6xx_gmu_enable_gdsc(adreno_dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
@ -2282,6 +2281,8 @@ static int a6xx_gmu_boot(struct adreno_device *adreno_dev)
|
|||
|
||||
device->gmu_fault = false;
|
||||
|
||||
trace_kgsl_pwr_set_state(device, KGSL_STATE_AWARE);
|
||||
|
||||
return 0;
|
||||
|
||||
err:
|
||||
|
|
@ -2928,6 +2929,8 @@ static int a6xx_boot(struct adreno_device *adreno_dev)
|
|||
|
||||
WARN_ON(test_bit(GMU_PRIV_GPU_STARTED, &gmu->flags));
|
||||
|
||||
trace_kgsl_pwr_request_state(device, KGSL_STATE_ACTIVE);
|
||||
|
||||
ret = a6xx_gmu_boot(adreno_dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
@ -2944,6 +2947,8 @@ static int a6xx_boot(struct adreno_device *adreno_dev)
|
|||
set_bit(GMU_PRIV_GPU_STARTED, &gmu->flags);
|
||||
device->state = KGSL_STATE_ACTIVE;
|
||||
|
||||
trace_kgsl_pwr_set_state(device, KGSL_STATE_ACTIVE);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -2977,6 +2982,8 @@ static int a6xx_first_boot(struct adreno_device *adreno_dev)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
trace_kgsl_pwr_request_state(device, KGSL_STATE_ACTIVE);
|
||||
|
||||
ret = a6xx_gmu_first_boot(adreno_dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
@ -3014,6 +3021,9 @@ static int a6xx_first_boot(struct adreno_device *adreno_dev)
|
|||
|
||||
device->state = KGSL_STATE_ACTIVE;
|
||||
|
||||
trace_kgsl_pwr_set_state(device, KGSL_STATE_ACTIVE);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -3040,6 +3050,8 @@ static int a6xx_power_off(struct adreno_device *adreno_dev)
|
|||
|
||||
WARN_ON(!test_bit(GMU_PRIV_GPU_STARTED, &gmu->flags));
|
||||
|
||||
trace_kgsl_pwr_request_state(device, KGSL_STATE_SLUMBER);
|
||||
|
||||
ret = a6xx_gmu_oob_set(device, oob_gpu);
|
||||
if (ret) {
|
||||
a6xx_gmu_oob_clear(device, oob_gpu);
|
||||
|
|
@ -3086,6 +3098,8 @@ no_gx_power:
|
|||
|
||||
kgsl_pwrscale_sleep(device);
|
||||
|
||||
trace_kgsl_pwr_set_state(device, KGSL_STATE_SLUMBER);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -3177,6 +3191,8 @@ static int a6xx_gmu_pm_suspend(struct adreno_device *adreno_dev)
|
|||
if (test_bit(GMU_PRIV_PM_SUSPEND, &gmu->flags))
|
||||
return 0;
|
||||
|
||||
trace_kgsl_pwr_request_state(device, KGSL_STATE_SUSPEND);
|
||||
|
||||
/* Halt any new submissions */
|
||||
reinit_completion(&device->halt_gate);
|
||||
|
||||
|
|
@ -3199,6 +3215,8 @@ static int a6xx_gmu_pm_suspend(struct adreno_device *adreno_dev)
|
|||
|
||||
adreno_dispatcher_halt(device);
|
||||
|
||||
trace_kgsl_pwr_set_state(device, KGSL_STATE_SUSPEND);
|
||||
|
||||
return 0;
|
||||
err:
|
||||
adreno_dispatcher_start(device);
|
||||
|
|
@ -3239,6 +3257,8 @@ static void a6xx_gmu_touch_wakeup(struct adreno_device *adreno_dev)
|
|||
if (test_bit(GMU_PRIV_GPU_STARTED, &gmu->flags))
|
||||
goto done;
|
||||
|
||||
trace_kgsl_pwr_request_state(device, KGSL_STATE_ACTIVE);
|
||||
|
||||
ret = a6xx_gmu_boot(adreno_dev);
|
||||
if (ret)
|
||||
return;
|
||||
|
|
@ -3252,6 +3272,8 @@ static void a6xx_gmu_touch_wakeup(struct adreno_device *adreno_dev)
|
|||
set_bit(GMU_PRIV_GPU_STARTED, &gmu->flags);
|
||||
device->state = KGSL_STATE_ACTIVE;
|
||||
|
||||
trace_kgsl_pwr_set_state(device, KGSL_STATE_ACTIVE);
|
||||
|
||||
done:
|
||||
/*
|
||||
* When waking up from a touch event we want to stay active long enough
|
||||
|
|
|
|||
|
|
@ -800,6 +800,8 @@ static int a6xx_rgmu_boot(struct adreno_device *adreno_dev)
|
|||
struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
|
||||
int ret;
|
||||
|
||||
trace_kgsl_pwr_request_state(device, KGSL_STATE_AWARE);
|
||||
|
||||
ret = a6xx_rgmu_enable_gdsc(adreno_dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
@ -827,6 +829,8 @@ static int a6xx_rgmu_boot(struct adreno_device *adreno_dev)
|
|||
|
||||
device->gmu_fault = false;
|
||||
|
||||
trace_kgsl_pwr_set_state(device, KGSL_STATE_AWARE);
|
||||
|
||||
return 0;
|
||||
|
||||
err:
|
||||
|
|
@ -871,6 +875,8 @@ static int a6xx_boot(struct adreno_device *adreno_dev)
|
|||
if (test_bit(RGMU_PRIV_GPU_STARTED, &rgmu->flags))
|
||||
return 0;
|
||||
|
||||
trace_kgsl_pwr_request_state(device, KGSL_STATE_ACTIVE);
|
||||
|
||||
ret = a6xx_rgmu_boot(adreno_dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
@ -888,6 +894,8 @@ static int a6xx_boot(struct adreno_device *adreno_dev)
|
|||
|
||||
device->state = KGSL_STATE_ACTIVE;
|
||||
|
||||
trace_kgsl_pwr_set_state(device, KGSL_STATE_ACTIVE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -908,6 +916,8 @@ static void a6xx_rgmu_touch_wakeup(struct adreno_device *adreno_dev)
|
|||
if (test_bit(RGMU_PRIV_GPU_STARTED, &rgmu->flags))
|
||||
goto done;
|
||||
|
||||
trace_kgsl_pwr_request_state(device, KGSL_STATE_ACTIVE);
|
||||
|
||||
ret = a6xx_rgmu_boot(adreno_dev);
|
||||
if (ret)
|
||||
return;
|
||||
|
|
@ -922,6 +932,8 @@ static void a6xx_rgmu_touch_wakeup(struct adreno_device *adreno_dev)
|
|||
|
||||
device->state = KGSL_STATE_ACTIVE;
|
||||
|
||||
trace_kgsl_pwr_set_state(device, KGSL_STATE_ACTIVE);
|
||||
|
||||
done:
|
||||
/*
|
||||
* When waking up from a touch event we want to stay active long enough
|
||||
|
|
@ -963,6 +975,8 @@ static int a6xx_first_boot(struct adreno_device *adreno_dev)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
trace_kgsl_pwr_request_state(device, KGSL_STATE_ACTIVE);
|
||||
|
||||
ret = a6xx_rgmu_boot(adreno_dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
@ -986,6 +1000,8 @@ static int a6xx_first_boot(struct adreno_device *adreno_dev)
|
|||
|
||||
device->state = KGSL_STATE_ACTIVE;
|
||||
|
||||
trace_kgsl_pwr_set_state(device, KGSL_STATE_ACTIVE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1018,6 +1034,8 @@ static int a6xx_power_off(struct adreno_device *adreno_dev)
|
|||
if (!test_bit(RGMU_PRIV_GPU_STARTED, &rgmu->flags))
|
||||
return 0;
|
||||
|
||||
trace_kgsl_pwr_request_state(device, KGSL_STATE_SLUMBER);
|
||||
|
||||
ret = a6xx_rgmu_oob_set(device, oob_gpu);
|
||||
if (ret) {
|
||||
a6xx_rgmu_oob_clear(device, oob_gpu);
|
||||
|
|
@ -1065,6 +1083,8 @@ no_gx_power:
|
|||
|
||||
kgsl_pwrscale_sleep(device);
|
||||
|
||||
trace_kgsl_pwr_set_state(device, KGSL_STATE_SLUMBER);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -1117,6 +1137,8 @@ static int a6xx_rgmu_pm_suspend(struct adreno_device *adreno_dev)
|
|||
if (test_bit(RGMU_PRIV_PM_SUSPEND, &rgmu->flags))
|
||||
return 0;
|
||||
|
||||
trace_kgsl_pwr_request_state(device, KGSL_STATE_SUSPEND);
|
||||
|
||||
/* Halt any new submissions */
|
||||
reinit_completion(&device->halt_gate);
|
||||
|
||||
|
|
@ -1138,6 +1160,8 @@ static int a6xx_rgmu_pm_suspend(struct adreno_device *adreno_dev)
|
|||
|
||||
adreno_dispatcher_halt(device);
|
||||
|
||||
trace_kgsl_pwr_set_state(device, KGSL_STATE_SUSPEND);
|
||||
|
||||
return 0;
|
||||
err:
|
||||
adreno_dispatcher_start(device);
|
||||
|
|
|
|||
|
|
@ -753,7 +753,7 @@ static int _perfcounter_enable_default(struct adreno_device *adreno_dev,
|
|||
reg = &(grp->regs[counter]);
|
||||
|
||||
if (_perfcounter_inline_update(adreno_dev, group) &&
|
||||
test_bit(ADRENO_DEVICE_STARTED, &adreno_dev->priv)) {
|
||||
(device->state == KGSL_STATE_ACTIVE)) {
|
||||
struct adreno_ringbuffer *rb = &adreno_dev->ringbuffers[0];
|
||||
unsigned int buf[4];
|
||||
unsigned int *cmds = buf;
|
||||
|
|
|
|||
Loading…
Reference in a new issue