[Intel-gfx] [RFC 8/8] drm/i915: Add support to add execbuffer tags to OA counter reports

Chris Wilson chris at chris-wilson.co.uk
Wed Jul 15 03:06:04 PDT 2015


On Wed, Jul 15, 2015 at 02:17:03PM +0530, sourab.gupta at intel.com wrote:
> From: Sourab Gupta <sourab.gupta at intel.com>
> 
> This patch enables userspace to specify tags (per workload), provided via
> execbuffer ioctl, which could be added to OA reports, to help associate
> reports with the corresponding workloads.
> 
> There may be multiple stages within a single context, from a userspace
> perspective. An ability is needed to individually associate the OA reports
> with their corresponding workloads(execbuffers), which may not be possible
> solely with ctx_id or pid information. This patch enables such a mechanism.
> 
> In this patch, rsvd2 field of execbuffer arguments is being utilized for
> passing the tag. A new bitfield in execbuffer flags is introduced in order
> to inform kernel of the tag being passed in execbuffer arguments.
> 
> Signed-off-by: Sourab Gupta <sourab.gupta at intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h            |  9 ++++++---
>  drivers/gpu/drm/i915/i915_gem_execbuffer.c |  8 ++++++--
>  drivers/gpu/drm/i915/i915_oa_perf.c        | 23 ++++++++++++++++++++---
>  include/uapi/drm/i915_drm.h                | 21 ++++++++++++++++++---
>  4 files changed, 50 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 337a721..9409b4a 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1672,6 +1672,7 @@ struct i915_oa_rcs_node {
>  	bool discard;
>  	u32 ctx_id;
>  	u32 pid;
> +	u32 tag;
>  };
>  
> @@ -3165,7 +3167,8 @@ void i915_oa_context_pin_notify(struct drm_i915_private *dev_priv,
>  				struct intel_context *context);
>  void i915_oa_context_unpin_notify(struct drm_i915_private *dev_priv,
>  				  struct intel_context *context);
> -void i915_insert_profiling_cmd(struct intel_ringbuffer *ringbuf, u32 ctx_id);
> +void i915_insert_profiling_cmd(struct intel_ringbuffer *ringbuf, u32 ctx_id,
> +				int tag);

Sloppy. Is the ABI signed or unsigned? Arbitrary width or fixed?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list