All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH v8 03/13] drm/i915/perf: introduce a versioning of the i915-perf uapi
Date: Tue,  9 Jul 2019 15:33:41 +0300	[thread overview]
Message-ID: <20190709123351.5645-4-lionel.g.landwerlin@intel.com> (raw)
In-Reply-To: <20190709123351.5645-1-lionel.g.landwerlin@intel.com>

Reporting this version will help application figure out what level of
the support the running kernel provides.

v2: Add i915_perf_ioctl_version() (Chris)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_drv.c  |  3 +++
 drivers/gpu/drm/i915/i915_drv.h  |  1 +
 drivers/gpu/drm/i915/i915_perf.c | 10 ++++++++++
 include/uapi/drm/i915_drm.h      | 21 +++++++++++++++++++++
 4 files changed, 35 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 794c6814a6d0..f70ad7adaea5 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -483,6 +483,9 @@ static int i915_getparam_ioctl(struct drm_device *dev, void *data,
 	case I915_PARAM_MMAP_GTT_COHERENT:
 		value = INTEL_INFO(dev_priv)->has_coherent_ggtt;
 		break;
+	case I915_PARAM_PERF_REVISION:
+		value = i915_perf_ioctl_version();
+		break;
 	default:
 		DRM_DEBUG("Unknown parameter %d\n", param->param);
 		return -EINVAL;
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index f9878cbef4d9..e4b010085f2d 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2673,6 +2673,7 @@ extern void i915_perf_init(struct drm_i915_private *dev_priv);
 extern void i915_perf_fini(struct drm_i915_private *dev_priv);
 extern void i915_perf_register(struct drm_i915_private *dev_priv);
 extern void i915_perf_unregister(struct drm_i915_private *dev_priv);
+int i915_perf_ioctl_version(void);
 
 /* i915_suspend.c */
 extern int i915_save_state(struct drm_i915_private *dev_priv);
diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
index 545d3adaf341..fed959181773 100644
--- a/drivers/gpu/drm/i915/i915_perf.c
+++ b/drivers/gpu/drm/i915/i915_perf.c
@@ -3570,3 +3570,13 @@ void i915_perf_fini(struct drm_i915_private *dev_priv)
 
 	dev_priv->perf.initialized = false;
 }
