All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: sourab.gupta@intel.com
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	intel-gfx@lists.freedesktop.org,
	Matthew Auld <matthew.auld@intel.com>
Subject: Re: [PATCH 3/8] drm/i915: Framework for capturing command stream based OA reports
Date: Thu, 16 Mar 2017 08:31:37 +0000	[thread overview]
Message-ID: <20170316083137.GS2118@nuc-i3427.alporthouse.com> (raw)
In-Reply-To: <1489644855-25562-4-git-send-email-sourab.gupta@intel.com>

On Thu, Mar 16, 2017 at 11:44:10AM +0530, sourab.gupta@intel.com wrote:
> +static void i915_perf_command_stream_hook_oa(struct i915_perf_stream *stream,
> +					struct drm_i915_gem_request *request)
> +{
> +	struct drm_i915_private *dev_priv = request->i915;
> +	struct i915_gem_context *ctx = request->ctx;
> +	struct i915_perf_cs_sample *sample;
> +	u32 addr = 0;
> +	u32 cmd, *cs;
> +
> +	sample = kzalloc(sizeof(*sample), GFP_KERNEL);
> +	if (sample == NULL) {
> +		DRM_ERROR("Perf sample alloc failed\n");
> +		return;
> +	}
> +
> +	cs = intel_ring_begin(request, 4);
> +	if (IS_ERR(cs)) {
> +		kfree(sample);
> +		return;
> +	}
> +
> +	sample->ctx_id = ctx->hw_id;
> +	i915_gem_request_assign(&sample->request, request);
> +
> +	insert_perf_sample(dev_priv, sample);
> +
> +	addr = dev_priv->perf.command_stream_buf.vma->node.start +
> +		sample->offset;
> +
> +	if (WARN_ON(addr & 0x3f)) {
> +		DRM_ERROR("OA buffer address not aligned to 64 byte");
> +		return;
> +	}
> +
> +	cmd = MI_REPORT_PERF_COUNT | (1<<0);
> +	if (INTEL_GEN(dev_priv) >= 8)
> +		cmd |= (2<<0);
> +
> +	*cs++ = cmd;
> +	*cs++ = addr | MI_REPORT_PERF_COUNT_GGTT;
> +	*cs++ = request->global_seqno;

request->global_seqno is always zero at this point, and is subject to
change after assignment.

[ctx:engine or request->fence.context]:request->fence.seqno is permanent.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2017-03-16  8:31 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-16  6:14 [PATCH 0/8] Collect command stream based OA reports using i915 perf sourab.gupta
2017-03-16  6:14 ` [PATCH 1/8] drm/i915: Add ctx getparam ioctl parameter to retrieve ctx unique id sourab.gupta
2017-03-16  8:23   ` Chris Wilson
2017-03-16  6:14 ` [PATCH 2/8] drm/i915: Expose OA sample source to userspace sourab.gupta
2017-03-16 14:20   ` Robert Bragg
2017-03-16  6:14 ` [PATCH 3/8] drm/i915: Framework for capturing command stream based OA reports sourab.gupta
2017-03-16  8:10   ` Chris Wilson
2017-03-16  8:54     ` sourab gupta
2017-03-16  9:03       ` Chris Wilson
2017-03-16  9:52         ` sourab gupta
2017-03-16 10:09           ` Chris Wilson
2017-03-16 13:12             ` sourab gupta
2017-03-16 13:27               ` Chris Wilson
2017-03-16  8:31   ` Chris Wilson [this message]
2017-03-16  8:57     ` sourab gupta
2017-03-16  6:14 ` [PATCH 4/8] drm/i915: flush periodic samples, in case of no pending CS sample requests sourab.gupta
2017-03-16  6:14 ` [PATCH 5/8] drm/i915: Inform userspace about command stream OA buf overflow sourab.gupta
2017-03-16  6:14 ` [PATCH 6/8] drm/i915: Populate ctx ID for periodic OA reports sourab.gupta
2017-03-16  6:14 ` [PATCH 7/8] drm/i915: Add support for having pid output with OA report sourab.gupta
2017-03-16  6:14 ` [PATCH 8/8] drm/i915: Add support for emitting execbuffer tags through OA counter reports sourab.gupta
2017-03-16  8:13   ` Chris Wilson
2017-03-16  6:30 ` ✓ Fi.CI.BAT: success for Collect command stream based OA reports using i915 perf Patchwork
2017-03-16 12:59 ` [PATCH 0/8] " Robert Bragg
2017-03-17  5:29   ` sourab gupta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170316083137.GS2118@nuc-i3427.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.auld@intel.com \
    --cc=sourab.gupta@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.