Skip to content

Commit

Permalink
drm/msm/gpu: Add suspend/resume tracepoints
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Clark <robdclark@chromium.org>
  • Loading branch information
Rob Clark committed Sep 12, 2020
1 parent 1ef7c99 commit ec1cb6e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/gpu/drm/msm/adreno/a6xx_gpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,8 @@ static int a6xx_pm_resume(struct msm_gpu *gpu)

gpu->needs_hw_init = true;

trace_msm_gpu_resume(0);

ret = a6xx_gmu_resume(a6xx_gpu);
if (ret)
return ret;
Expand All @@ -945,6 +947,8 @@ static int a6xx_pm_suspend(struct msm_gpu *gpu)
struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
struct a6xx_gpu *a6xx_gpu = to_a6xx_gpu(adreno_gpu);

trace_msm_gpu_suspend(0);

devfreq_suspend_device(gpu->devfreq.devfreq);

return a6xx_gmu_stop(a6xx_gpu);
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/msm/msm_gpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ int msm_gpu_pm_resume(struct msm_gpu *gpu)
int ret;

DBG("%s", gpu->name);
trace_msm_gpu_resume(0);

ret = enable_pwrrail(gpu);
if (ret)
Expand All @@ -227,6 +228,7 @@ int msm_gpu_pm_suspend(struct msm_gpu *gpu)
int ret;

DBG("%s", gpu->name);
trace_msm_gpu_suspend(0);

devfreq_suspend_device(gpu->devfreq.devfreq);

Expand Down
26 changes: 26 additions & 0 deletions drivers/gpu/drm/msm/msm_gpu_trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,32 @@ TRACE_EVENT(msm_gem_purge_vmaps,
TP_printk("Purging %u vmaps", __entry->unmapped)
);


TRACE_EVENT(msm_gpu_suspend,
TP_PROTO(int dummy),
TP_ARGS(dummy),
TP_STRUCT__entry(
__field(u32, dummy)
),
TP_fast_assign(
__entry->dummy = dummy;
),
TP_printk("%u", __entry->dummy)
);


TRACE_EVENT(msm_gpu_resume,
TP_PROTO(int dummy),
TP_ARGS(dummy),
TP_STRUCT__entry(
__field(u32, dummy)
),
TP_fast_assign(
__entry->dummy = dummy;
),
TP_printk("%u", __entry->dummy)
);

#endif

#undef TRACE_INCLUDE_PATH
Expand Down

0 comments on commit ec1cb6e

Please sign in to comment.