All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sagar Arun Kamble <sagar.a.kamble@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Sourab Gupta <sourab.gupta@intel.com>
Subject: [PATCH 01/14] drm/i915: Add ctx getparam ioctl parameter to retrieve ctx unique id
Date: Mon, 28 Aug 2017 15:22:11 +0530	[thread overview]
Message-ID: <1503913944-3419-2-git-send-email-sagar.a.kamble@intel.com> (raw)
In-Reply-To: <1503913944-3419-1-git-send-email-sagar.a.kamble@intel.com>

From: Sourab Gupta <sourab.gupta@intel.com>

This patch adds a new ctx getparam ioctl parameter, which can be used to
retrieve ctx unique id by userspace.

This can be used by userspace to map the OA reports received in the
i915 perf samples with their associated ctx's (The OA reports have the
hw ctx ID information embedded for Gen8+).
Otherwise the userspace has no way of maintaining this association,
since it has the knowledge of only per-drm file specific ctx handles.

Signed-off-by: Sourab Gupta <sourab.gupta@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>
---
 drivers/gpu/drm/i915/i915_gem_context.c | 3 +++
 include/uapi/drm/i915_drm.h             | 1 +
 2 files changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index 58a2a44..2d7f1f0 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -1036,6 +1036,9 @@ int i915_gem_context_getparam_ioctl(struct drm_device *dev, void *data,
 	case I915_CONTEXT_PARAM_BANNABLE:
 		args->value = i915_gem_context_is_bannable(ctx);
 		break;
+	case I915_CONTEXT_PARAM_HW_ID:
+		args->value = ctx->hw_id;
+		break;
 	default:
 		ret = -EINVAL;
 		break;
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index 6598fb7..92acfc2 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -1358,6 +1358,7 @@ struct drm_i915_gem_context_param {
 #define I915_CONTEXT_PARAM_GTT_SIZE	0x3
 #define I915_CONTEXT_PARAM_NO_ERROR_CAPTURE	0x4
 #define I915_CONTEXT_PARAM_BANNABLE	0x5
+#define I915_CONTEXT_PARAM_HW_ID	0x6
 	__u64 value;
 };
 
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-08-28  9:49 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-28  9:52 [PATCH 00/14] i915 perf support for command stream based OA, GPU and workload metrics capture Sagar Arun Kamble
2017-08-28  9:52 ` Sagar Arun Kamble [this message]
2017-08-28  9:52 ` [PATCH 02/14] drm/i915: Expose OA sample source to userspace Sagar Arun Kamble
2017-08-28  9:52 ` [PATCH 03/14] drm/i915: Framework for capturing command stream based OA reports Sagar Arun Kamble
2017-08-28  9:52 ` [PATCH 04/14] drm/i915: Define CTX_ID property for perf sampling Sagar Arun Kamble
2017-08-28  9:52 ` [PATCH 05/14] drm/i915: Flush periodic samples, in case of no pending CS sample requests Sagar Arun Kamble
2017-08-28  9:52 ` [PATCH 06/14] drm/i915: Inform userspace about command stream OA buf overflow Sagar Arun Kamble
2017-08-28  9:52 ` [PATCH 07/14] drm/i915: Populate ctx ID for periodic OA reports Sagar Arun Kamble
2017-08-28  9:52 ` [PATCH 08/14] drm/i915: Add support for having pid output with OA report Sagar Arun Kamble
2017-08-28  9:52 ` [PATCH 09/14] drm/i915: Add support for emitting execbuffer tags through OA counter reports Sagar Arun Kamble
2017-08-28  9:52 ` [PATCH 10/14] drm/i915: Link perf stream structures with Engines Sagar Arun Kamble
2017-08-28  9:52 ` [PATCH 11/14] drm/i915: Add support for collecting timestamps on all gpu engines Sagar Arun Kamble
2017-08-28  9:52 ` [PATCH 12/14] drm/i915: Extract raw GPU timestamps from OA reports to forward in perf samples Sagar Arun Kamble
2017-08-28  9:52 ` [PATCH 13/14] drm/i915: Async check for streams data availability with hrtimer rescheduling Sagar Arun Kamble
2017-08-28  9:52 ` [PATCH 14/14] drm/i915: Support for capturing MMIO register values Sagar Arun Kamble
2017-08-28 10:13 ` ✓ Fi.CI.BAT: success for i915 perf support for command stream based OA, GPU and workload metrics capture (rev2) Patchwork
2017-08-28 11:05 ` ✗ Fi.CI.IGT: failure " Patchwork
2017-09-07 10:06 [PATCH 00/14] i915 perf support for command stream based OA, GPU and workload metrics capture Sagar Arun Kamble
2017-09-07 10:06 ` [PATCH 01/14] drm/i915: Add ctx getparam ioctl parameter to retrieve ctx unique id Sagar Arun Kamble

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=1503913944-3419-2-git-send-email-sagar.a.kamble@intel.com \
    --to=sagar.a.kamble@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --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.