+
+/**
+ * i915_perf_ioctl_version - Version of the i915-perf subsystem
+ *
+ * This version number is used by userspace to detect available features.
+ */
+int i915_perf_ioctl_version(void)
+{
+	return 1;
+}
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index 469dc512cca3..ea02b168ac3a 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -611,6 +611,13 @@ typedef struct drm_i915_irq_wait {
  * See I915_EXEC_FENCE_OUT and I915_EXEC_FENCE_SUBMIT.
  */
 #define I915_PARAM_HAS_EXEC_SUBMIT_FENCE 53
+
+/*
+ * Revision of the i915-perf uAPI. The value returned helps determine what
+ * i915-perf features are available. See drm_i915_perf_property_id.
+ */
+#define I915_PARAM_PERF_REVISION	54
+
 /* Must be kept compact -- no holes and well documented */
 
 typedef struct drm_i915_getparam {
@@ -1844,23 +1851,31 @@ enum drm_i915_perf_property_id {
 	 * Open the stream for a specific context handle (as used with
 	 * execbuffer2). A stream opened for a specific context this way
 	 * won't typically require root privileges.
+	 *
+	 * This property is available in perf revision 1.
 	 */
 	DRM_I915_PERF_PROP_CTX_HANDLE = 1,
 
 	/**
 	 * A value of 1 requests the inclusion of raw OA unit reports as
 	 * part of stream samples.
+	 *
+	 * This property is available in perf revision 1.
 	 */
 	DRM_I915_PERF_PROP_SAMPLE_OA,
 
 	/**
 	 * The value specifies which set of OA unit metrics should be
 	 * be configured, defining the contents of any OA unit reports.
+	 *
+	 * This property is available in perf revision 1.
 	 */
 	DRM_I915_PERF_PROP_OA_METRICS_SET,
 
 	/**
 	 * The value specifies the size and layout of OA unit reports.
+	 *
+	 * This property is available in perf revision 1.
 	 */
 	DRM_I915_PERF_PROP_OA_FORMAT,
 
@@ -1870,6 +1885,8 @@ enum drm_i915_perf_property_id {
 	 * from this exponent as follows:
 	 *
 	 *   80ns * 2^(period_exponent + 1)
+	 *
+	 * This property is available in perf revision 1.
 	 */
 	DRM_I915_PERF_PROP_OA_EXPONENT,
 
@@ -1901,6 +1918,8 @@ struct drm_i915_perf_open_param {
  * to close and re-open a stream with the same configuration.
  *
  * It's undefined whether any pending data for the stream will be lost.
+ *
+ * This ioctl is available in perf revision 1.
  */
 #define I915_PERF_IOCTL_ENABLE	_IO('i', 0x0)
 
@@ -1908,6 +1927,8 @@ struct drm_i915_perf_open_param {
  * Disable data capture for a stream.
  *
  * It is an error to try and read a stream that is disabled.
+ *
+ * This ioctl is available in perf revision 1.
  */
 #define I915_PERF_IOCTL_DISABLE	_IO('i', 0x1)
 
-- 
2.22.0

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

  parent reply	other threads:[~2019-07-09 12:34 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-09 12:33 [PATCH v8 00/13] drm/i915: Vulkan performance query support Lionel Landwerlin
2019-07-09 12:33 ` [PATCH v8 01/13] drm/i915/perf: ensure we keep a reference on the driver Lionel Landwerlin
2019-07-09 12:33 ` [PATCH v8 02/13] drm/i915/perf: add missing delay for OA muxes configuration Lionel Landwerlin
2019-07-09 12:33 ` Lionel Landwerlin [this message]
2019-07-09 12:33 ` [PATCH v8 04/13] drm/i915/perf: allow for CS OA configs to be created lazily Lionel Landwerlin
2019-07-09 12:33 ` [PATCH v8 05/13] drm/i915: enumerate scratch fields Lionel Landwerlin
2019-07-09 12:33 ` [PATCH v8 06/13] drm/i915/perf: implement active wait for noa configurations Lionel Landwerlin
2019-07-10 23:43   ` Umesh Nerlige Ramappa
     [not found]     ` <156282659660.12280.4199368775706498585@skylake-alporthouse-com>
2019-07-11  7:47       ` Lionel Landwerlin
2019-07-09 12:33 ` [PATCH v8 07/13] drm/i915: introduce a mechanism to extend execbuf2 Lionel Landwerlin
2019-07-09 12:33 ` [PATCH v8 08/13] drm/i915: add syncobj timeline support Lionel Landwerlin
2019-07-09 12:33 ` [PATCH v8 09/13] drm/i915: add a new perf configuration execbuf parameter Lionel Landwerlin
2019-07-09 12:53   ` Lionel Landwerlin
2019-07-09 13:10     ` Chris Wilson
2019-07-09 13:13       ` Chris Wilson
2019-07-10 11:09   ` Chris Wilson
2019-07-09 12:33 ` [PATCH v8 10/13] drm/i915: add infrastructure to hold off preemption on a request Lionel Landwerlin
2019-07-09 14:18   ` Chris Wilson
2019-07-09 12:33 ` [PATCH v8 11/13] drm/i915/perf: allow holding preemption on filtered ctx Lionel Landwerlin
2019-07-09 12:33 ` [PATCH v8 12/13] drm/i915/perf: execute OA configuration from command stream Lionel Landwerlin
2019-07-09 12:33 ` [PATCH v8 13/13] drm/i915: add support for perf configuration queries Lionel Landwerlin
2019-07-10 11:04   ` Chris Wilson
2019-07-09 13:08 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Vulkan performance query support (rev8) Patchwork
2019-07-09 13:15 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-07-09 13:27 ` ✓ Fi.CI.BAT: success " Patchwork
2019-07-09 20:30 ` [PATCH v8 00/13] drm/i915: Vulkan performance query support Chris Wilson
2019-07-10  9:06   ` Lionel Landwerlin
2019-07-10  1:20 ` ✗ Fi.CI.IGT: failure for drm/i915: Vulkan performance query support (rev8) Patchwork

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=20190709123351.5645-4-lionel.g.landwerlin@intel.com \
    --to=lionel.g.landwerlin@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.