summaryrefslogtreecommitdiff
path: root/include/uapi/drm
diff options
context:
space:
mode:
authorSharat Masetty <smasetty@codeaurora.org>2017-04-17 12:28:38 +0530
committerSharat Masetty <smasetty@codeaurora.org>2017-04-24 10:28:17 +0530
commite84be6486a923e82be8fa16a52c5bc0d2f355bc6 (patch)
tree9d09b3b71a2648ca94c738c78f2976a7b45917d2 /include/uapi/drm
parentce87c901721567907d20d8c8323dec3a55ce3741 (diff)
drm/msm: Enable per cmdstream profiling for the user
If the user provides a profile buffer identified with a buffer type MSM_SUBMIT_CMD_PROFILE_BUF, then the driver records the kernel clock time and gpu ticks at the time of cmdstream submission, and the GPU records the ticks just before the start of the cmdstream execution and right after the end of the cmdstream execution. Change-Id: Ic6298ec5919b18e976ae089ffb0860b8165ce4f3 Signed-off-by: Sharat Masetty <smasetty@codeaurora.org>
Diffstat (limited to 'include/uapi/drm')
-rw-r--r--include/uapi/drm/msm_drm.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/uapi/drm/msm_drm.h b/include/uapi/drm/msm_drm.h
index 8baf2bf6df2e..c974714a9abe 100644
--- a/include/uapi/drm/msm_drm.h
+++ b/include/uapi/drm/msm_drm.h
@@ -152,10 +152,13 @@ struct drm_msm_gem_submit_reloc {
* this buffer in the first-level ringbuffer
* CTX_RESTORE_BUF - only executed if there has been a GPU context
* switch since the last SUBMIT ioctl
+ * PROFILE_BUF - A profiling buffer written to by both GPU and CPU.
*/
#define MSM_SUBMIT_CMD_BUF 0x0001
#define MSM_SUBMIT_CMD_IB_TARGET_BUF 0x0002
#define MSM_SUBMIT_CMD_CTX_RESTORE_BUF 0x0003
+#define MSM_SUBMIT_CMD_PROFILE_BUF 0x0004
+
struct drm_msm_gem_submit_cmd {
__u32 type; /* in, one of MSM_SUBMIT_CMD_x */
__u32 submit_idx; /* in, index of submit_bo cmdstream buffer */
@@ -207,6 +210,14 @@ struct drm_msm_gem_submit {
__u64 __user cmds; /* in, ptr to array of submit_cmd's */
};
+struct drm_msm_gem_submit_profile_buffer {
+ __s64 queue_time; /* out, Ringbuffer queue time (seconds) */
+ __s64 submit_time; /* out, Ringbuffer submission time (seconds) */
+ __u64 ticks_queued; /* out, GPU ticks at ringbuffer submission */
+ __u64 ticks_submitted; /* out, GPU ticks before cmdstream execution*/
+ __u64 ticks_retired; /* out, GPU ticks after cmdstream execution */
+};
+
/* The normal way to synchronize with the GPU is just to CPU_PREP on
* a buffer if you need to access it from the CPU (other cmdstream
* submission from same or other contexts, PAGE_FLIP ioctl, etc, all