diff options
author | Jordan Crouse <jcrouse@codeaurora.org> | 2018-11-02 09:25:20 -0600 |
---|---|---|
committer | Rob Clark <robdclark@gmail.com> | 2018-12-11 13:05:28 -0500 |
commit | 568692102b6ad52fae27bef66793bc2e5770e429 (patch) | |
tree | 5138d9f0d069084f08cf723426d8f45a7f50aeb2 /drivers/gpu/drm/msm/msm_ringbuffer.h | |
parent | 93f7abf19dad2d0ad3c93597c87bbaff03218cb9 (diff) | |
download | lwn-568692102b6ad52fae27bef66793bc2e5770e429.tar.gz lwn-568692102b6ad52fae27bef66793bc2e5770e429.zip |
drm/msm/gpu: Add per-submission statistics
Add infrastructure to track statistics for GPU submissions
by sampling certain perfcounters before and after a submission.
To store the statistics, the per-ring memptrs region is
expanded to include room for up to 64 entries - this should
cover a reasonable amount of inflight submissions without
worrying about losing data. The target specific code inserts
PM4 commands to sample the counters before and after
submission and store them in the data region. The CPU can
access the data after the submission retires to make sense
of the statistics and communicate them to the user.
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/msm/msm_ringbuffer.h')
-rw-r--r-- | drivers/gpu/drm/msm/msm_ringbuffer.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/msm_ringbuffer.h b/drivers/gpu/drm/msm/msm_ringbuffer.h index cffce094aecb..6434ebb13136 100644 --- a/drivers/gpu/drm/msm/msm_ringbuffer.h +++ b/drivers/gpu/drm/msm/msm_ringbuffer.h @@ -23,9 +23,25 @@ #define rbmemptr(ring, member) \ ((ring)->memptrs_iova + offsetof(struct msm_rbmemptrs, member)) +#define rbmemptr_stats(ring, index, member) \ + (rbmemptr((ring), stats) + \ + ((index) * sizeof(struct msm_gpu_submit_stats)) + \ + offsetof(struct msm_gpu_submit_stats, member)) + +struct msm_gpu_submit_stats { + u64 cpcycles_start; + u64 cpcycles_end; + u64 alwayson_start; + u64 alwayson_end; +}; + +#define MSM_GPU_SUBMIT_STATS_COUNT 64 + struct msm_rbmemptrs { volatile uint32_t rptr; volatile uint32_t fence; + + volatile struct msm_gpu_submit_stats stats[MSM_GPU_SUBMIT_STATS_COUNT]; }; struct msm_ringbuffer { |