From: Sourab Gupta <sourab.gupta@xxxxxxxxx> This patch introduces data structures for holding the timestamp data, which can then be forwarded to userspace using Gen Perf PMU. Each timestamp node will have the timestamp value, alongwith additional metadata information such as ctx_id, pid, ring. Signed-off-by: Sourab Gupta <sourab.gupta@xxxxxxxxx> --- drivers/gpu/drm/i915/i915_drv.h | 22 ++++++++++++++++++++++ include/uapi/drm/i915_drm.h | 18 ++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 3491584..b6a897a 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -1701,6 +1701,28 @@ struct drm_i915_oa_async_node { struct drm_i915_oa_async_node_info node_info; __u32 report_perf[64]; /* Must be aligned to 64-byte boundary */ }; + +struct drm_i915_ts_queue_header { + __u64 size_in_bytes; + /* Byte offset, start of queue header to first node */ + __u64 data_offset; + __u32 node_count; + __u32 wrap_count; +}; + +struct drm_i915_ts_node_info { + __u32 ring; + __u32 pid; + __u32 ctx_id; + __u32 perftag; + struct drm_i915_gem_request *req; +}; + +struct drm_i915_ts_node { + /* ensure timestamp starts on a qword boundary */ + struct drm_i915_ts_data timestamp; + struct drm_i915_ts_node_info node_info; +}; #endif struct drm_i915_private { diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h index 4d99992..a7da421 100644 --- a/include/uapi/drm/i915_drm.h +++ b/include/uapi/drm/i915_drm.h @@ -131,6 +131,24 @@ struct drm_i915_oa_async_node_footer { __u32 pad; }; +struct drm_i915_ts_node_footer { + __u32 ring; + __u32 pid; + __u32 ctx_id; + __u32 perftag; +}; + +struct drm_i915_ts_data { + __u32 ts_low; + __u32 ts_high; +}; + +struct drm_i915_ts_usernode { + /* ensure timestamp starts on a qword boundary */ + struct drm_i915_ts_data timestamp; + struct drm_i915_ts_node_footer node_info; +}; + /* Each region is a minimum of 16k, and there are at most 255 of them. */ #define I915_NR_TEX_REGIONS 255 /* table size 2k - maximum due to use -- 1.8.5.1 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/intel-gfx