msm: kgsl: Add back power tracepoints to gmu and rgmu targets

This ensures compatibility with existing tools that rely on the important
power related tracepoints. Only need to print the tracepoints and no
need to modify the states.

Change-Id: I87432aff998cb21a22452a152bd5e6b8f59c0f75
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
This commit is contained in:
Harshdeep Dhatt 2020-08-04 17:49:47 -06:00
commit 2a1ab962b3
2 changed files with 53 additions and 0 deletions

View file

@ -2138,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) {
@ -2202,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:
@ -2227,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;
@ -2275,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:
@ -2921,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;
@ -2937,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;
}
@ -2970,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;
@ -3007,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;
}
@ -3033,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);
@ -3079,6 +3098,8 @@ no_gx_power:
kgsl_pwrscale_sleep(device);
trace_kgsl_pwr_set_state(device, KGSL_STATE_SLUMBER);
return ret;
}
@ -3170,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);
@ -3192,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);
@ -3232,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;
@ -3245,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

View file

@ -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);