All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v11] drm/i915: Engine discovery query
@ 2019-05-02  6:30 Tvrtko Ursulin
  2019-05-02  6:58 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Engine discovery query (rev10) Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Tvrtko Ursulin @ 2019-05-02  6:30 UTC (permalink / raw)
  To: Intel-gfx

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Engine discovery query allows userspace to enumerate engines, probe their
configuration features, all without needing to maintain the internal PCI
ID based database.

A new query for the generic i915 query ioctl is added named
DRM_I915_QUERY_ENGINE_INFO, together with accompanying structure
drm_i915_query_engine_info. The address of latter should be passed to the
kernel in the query.data_ptr field, and should be large enough for the
kernel to fill out all known engines as struct drm_i915_engine_info
elements trailing the query.

As with other queries, setting the item query length to zero allows
userspace to query minimum required buffer size.

Enumerated engines have common type mask which can be used to query all
hardware engines, versus engines userspace can submit to using the execbuf
uAPI.

Engines also have capabilities which are per engine class namespace of
bits describing features not present on all engine instances.

v2:
 * Fixed HEVC assignment.
 * Reorder some fields, rename type to flags, increase width. (Lionel)
 * No need to allocate temporary storage if we do it engine by engine.
   (Lionel)

v3:
 * Describe engine flags and mark mbz fields. (Lionel)
 * HEVC only applies to VCS.

v4:
 * Squash SFC flag into main patch.
 * Tidy some comments.

v5:
 * Add uabi_ prefix to engine capabilities. (Chris Wilson)
 * Report exact size of engine info array. (Chris Wilson)
 * Drop the engine flags. (Joonas Lahtinen)
 * Added some more reserved fields.
 * Move flags after class/instance.

v6:
 * Do not check engine info array was zeroed by userspace but zero the
   unused fields for them instead.

v7:
 * Simplify length calculation loop. (Lionel Landwerlin)

v8:
 * Remove MBZ comments where not applicable.
 * Rename ABI flags to match engine class define naming.
 * Rename SFC ABI flag to reflect it applies to VCS and VECS.
 * SFC is wired to even _logical_ engine instances.
 * SFC applies to VCS and VECS.
 * HEVC is present on all instances on Gen11. (Tony)
 * Simplify length calculation even more. (Chris Wilson)
 * Move info_ptr assigment closer to loop for clarity. (Chris Wilson)
 * Use vdbox_sfc_access from runtime info.
 * Rebase for RUNTIME_INFO.
 * Refactor for lower indentation.
 * Rename uAPI class/instance to engine_class/instance to avoid C++
   keyword.

v9:
 * Rebase for s/num_rings/num_engines/ in RUNTIME_INFO.

v10:
 * Use new copy_query_item.

v11:
 * Consolidate with struct i915_engine_class_instnace.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jon Bloomfield <jon.bloomfield@intel.com>
Cc: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Tony Ye <tony.ye@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> # v7
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
---
Test-with: 20190501114259.16158-3-tvrtko.ursulin@linux.intel.com
---
 drivers/gpu/drm/i915/gt/intel_engine_cs.c    | 41 ++++++++++++++++
 drivers/gpu/drm/i915/gt/intel_engine_types.h |  2 +
 drivers/gpu/drm/i915/i915_query.c            | 49 ++++++++++++++++++++
 include/uapi/drm/i915_drm.h                  | 42 +++++++++++++++++
 4 files changed, 134 insertions(+)

diff --git a/drivers/gpu/drm/i915/gt/intel_engine_cs.c b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
index 6e40f8ea9a6a..1f3900646146 100644
--- a/drivers/gpu/drm/i915/gt/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
@@ -349,6 +349,45 @@ intel_engine_setup(struct drm_i915_private *dev_priv,
 	return 0;
 }
 
+static void __setup_engine_capabilities(struct intel_engine_cs *engine)
+{
+	struct drm_i915_private *i915 = engine->i915;
+
+	if (engine->class == VIDEO_DECODE_CLASS) {
+		/*
+		 * HEVC support is present on first engine instance
+		 * before Gen11 and on all instances afterwards.
+		 */
+		if (INTEL_GEN(i915) >= 11 ||
+		    (INTEL_GEN(i915) >= 9 && engine->instance == 0))
+			engine->uabi_capabilities |=
+				I915_VIDEO_CLASS_CAPABILITY_HEVC;
+
+		/*
+		 * SFC block is present only on even logical engine
+		 * instances.
+		 */
+		if ((INTEL_GEN(i915) >= 11 &&
+		     RUNTIME_INFO(i915)->vdbox_sfc_access & engine->mask) ||
+		    (INTEL_GEN(i915) >= 9 && engine->instance == 0))
+			engine->uabi_capabilities |=
+				I915_VIDEO_AND_ENHANCE_CLASS_CAPABILITY_SFC;
+	} else if (engine->class == VIDEO_ENHANCEMENT_CLASS) {
+		if (INTEL_GEN(i915) >= 9)
+			engine->uabi_capabilities |=
+				I915_VIDEO_AND_ENHANCE_CLASS_CAPABILITY_SFC;
+	}
+}
+
+static void intel_setup_engine_capabilities(struct drm_i915_private *i915)
+{
+	struct intel_engine_cs *engine;
+	enum intel_engine_id id;
+
+	for_each_engine(engine, i915, id)
+		__setup_engine_capabilities(engine);
+}
+
 /**
  * intel_engines_cleanup() - free the resources allocated for Command Streamers
  * @i915: the i915 devic
@@ -414,6 +453,8 @@ int intel_engines_init_mmio(struct drm_i915_private *i915)
 
 	i915_check_and_clear_faults(i915);
 
+	intel_setup_engine_capabilities(i915);
+
 	return 0;
 
 cleanup:
diff --git a/drivers/gpu/drm/i915/gt/intel_engine_types.h b/drivers/gpu/drm/i915/gt/intel_engine_types.h
index 9d64e33f8427..a5602bb5080a 100644
--- a/drivers/gpu/drm/i915/gt/intel_engine_types.h
+++ b/drivers/gpu/drm/i915/gt/intel_engine_types.h
@@ -279,6 +279,8 @@ struct intel_engine_cs {
 	u32 context_size;
 	u32 mmio_base;
 
+	u32 uabi_capabilities;
+
 	struct intel_sseu sseu;
 
 	struct intel_ring *buffer;
diff --git a/drivers/gpu/drm/i915/i915_query.c b/drivers/gpu/drm/i915/i915_query.c
index 782183b78f49..414d0a6d1f70 100644
--- a/drivers/gpu/drm/i915/i915_query.c
+++ b/drivers/gpu/drm/i915/i915_query.c
@@ -96,9 +96,58 @@ static int query_topology_info(struct drm_i915_private *dev_priv,
 	return total_length;
 }
 
+static int
+query_engine_info(struct drm_i915_private *i915,
+		  struct drm_i915_query_item *query_item)
+{
+	struct drm_i915_query_engine_info __user *query_ptr =
+				u64_to_user_ptr(query_item->data_ptr);
+	struct drm_i915_engine_info __user *info_ptr;
+	struct drm_i915_query_engine_info query;
+	struct drm_i915_engine_info info = { };
+	struct intel_engine_cs *engine;
+	enum intel_engine_id id;
+	int len, ret;
+
+	if (query_item->flags)
+		return -EINVAL;
+
+	len = sizeof(struct drm_i915_query_engine_info) +
+	      RUNTIME_INFO(i915)->num_engines *
+	      sizeof(struct drm_i915_engine_info);
+
+	ret = copy_query_item(&query, sizeof(query), len, query_item);
+	if (ret != 0)
+		return ret;
+
+	if (query.num_engines || query.rsvd[0] || query.rsvd[1] ||
+	    query.rsvd[2])
+		return -EINVAL;
+
+	info_ptr = &query_ptr->engines[0];
+
+	for_each_engine(engine, i915, id) {
+		info.engine.engine_class = engine->uabi_class;
+		info.engine.engine_instance = engine->instance;
+		info.capabilities = engine->uabi_capabilities;
+
+		if (__copy_to_user(info_ptr, &info, sizeof(info)))
+			return -EFAULT;
+
+		query.num_engines++;
+		info_ptr++;
+	}
+
+	if (__copy_to_user(query_ptr, &query, sizeof(query)))
+		return -EFAULT;
+
+	return len;
+}
+
 static int (* const i915_query_funcs[])(struct drm_i915_private *dev_priv,
 					struct drm_i915_query_item *query_item) = {
 	query_topology_info,
+	query_engine_info,
 };
 
 int i915_query_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index 3a73f5316766..8c54b766e9a1 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -1821,6 +1821,7 @@ struct drm_i915_perf_oa_config {
 struct drm_i915_query_item {
 	__u64 query_id;
 #define DRM_I915_QUERY_TOPOLOGY_INFO    1
+#define DRM_I915_QUERY_ENGINE_INFO	2
 /* Must be kept compact -- no holes and well documented */
 
 	/*
@@ -1919,6 +1920,47 @@ struct drm_i915_query_topology_info {
 	__u8 data[];
 };
 
+/**
+ * struct drm_i915_engine_info
+ *
+ * Describes one engine and it's capabilities as known to the driver.
+ */
+struct drm_i915_engine_info {
+	/** Engine class and instance. */
+	struct i915_engine_class_instance engine;
+
+	/** Reserved field. */
+	__u32 rsvd0;
+
+	/** Engine flags. */
+	__u64 flags;
+
+	/** Capabilities of this engine. */
+	__u64 capabilities;
+#define I915_VIDEO_CLASS_CAPABILITY_HEVC		(1 << 0)
+#define I915_VIDEO_AND_ENHANCE_CLASS_CAPABILITY_SFC	(1 << 1)
+
+	/** Reserved fields. */
+	__u64 rsvd1[4];
+};
+
+/**
+ * struct drm_i915_query_engine_info
+ *
+ * Engine info query enumerates all engines known to the driver by filling in
+ * an array of struct drm_i915_engine_info structures.
+ */
+struct drm_i915_query_engine_info {
+	/** Number of struct drm_i915_engine_info structs following. */
+	__u32 num_engines;
+
+	/** MBZ */
+	__u32 rsvd[3];
+
+	/** Marker for drm_i915_engine_info structures. */
+	struct drm_i915_engine_info engines[];
+};
+
 #if defined(__cplusplus)
 }
 #endif
-- 
2.19.1

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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Engine discovery query (rev10)
  2019-05-02  6:30 [PATCH v11] drm/i915: Engine discovery query Tvrtko Ursulin
@ 2019-05-02  6:58 ` Patchwork
  2019-05-02  7:14 ` ✓ Fi.CI.BAT: success " Patchwork
  2019-05-02 13:15 ` ✓ Fi.CI.IGT: " Patchwork
  2 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2019-05-02  6:58 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Engine discovery query (rev10)
URL   : https://patchwork.freedesktop.org/series/39958/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
48c015259183 drm/i915: Engine discovery query
-:63: WARNING:TYPO_SPELLING: 'assigment' may be misspelled - perhaps 'assignment'?
#63: 
 * Move info_ptr assigment closer to loop for clarity. (Chris Wilson)

total: 0 errors, 1 warnings, 0 checks, 173 lines checked

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915: Engine discovery query (rev10)
  2019-05-02  6:30 [PATCH v11] drm/i915: Engine discovery query Tvrtko Ursulin
  2019-05-02  6:58 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Engine discovery query (rev10) Patchwork
@ 2019-05-02  7:14 ` Patchwork
  2019-05-02 13:15 ` ✓ Fi.CI.IGT: " Patchwork
  2 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2019-05-02  7:14 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Engine discovery query (rev10)
URL   : https://patchwork.freedesktop.org/series/39958/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6025 -> Patchwork_12932
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/39958/revisions/10/mbox/

Known issues
------------

  Here are the changes found in Patchwork_12932 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@i915_selftest@live_hangcheck:
    - fi-skl-iommu:       [PASS][1] -> [INCOMPLETE][2] ([fdo#108602] / [fdo#108744])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/fi-skl-iommu/igt@i915_selftest@live_hangcheck.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/fi-skl-iommu/igt@i915_selftest@live_hangcheck.html

  * igt@kms_cursor_legacy@basic-flip-before-cursor-varying-size:
    - fi-glk-dsi:         [PASS][3] -> [INCOMPLETE][4] ([fdo#103359] / [k.org#198133])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/fi-glk-dsi/igt@kms_cursor_legacy@basic-flip-before-cursor-varying-size.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/fi-glk-dsi/igt@kms_cursor_legacy@basic-flip-before-cursor-varying-size.html

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
    - fi-blb-e6850:       [PASS][5] -> [INCOMPLETE][6] ([fdo#107718])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/fi-blb-e6850/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/fi-blb-e6850/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html

  
#### Possible fixes ####

  * igt@gem_ctx_create@basic-files:
    - fi-icl-y:           [INCOMPLETE][7] ([fdo#107713] / [fdo#109100]) -> [PASS][8]
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/fi-icl-y/igt@gem_ctx_create@basic-files.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/fi-icl-y/igt@gem_ctx_create@basic-files.html

  * igt@i915_selftest@live_hangcheck:
    - fi-bsw-kefka:       [INCOMPLETE][9] ([fdo#105876]) -> [PASS][10]
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/fi-bsw-kefka/igt@i915_selftest@live_hangcheck.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/fi-bsw-kefka/igt@i915_selftest@live_hangcheck.html

  
  [fdo#103359]: https://bugs.freedesktop.org/show_bug.cgi?id=103359
  [fdo#105876]: https://bugs.freedesktop.org/show_bug.cgi?id=105876
  [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
  [fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
  [fdo#108602]: https://bugs.freedesktop.org/show_bug.cgi?id=108602
  [fdo#108744]: https://bugs.freedesktop.org/show_bug.cgi?id=108744
  [fdo#109100]: https://bugs.freedesktop.org/show_bug.cgi?id=109100
  [k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133


Participating hosts (50 -> 45)
------------------------------

  Additional (2): fi-icl-u2 fi-apl-guc 
  Missing    (7): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-byt-clapper 


Build changes
-------------

  * Linux: CI_DRM_6025 -> Patchwork_12932

  CI_DRM_6025: 60fc981bcf66e011011756e167e47cc4d4bebc10 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4971: fc5e0467eb6913d21ad932aa8a31c77fdb5a9c77 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_12932: 48c015259183d3799ae88a70031de3bf52a06a10 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

48c015259183 drm/i915: Engine discovery query

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* ✓ Fi.CI.IGT: success for drm/i915: Engine discovery query (rev10)
  2019-05-02  6:30 [PATCH v11] drm/i915: Engine discovery query Tvrtko Ursulin
  2019-05-02  6:58 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Engine discovery query (rev10) Patchwork
  2019-05-02  7:14 ` ✓ Fi.CI.BAT: success " Patchwork
@ 2019-05-02 13:15 ` Patchwork
  2 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2019-05-02 13:15 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Engine discovery query (rev10)
URL   : https://patchwork.freedesktop.org/series/39958/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6025_full -> Patchwork_12932_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  

Known issues
------------

  Here are the changes found in Patchwork_12932_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@debugfs_test@read_all_entries_display_off:
    - shard-skl:          [PASS][1] -> [INCOMPLETE][2] ([fdo#104108] / [fdo#110581])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/shard-skl10/igt@debugfs_test@read_all_entries_display_off.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/shard-skl7/igt@debugfs_test@read_all_entries_display_off.html

  * igt@gem_workarounds@suspend-resume-context:
    - shard-apl:          [PASS][3] -> [DMESG-WARN][4] ([fdo#108566]) +8 similar issues
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/shard-apl8/igt@gem_workarounds@suspend-resume-context.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/shard-apl4/igt@gem_workarounds@suspend-resume-context.html

  * igt@i915_pm_rpm@basic-rte:
    - shard-skl:          [PASS][5] -> [INCOMPLETE][6] ([fdo#107807] / [fdo#110581]) +1 similar issue
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/shard-skl10/igt@i915_pm_rpm@basic-rte.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/shard-skl4/igt@i915_pm_rpm@basic-rte.html

  * igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-a:
    - shard-skl:          [PASS][7] -> [INCOMPLETE][8] ([fdo#110581])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/shard-skl2/igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-a.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/shard-skl9/igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-a.html

  * igt@kms_flip@2x-flip-vs-dpms-interruptible:
    - shard-glk:          [PASS][9] -> [INCOMPLETE][10] ([fdo#103359] / [fdo#110581] / [k.org#198133])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/shard-glk6/igt@kms_flip@2x-flip-vs-dpms-interruptible.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/shard-glk5/igt@kms_flip@2x-flip-vs-dpms-interruptible.html

  * igt@kms_flip@2x-plain-flip-fb-recreate-interruptible:
    - shard-glk:          [PASS][11] -> [FAIL][12] ([fdo#100368])
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/shard-glk1/igt@kms_flip@2x-plain-flip-fb-recreate-interruptible.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/shard-glk2/igt@kms_flip@2x-plain-flip-fb-recreate-interruptible.html

  * igt@kms_flip_tiling@flip-changes-tiling:
    - shard-iclb:         [PASS][13] -> [INCOMPLETE][14] ([fdo#107713] / [fdo#110581]) +1 similar issue
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/shard-iclb2/igt@kms_flip_tiling@flip-changes-tiling.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/shard-iclb1/igt@kms_flip_tiling@flip-changes-tiling.html

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-shrfb-draw-render:
    - shard-iclb:         [PASS][15] -> [FAIL][16] ([fdo#103167]) +5 similar issues
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/shard-iclb5/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-shrfb-draw-render.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/shard-iclb6/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-shrfb-draw-render.html

  * igt@kms_plane@pixel-format-pipe-b-planes-source-clamping:
    - shard-glk:          [PASS][17] -> [SKIP][18] ([fdo#109271])
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/shard-glk9/igt@kms_plane@pixel-format-pipe-b-planes-source-clamping.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/shard-glk8/igt@kms_plane@pixel-format-pipe-b-planes-source-clamping.html

  * igt@kms_plane_scaling@pipe-b-scaler-with-clipping-clamping:
    - shard-iclb:         [PASS][19] -> [INCOMPLETE][20] ([fdo#107713] / [fdo#110041] / [fdo#110581])
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/shard-iclb6/igt@kms_plane_scaling@pipe-b-scaler-with-clipping-clamping.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/shard-iclb3/igt@kms_plane_scaling@pipe-b-scaler-with-clipping-clamping.html

  * igt@kms_psr@psr2_cursor_plane_onoff:
    - shard-iclb:         [PASS][21] -> [SKIP][22] ([fdo#109441]) +2 similar issues
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/shard-iclb2/igt@kms_psr@psr2_cursor_plane_onoff.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/shard-iclb7/igt@kms_psr@psr2_cursor_plane_onoff.html

  * igt@kms_setmode@basic:
    - shard-kbl:          [PASS][23] -> [FAIL][24] ([fdo#99912])
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/shard-kbl2/igt@kms_setmode@basic.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/shard-kbl5/igt@kms_setmode@basic.html

  
#### Possible fixes ####

  * igt@i915_pm_rpm@debugfs-forcewake-user:
    - shard-skl:          [INCOMPLETE][25] ([fdo#107807] / [fdo#110581]) -> [PASS][26]
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/shard-skl2/igt@i915_pm_rpm@debugfs-forcewake-user.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/shard-skl3/igt@i915_pm_rpm@debugfs-forcewake-user.html

  * igt@kms_cursor_crc@cursor-128x128-suspend:
    - shard-apl:          [DMESG-WARN][27] ([fdo#108566]) -> [PASS][28] +2 similar issues
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/shard-apl3/igt@kms_cursor_crc@cursor-128x128-suspend.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/shard-apl7/igt@kms_cursor_crc@cursor-128x128-suspend.html

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy:
    - shard-snb:          [SKIP][29] ([fdo#109271]) -> [PASS][30] +1 similar issue
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/shard-snb4/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/shard-snb7/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy.html

  * igt@kms_cursor_legacy@cursor-vs-flip-varying-size:
    - shard-skl:          [INCOMPLETE][31] ([fdo#110581]) -> [PASS][32] +2 similar issues
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/shard-skl8/igt@kms_cursor_legacy@cursor-vs-flip-varying-size.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/shard-skl6/igt@kms_cursor_legacy@cursor-vs-flip-varying-size.html

  * igt@kms_dp_dsc@basic-dsc-enable-edp:
    - shard-iclb:         [SKIP][33] ([fdo#109349]) -> [PASS][34]
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/shard-iclb8/igt@kms_dp_dsc@basic-dsc-enable-edp.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/shard-iclb2/igt@kms_dp_dsc@basic-dsc-enable-edp.html

  * igt@kms_flip@flip-vs-suspend-interruptible:
    - shard-kbl:          [DMESG-WARN][35] ([fdo#103313]) -> [PASS][36]
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/shard-kbl3/igt@kms_flip@flip-vs-suspend-interruptible.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/shard-kbl4/igt@kms_flip@flip-vs-suspend-interruptible.html

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-blt:
    - shard-iclb:         [FAIL][37] ([fdo#103167]) -> [PASS][38] +1 similar issue
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/shard-iclb2/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-blt.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/shard-iclb7/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-blt.html

  * igt@kms_plane@pixel-format-pipe-a-planes-source-clamping:
    - shard-iclb:         [INCOMPLETE][39] ([fdo#107713] / [fdo#110036 ] / [fdo#110581]) -> [PASS][40]
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/shard-iclb3/igt@kms_plane@pixel-format-pipe-a-planes-source-clamping.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/shard-iclb8/igt@kms_plane@pixel-format-pipe-a-planes-source-clamping.html

  * igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
    - shard-skl:          [FAIL][41] ([fdo#108145] / [fdo#110403]) -> [PASS][42]
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/shard-skl2/igt@kms_plane_alpha_blend@pipe-c-coverage-7efc.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/shard-skl9/igt@kms_plane_alpha_blend@pipe-c-coverage-7efc.html

  * igt@kms_plane_lowres@pipe-a-tiling-x:
    - shard-iclb:         [FAIL][43] ([fdo#103166]) -> [PASS][44] +1 similar issue
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/shard-iclb7/igt@kms_plane_lowres@pipe-a-tiling-x.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/shard-iclb3/igt@kms_plane_lowres@pipe-a-tiling-x.html

  * igt@kms_plane_scaling@pipe-a-scaler-with-pixel-format:
    - shard-glk:          [SKIP][45] ([fdo#109271] / [fdo#109278]) -> [PASS][46] +1 similar issue
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/shard-glk3/igt@kms_plane_scaling@pipe-a-scaler-with-pixel-format.html
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/shard-glk9/igt@kms_plane_scaling@pipe-a-scaler-with-pixel-format.html

  * igt@kms_psr@psr2_cursor_mmap_cpu:
    - shard-iclb:         [SKIP][47] ([fdo#109441]) -> [PASS][48] +2 similar issues
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/shard-iclb4/igt@kms_psr@psr2_cursor_mmap_cpu.html
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/shard-iclb2/igt@kms_psr@psr2_cursor_mmap_cpu.html

  * igt@kms_rotation_crc@sprite-rotation-180:
    - shard-skl:          [INCOMPLETE][49] ([fdo#108972] / [fdo#110581]) -> [PASS][50]
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/shard-skl5/igt@kms_rotation_crc@sprite-rotation-180.html
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/shard-skl4/igt@kms_rotation_crc@sprite-rotation-180.html

  * igt@kms_setmode@basic:
    - shard-apl:          [FAIL][51] ([fdo#99912]) -> [PASS][52]
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/shard-apl8/igt@kms_setmode@basic.html
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/shard-apl5/igt@kms_setmode@basic.html

  
#### Warnings ####

  * igt@gem_tiled_fence_blits@normal:
    - shard-skl:          [SKIP][53] ([fdo#109271]) -> [INCOMPLETE][54] ([fdo#110581])
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/shard-skl6/igt@gem_tiled_fence_blits@normal.html
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/shard-skl2/igt@gem_tiled_fence_blits@normal.html

  * igt@kms_cursor_crc@cursor-256x256-dpms:
    - shard-iclb:         [INCOMPLETE][55] ([fdo#107713] / [fdo#110581]) -> [FAIL][56] ([fdo#103232])
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/shard-iclb7/igt@kms_cursor_crc@cursor-256x256-dpms.html
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/shard-iclb8/igt@kms_cursor_crc@cursor-256x256-dpms.html

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-spr-indfb-move:
    - shard-skl:          [FAIL][57] ([fdo#108040]) -> [FAIL][58] ([fdo#103167])
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6025/shard-skl3/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-spr-indfb-move.html
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/shard-skl8/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-spr-indfb-move.html

  
  [fdo#100368]: https://bugs.freedesktop.org/show_bug.cgi?id=100368
  [fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
  [fdo#103313]: https://bugs.freedesktop.org/show_bug.cgi?id=103313
  [fdo#103359]: https://bugs.freedesktop.org/show_bug.cgi?id=103359
  [fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
  [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
  [fdo#107807]: https://bugs.freedesktop.org/show_bug.cgi?id=107807
  [fdo#108040]: https://bugs.freedesktop.org/show_bug.cgi?id=108040
  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
  [fdo#108972]: https://bugs.freedesktop.org/show_bug.cgi?id=108972
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#109349]: https://bugs.freedesktop.org/show_bug.cgi?id=109349
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [fdo#110036 ]: https://bugs.freedesktop.org/show_bug.cgi?id=110036 
  [fdo#110041]: https://bugs.freedesktop.org/show_bug.cgi?id=110041
  [fdo#110403]: https://bugs.freedesktop.org/show_bug.cgi?id=110403
  [fdo#110581]: https://bugs.freedesktop.org/show_bug.cgi?id=110581
  [fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912
  [k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133


Participating hosts (9 -> 9)
------------------------------

  No changes in participating hosts


Build changes
-------------

  * Linux: CI_DRM_6025 -> Patchwork_12932

  CI_DRM_6025: 60fc981bcf66e011011756e167e47cc4d4bebc10 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4971: fc5e0467eb6913d21ad932aa8a31c77fdb5a9c77 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_12932: 48c015259183d3799ae88a70031de3bf52a06a10 @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12932/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v11] drm/i915: Engine discovery query
  2019-05-01 15:51       ` Tvrtko Ursulin
@ 2019-05-01 15:58         ` Chris Wilson
  0 siblings, 0 replies; 10+ messages in thread
From: Chris Wilson @ 2019-05-01 15:58 UTC (permalink / raw)
  To: Intel-gfx, Tvrtko Ursulin

Quoting Tvrtko Ursulin (2019-05-01 16:51:28)
> 
> On 01/05/2019 12:55, Chris Wilson wrote:
> > Quoting Tvrtko Ursulin (2019-05-01 12:45:36)
> >> Hmm.. probably manual check for no holes _and_ alignment is good enough
> >> for uAPI since once it's in it's in. Will triple-check.
> > 
> > Yeah, we actually need something more like
> > offsetofend(previous_field) == offsetof(next_field)
> > 
> > BUILD_BUG_ON(check_user_struct(info, previous_field, next_field)) ?
> 
> How would you logistically do it? List all struct members for each uapi 
> struct you want to check?
> 
> Maybe a variadic macro like:
> 
> CHECK_USER_STRUCT_FUNCTION(type, member0, ... memberN);
> 
> Which expands to a dedicated function to check this type, using 
> va_start/va_end to iterate all members checking for holes. So somewhere 
> in code we would also need:
> 
> CHECK_USER_STRUCT(type);
> 
> Which would call the function. But thats not build time.. Could be under 
> debug and selftests I guess. Could even be IGT in this case.
> 
> But I am not to keen in listing each struct member with a 
> prev/next_field BUILD_BUG_ON.
> 
> Perhaps IGT is indeed a better place to start testing for this. Since we 
> anyway require each new uAPI to have good IGT coverage.

Definitely don't like the idea of doing it manually, I could have just
about accepted it if we could have rolled it into a get_user wrapper.

We should just go annoy Jani to whip up some Makefile magic to call
pahole and check the structs defined in uapi.h
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v11] drm/i915: Engine discovery query
  2019-05-01 11:55     ` Chris Wilson
@ 2019-05-01 15:51       ` Tvrtko Ursulin
  2019-05-01 15:58         ` Chris Wilson
  0 siblings, 1 reply; 10+ messages in thread
From: Tvrtko Ursulin @ 2019-05-01 15:51 UTC (permalink / raw)
  To: Chris Wilson, Intel-gfx


On 01/05/2019 12:55, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2019-05-01 12:45:36)
>>
>> On 01/05/2019 12:10, Chris Wilson wrote:
>>> Quoting Tvrtko Ursulin (2019-05-01 11:52:28)
>>>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>>>
>>>> Engine discovery query allows userspace to enumerate engines, probe their
>>>> configuration features, all without needing to maintain the internal PCI
>>>> ID based database.
>>>>
>>>> A new query for the generic i915 query ioctl is added named
>>>> DRM_I915_QUERY_ENGINE_INFO, together with accompanying structure
>>>> drm_i915_query_engine_info. The address of latter should be passed to the
>>>> kernel in the query.data_ptr field, and should be large enough for the
>>>> kernel to fill out all known engines as struct drm_i915_engine_info
>>>> elements trailing the query.
>>>>
>>>> As with other queries, setting the item query length to zero allows
>>>> userspace to query minimum required buffer size.
>>>>
>>>> Enumerated engines have common type mask which can be used to query all
>>>> hardware engines, versus engines userspace can submit to using the execbuf
>>>> uAPI.
>>>>
>>>> Engines also have capabilities which are per engine class namespace of
>>>> bits describing features not present on all engine instances.
>>>>
>>>> v2:
>>>>    * Fixed HEVC assignment.
>>>>    * Reorder some fields, rename type to flags, increase width. (Lionel)
>>>>    * No need to allocate temporary storage if we do it engine by engine.
>>>>      (Lionel)
>>>>
>>>> v3:
>>>>    * Describe engine flags and mark mbz fields. (Lionel)
>>>>    * HEVC only applies to VCS.
>>>>
>>>> v4:
>>>>    * Squash SFC flag into main patch.
>>>>    * Tidy some comments.
>>>>
>>>> v5:
>>>>    * Add uabi_ prefix to engine capabilities. (Chris Wilson)
>>>>    * Report exact size of engine info array. (Chris Wilson)
>>>>    * Drop the engine flags. (Joonas Lahtinen)
>>>>    * Added some more reserved fields.
>>>>    * Move flags after class/instance.
>>>>
>>>> v6:
>>>>    * Do not check engine info array was zeroed by userspace but zero the
>>>>      unused fields for them instead.
>>>>
>>>> v7:
>>>>    * Simplify length calculation loop. (Lionel Landwerlin)
>>>>
>>>> v8:
>>>>    * Remove MBZ comments where not applicable.
>>>>    * Rename ABI flags to match engine class define naming.
>>>>    * Rename SFC ABI flag to reflect it applies to VCS and VECS.
>>>>    * SFC is wired to even _logical_ engine instances.
>>>>    * SFC applies to VCS and VECS.
>>>>    * HEVC is present on all instances on Gen11. (Tony)
>>>>    * Simplify length calculation even more. (Chris Wilson)
>>>>    * Move info_ptr assigment closer to loop for clarity. (Chris Wilson)
>>>>    * Use vdbox_sfc_access from runtime info.
>>>>    * Rebase for RUNTIME_INFO.
>>>>    * Refactor for lower indentation.
>>>>    * Rename uAPI class/instance to engine_class/instance to avoid C++
>>>>      keyword.
>>>>
>>>> v9:
>>>>    * Rebase for s/num_rings/num_engines/ in RUNTIME_INFO.
>>>>
>>>> v10:
>>>>    * Use new copy_query_item.
>>>>
>>>> v11:
>>>>    * Consolidate with struct i915_engine_class_instnace.
>>>>
>>>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>>>> Cc: Jon Bloomfield <jon.bloomfield@intel.com>
>>>> Cc: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
>>>> Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
>>>> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>>>> Cc: Tony Ye <tony.ye@intel.com>
>>>> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> # v7
>>>> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> # v7
>>>> ---
>>>> +/**
>>>> + * struct drm_i915_engine_info
>>>> + *
>>>> + * Describes one engine and it's capabilities as known to the driver.
>>>> + */
>>>> +struct drm_i915_engine_info {
>>>> +       /** Engine class and instance. */
>>>> +       struct i915_engine_class_instance engine;
>>>> +
>>>> +       /** Reserved field. */
>>>> +       __u32 rsvd0;
>>>> +
>>>> +       /** Engine flags. */
>>>> +       __u64 flags;
>>>
>>> Do you think we could do something like
>>> BUILD_BUG_ON(!IS_ALIGNED(offsetof(*info, flags), sizeof(info->flags));
>>>
>>> Will that work, and worthwhile? Maybe work into a
>>>
>>> BUILD_BUG_ON(check_user_alignment(info, flags));
>>
>> Hmm.. probably manual check for no holes _and_ alignment is good enough
>> for uAPI since once it's in it's in. Will triple-check.
> 
> Yeah, we actually need something more like
> offsetofend(previous_field) == offsetof(next_field)
> 
> BUILD_BUG_ON(check_user_struct(info, previous_field, next_field)) ?

How would you logistically do it? List all struct members for each uapi 
struct you want to check?

Maybe a variadic macro like:

CHECK_USER_STRUCT_FUNCTION(type, member0, ... memberN);

Which expands to a dedicated function to check this type, using 
va_start/va_end to iterate all members checking for holes. So somewhere 
in code we would also need:

CHECK_USER_STRUCT(type);

Which would call the function. But thats not build time.. Could be under 
debug and selftests I guess. Could even be IGT in this case.

But I am not to keen in listing each struct member with a 
prev/next_field BUILD_BUG_ON.

Perhaps IGT is indeed a better place to start testing for this. Since we 
anyway require each new uAPI to have good IGT coverage.

Regards,

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v11] drm/i915: Engine discovery query
  2019-05-01 11:45   ` Tvrtko Ursulin
@ 2019-05-01 11:55     ` Chris Wilson
  2019-05-01 15:51       ` Tvrtko Ursulin
  0 siblings, 1 reply; 10+ messages in thread
From: Chris Wilson @ 2019-05-01 11:55 UTC (permalink / raw)
  To: Intel-gfx, Tvrtko Ursulin

Quoting Tvrtko Ursulin (2019-05-01 12:45:36)
> 
> On 01/05/2019 12:10, Chris Wilson wrote:
> > Quoting Tvrtko Ursulin (2019-05-01 11:52:28)
> >> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> >>
> >> Engine discovery query allows userspace to enumerate engines, probe their
> >> configuration features, all without needing to maintain the internal PCI
> >> ID based database.
> >>
> >> A new query for the generic i915 query ioctl is added named
> >> DRM_I915_QUERY_ENGINE_INFO, together with accompanying structure
> >> drm_i915_query_engine_info. The address of latter should be passed to the
> >> kernel in the query.data_ptr field, and should be large enough for the
> >> kernel to fill out all known engines as struct drm_i915_engine_info
> >> elements trailing the query.
> >>
> >> As with other queries, setting the item query length to zero allows
> >> userspace to query minimum required buffer size.
> >>
> >> Enumerated engines have common type mask which can be used to query all
> >> hardware engines, versus engines userspace can submit to using the execbuf
> >> uAPI.
> >>
> >> Engines also have capabilities which are per engine class namespace of
> >> bits describing features not present on all engine instances.
> >>
> >> v2:
> >>   * Fixed HEVC assignment.
> >>   * Reorder some fields, rename type to flags, increase width. (Lionel)
> >>   * No need to allocate temporary storage if we do it engine by engine.
> >>     (Lionel)
> >>
> >> v3:
> >>   * Describe engine flags and mark mbz fields. (Lionel)
> >>   * HEVC only applies to VCS.
> >>
> >> v4:
> >>   * Squash SFC flag into main patch.
> >>   * Tidy some comments.
> >>
> >> v5:
> >>   * Add uabi_ prefix to engine capabilities. (Chris Wilson)
> >>   * Report exact size of engine info array. (Chris Wilson)
> >>   * Drop the engine flags. (Joonas Lahtinen)
> >>   * Added some more reserved fields.
> >>   * Move flags after class/instance.
> >>
> >> v6:
> >>   * Do not check engine info array was zeroed by userspace but zero the
> >>     unused fields for them instead.
> >>
> >> v7:
> >>   * Simplify length calculation loop. (Lionel Landwerlin)
> >>
> >> v8:
> >>   * Remove MBZ comments where not applicable.
> >>   * Rename ABI flags to match engine class define naming.
> >>   * Rename SFC ABI flag to reflect it applies to VCS and VECS.
> >>   * SFC is wired to even _logical_ engine instances.
> >>   * SFC applies to VCS and VECS.
> >>   * HEVC is present on all instances on Gen11. (Tony)
> >>   * Simplify length calculation even more. (Chris Wilson)
> >>   * Move info_ptr assigment closer to loop for clarity. (Chris Wilson)
> >>   * Use vdbox_sfc_access from runtime info.
> >>   * Rebase for RUNTIME_INFO.
> >>   * Refactor for lower indentation.
> >>   * Rename uAPI class/instance to engine_class/instance to avoid C++
> >>     keyword.
> >>
> >> v9:
> >>   * Rebase for s/num_rings/num_engines/ in RUNTIME_INFO.
> >>
> >> v10:
> >>   * Use new copy_query_item.
> >>
> >> v11:
> >>   * Consolidate with struct i915_engine_class_instnace.
> >>
> >> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> >> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> >> Cc: Jon Bloomfield <jon.bloomfield@intel.com>
> >> Cc: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
> >> Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
> >> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> >> Cc: Tony Ye <tony.ye@intel.com>
> >> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> # v7
> >> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> # v7
> >> ---
> >> +/**
> >> + * struct drm_i915_engine_info
> >> + *
> >> + * Describes one engine and it's capabilities as known to the driver.
> >> + */
> >> +struct drm_i915_engine_info {
> >> +       /** Engine class and instance. */
> >> +       struct i915_engine_class_instance engine;
> >> +
> >> +       /** Reserved field. */
> >> +       __u32 rsvd0;
> >> +
> >> +       /** Engine flags. */
> >> +       __u64 flags;
> > 
> > Do you think we could do something like
> > BUILD_BUG_ON(!IS_ALIGNED(offsetof(*info, flags), sizeof(info->flags));
> > 
> > Will that work, and worthwhile? Maybe work into a
> > 
> > BUILD_BUG_ON(check_user_alignment(info, flags));
> 
> Hmm.. probably manual check for no holes _and_ alignment is good enough 
> for uAPI since once it's in it's in. Will triple-check.

Yeah, we actually need something more like
offsetofend(previous_field) == offsetof(next_field)

BUILD_BUG_ON(check_user_struct(info, previous_field, next_field)) ?
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v11] drm/i915: Engine discovery query
  2019-05-01 11:10 ` Chris Wilson
@ 2019-05-01 11:45   ` Tvrtko Ursulin
  2019-05-01 11:55     ` Chris Wilson
  0 siblings, 1 reply; 10+ messages in thread
From: Tvrtko Ursulin @ 2019-05-01 11:45 UTC (permalink / raw)
  To: Chris Wilson, Intel-gfx


On 01/05/2019 12:10, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2019-05-01 11:52:28)
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> Engine discovery query allows userspace to enumerate engines, probe their
>> configuration features, all without needing to maintain the internal PCI
>> ID based database.
>>
>> A new query for the generic i915 query ioctl is added named
>> DRM_I915_QUERY_ENGINE_INFO, together with accompanying structure
>> drm_i915_query_engine_info. The address of latter should be passed to the
>> kernel in the query.data_ptr field, and should be large enough for the
>> kernel to fill out all known engines as struct drm_i915_engine_info
>> elements trailing the query.
>>
>> As with other queries, setting the item query length to zero allows
>> userspace to query minimum required buffer size.
>>
>> Enumerated engines have common type mask which can be used to query all
>> hardware engines, versus engines userspace can submit to using the execbuf
>> uAPI.
>>
>> Engines also have capabilities which are per engine class namespace of
>> bits describing features not present on all engine instances.
>>
>> v2:
>>   * Fixed HEVC assignment.
>>   * Reorder some fields, rename type to flags, increase width. (Lionel)
>>   * No need to allocate temporary storage if we do it engine by engine.
>>     (Lionel)
>>
>> v3:
>>   * Describe engine flags and mark mbz fields. (Lionel)
>>   * HEVC only applies to VCS.
>>
>> v4:
>>   * Squash SFC flag into main patch.
>>   * Tidy some comments.
>>
>> v5:
>>   * Add uabi_ prefix to engine capabilities. (Chris Wilson)
>>   * Report exact size of engine info array. (Chris Wilson)
>>   * Drop the engine flags. (Joonas Lahtinen)
>>   * Added some more reserved fields.
>>   * Move flags after class/instance.
>>
>> v6:
>>   * Do not check engine info array was zeroed by userspace but zero the
>>     unused fields for them instead.
>>
>> v7:
>>   * Simplify length calculation loop. (Lionel Landwerlin)
>>
>> v8:
>>   * Remove MBZ comments where not applicable.
>>   * Rename ABI flags to match engine class define naming.
>>   * Rename SFC ABI flag to reflect it applies to VCS and VECS.
>>   * SFC is wired to even _logical_ engine instances.
>>   * SFC applies to VCS and VECS.
>>   * HEVC is present on all instances on Gen11. (Tony)
>>   * Simplify length calculation even more. (Chris Wilson)
>>   * Move info_ptr assigment closer to loop for clarity. (Chris Wilson)
>>   * Use vdbox_sfc_access from runtime info.
>>   * Rebase for RUNTIME_INFO.
>>   * Refactor for lower indentation.
>>   * Rename uAPI class/instance to engine_class/instance to avoid C++
>>     keyword.
>>
>> v9:
>>   * Rebase for s/num_rings/num_engines/ in RUNTIME_INFO.
>>
>> v10:
>>   * Use new copy_query_item.
>>
>> v11:
>>   * Consolidate with struct i915_engine_class_instnace.
>>
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>> Cc: Jon Bloomfield <jon.bloomfield@intel.com>
>> Cc: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
>> Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
>> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>> Cc: Tony Ye <tony.ye@intel.com>
>> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> # v7
>> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> # v7
>> ---
>> +/**
>> + * struct drm_i915_engine_info
>> + *
>> + * Describes one engine and it's capabilities as known to the driver.
>> + */
>> +struct drm_i915_engine_info {
>> +       /** Engine class and instance. */
>> +       struct i915_engine_class_instance engine;
>> +
>> +       /** Reserved field. */
>> +       __u32 rsvd0;
>> +
>> +       /** Engine flags. */
>> +       __u64 flags;
> 
> Do you think we could do something like
> BUILD_BUG_ON(!IS_ALIGNED(offsetof(*info, flags), sizeof(info->flags));
> 
> Will that work, and worthwhile? Maybe work into a
> 
> BUILD_BUG_ON(check_user_alignment(info, flags));

Hmm.. probably manual check for no holes _and_ alignment is good enough 
for uAPI since once it's in it's in. Will triple-check.

> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

Thanks! I apparently messed up the actual branch and will resend once 
IGT series finished so I can play with Test-with:

Regards,

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v11] drm/i915: Engine discovery query
  2019-05-01 10:52 [PATCH v11] drm/i915: Engine discovery query Tvrtko Ursulin
@ 2019-05-01 11:10 ` Chris Wilson
  2019-05-01 11:45   ` Tvrtko Ursulin
  0 siblings, 1 reply; 10+ messages in thread
From: Chris Wilson @ 2019-05-01 11:10 UTC (permalink / raw)
  To: Intel-gfx, Tvrtko Ursulin

Quoting Tvrtko Ursulin (2019-05-01 11:52:28)
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> Engine discovery query allows userspace to enumerate engines, probe their
> configuration features, all without needing to maintain the internal PCI
> ID based database.
> 
> A new query for the generic i915 query ioctl is added named
> DRM_I915_QUERY_ENGINE_INFO, together with accompanying structure
> drm_i915_query_engine_info. The address of latter should be passed to the
> kernel in the query.data_ptr field, and should be large enough for the
> kernel to fill out all known engines as struct drm_i915_engine_info
> elements trailing the query.
> 
> As with other queries, setting the item query length to zero allows
> userspace to query minimum required buffer size.
> 
> Enumerated engines have common type mask which can be used to query all
> hardware engines, versus engines userspace can submit to using the execbuf
> uAPI.
> 
> Engines also have capabilities which are per engine class namespace of
> bits describing features not present on all engine instances.
> 
> v2:
>  * Fixed HEVC assignment.
>  * Reorder some fields, rename type to flags, increase width. (Lionel)
>  * No need to allocate temporary storage if we do it engine by engine.
>    (Lionel)
> 
> v3:
>  * Describe engine flags and mark mbz fields. (Lionel)
>  * HEVC only applies to VCS.
> 
> v4:
>  * Squash SFC flag into main patch.
>  * Tidy some comments.
> 
> v5:
>  * Add uabi_ prefix to engine capabilities. (Chris Wilson)
>  * Report exact size of engine info array. (Chris Wilson)
>  * Drop the engine flags. (Joonas Lahtinen)
>  * Added some more reserved fields.
>  * Move flags after class/instance.
> 
> v6:
>  * Do not check engine info array was zeroed by userspace but zero the
>    unused fields for them instead.
> 
> v7:
>  * Simplify length calculation loop. (Lionel Landwerlin)
> 
> v8:
>  * Remove MBZ comments where not applicable.
>  * Rename ABI flags to match engine class define naming.
>  * Rename SFC ABI flag to reflect it applies to VCS and VECS.
>  * SFC is wired to even _logical_ engine instances.
>  * SFC applies to VCS and VECS.
>  * HEVC is present on all instances on Gen11. (Tony)
>  * Simplify length calculation even more. (Chris Wilson)
>  * Move info_ptr assigment closer to loop for clarity. (Chris Wilson)
>  * Use vdbox_sfc_access from runtime info.
>  * Rebase for RUNTIME_INFO.
>  * Refactor for lower indentation.
>  * Rename uAPI class/instance to engine_class/instance to avoid C++
>    keyword.
> 
> v9:
>  * Rebase for s/num_rings/num_engines/ in RUNTIME_INFO.
> 
> v10:
>  * Use new copy_query_item.
> 
> v11:
>  * Consolidate with struct i915_engine_class_instnace.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Jon Bloomfield <jon.bloomfield@intel.com>
> Cc: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
> Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Tony Ye <tony.ye@intel.com>
> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> # v7
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> # v7
> ---
> +/**
> + * struct drm_i915_engine_info
> + *
> + * Describes one engine and it's capabilities as known to the driver.
> + */
> +struct drm_i915_engine_info {
> +       /** Engine class and instance. */
> +       struct i915_engine_class_instance engine;
> +
> +       /** Reserved field. */
> +       __u32 rsvd0;
> +
> +       /** Engine flags. */
> +       __u64 flags;

Do you think we could do something like
BUILD_BUG_ON(!IS_ALIGNED(offsetof(*info, flags), sizeof(info->flags));

Will that work, and worthwhile? Maybe work into a 

BUILD_BUG_ON(check_user_alignment(info, flags));

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v11] drm/i915: Engine discovery query
@ 2019-05-01 10:52 Tvrtko Ursulin
  2019-05-01 11:10 ` Chris Wilson
  0 siblings, 1 reply; 10+ messages in thread
From: Tvrtko Ursulin @ 2019-05-01 10:52 UTC (permalink / raw)
  To: Intel-gfx

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Engine discovery query allows userspace to enumerate engines, probe their
configuration features, all without needing to maintain the internal PCI
ID based database.

A new query for the generic i915 query ioctl is added named
DRM_I915_QUERY_ENGINE_INFO, together with accompanying structure
drm_i915_query_engine_info. The address of latter should be passed to the
kernel in the query.data_ptr field, and should be large enough for the
kernel to fill out all known engines as struct drm_i915_engine_info
elements trailing the query.

As with other queries, setting the item query length to zero allows
userspace to query minimum required buffer size.

Enumerated engines have common type mask which can be used to query all
hardware engines, versus engines userspace can submit to using the execbuf
uAPI.

Engines also have capabilities which are per engine class namespace of
bits describing features not present on all engine instances.

v2:
 * Fixed HEVC assignment.
 * Reorder some fields, rename type to flags, increase width. (Lionel)
 * No need to allocate temporary storage if we do it engine by engine.
   (Lionel)

v3:
 * Describe engine flags and mark mbz fields. (Lionel)
 * HEVC only applies to VCS.

v4:
 * Squash SFC flag into main patch.
 * Tidy some comments.

v5:
 * Add uabi_ prefix to engine capabilities. (Chris Wilson)
 * Report exact size of engine info array. (Chris Wilson)
 * Drop the engine flags. (Joonas Lahtinen)
 * Added some more reserved fields.
 * Move flags after class/instance.

v6:
 * Do not check engine info array was zeroed by userspace but zero the
   unused fields for them instead.

v7:
 * Simplify length calculation loop. (Lionel Landwerlin)

v8:
 * Remove MBZ comments where not applicable.
 * Rename ABI flags to match engine class define naming.
 * Rename SFC ABI flag to reflect it applies to VCS and VECS.
 * SFC is wired to even _logical_ engine instances.
 * SFC applies to VCS and VECS.
 * HEVC is present on all instances on Gen11. (Tony)
 * Simplify length calculation even more. (Chris Wilson)
 * Move info_ptr assigment closer to loop for clarity. (Chris Wilson)
 * Use vdbox_sfc_access from runtime info.
 * Rebase for RUNTIME_INFO.
 * Refactor for lower indentation.
 * Rename uAPI class/instance to engine_class/instance to avoid C++
   keyword.

v9:
 * Rebase for s/num_rings/num_engines/ in RUNTIME_INFO.

v10:
 * Use new copy_query_item.

v11:
 * Consolidate with struct i915_engine_class_instnace.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jon Bloomfield <jon.bloomfield@intel.com>
Cc: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Tony Ye <tony.ye@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> # v7
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> # v7
---
 drivers/gpu/drm/i915/gt/intel_engine_cs.c    | 41 ++++++++++++++++
 drivers/gpu/drm/i915/gt/intel_engine_types.h |  2 +
 drivers/gpu/drm/i915/i915_query.c            | 49 ++++++++++++++++++++
 include/uapi/drm/i915_drm.h                  | 42 +++++++++++++++++
 4 files changed, 134 insertions(+)

diff --git a/drivers/gpu/drm/i915/gt/intel_engine_cs.c b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
index f7308479d511..dc1df1e0a9c7 100644
--- a/drivers/gpu/drm/i915/gt/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
@@ -343,6 +343,45 @@ intel_engine_setup(struct drm_i915_private *dev_priv,
 	return 0;
 }
 
+static void __setup_engine_capabilities(struct intel_engine_cs *engine)
+{
+	struct drm_i915_private *i915 = engine->i915;
+
+	if (engine->class == VIDEO_DECODE_CLASS) {
+		/*
+		 * HEVC support is present on first engine instance
+		 * before Gen11 and on all instances afterwards.
+		 */
+		if (INTEL_GEN(i915) >= 11 ||
+		    (INTEL_GEN(i915) >= 9 && engine->instance == 0))
+			engine->uabi_capabilities |=
+				I915_VIDEO_CLASS_CAPABILITY_HEVC;
+
+		/*
+		 * SFC block is present only on even logical engine
+		 * instances.
+		 */
+		if ((INTEL_GEN(i915) >= 11 &&
+		     RUNTIME_INFO(i915)->vdbox_sfc_access & engine->mask) ||
+		    (INTEL_GEN(i915) >= 9 && engine->instance == 0))
+			engine->uabi_capabilities |=
+				I915_VIDEO_AND_ENHANCE_CLASS_CAPABILITY_SFC;
+	} else if (engine->class == VIDEO_ENHANCEMENT_CLASS) {
+		if (INTEL_GEN(i915) >= 9)
+			engine->uabi_capabilities |=
+				I915_VIDEO_AND_ENHANCE_CLASS_CAPABILITY_SFC;
+	}
+}
+
+static void intel_setup_engine_capabilities(struct drm_i915_private *i915)
+{
+	struct intel_engine_cs *engine;
+	enum intel_engine_id id;
+
+	for_each_engine(engine, i915, id)
+		__setup_engine_capabilities(engine);
+}
+
 /**
  * intel_engines_init_mmio() - allocate and prepare the Engine Command Streamers
  * @dev_priv: i915 device private
@@ -395,6 +434,8 @@ int intel_engines_init_mmio(struct drm_i915_private *dev_priv)
 
 	i915_check_and_clear_faults(dev_priv);
 
+	intel_setup_engine_capabilities(i915);
+
 	return 0;
 
 cleanup:
diff --git a/drivers/gpu/drm/i915/gt/intel_engine_types.h b/drivers/gpu/drm/i915/gt/intel_engine_types.h
index d972c339309c..211b3fd76d58 100644
--- a/drivers/gpu/drm/i915/gt/intel_engine_types.h
+++ b/drivers/gpu/drm/i915/gt/intel_engine_types.h
@@ -279,6 +279,8 @@ struct intel_engine_cs {
 	u32 context_size;
 	u32 mmio_base;
 
+	u32 uabi_capabilities;
+
 	struct intel_sseu sseu;
 
 	struct intel_ring *buffer;
diff --git a/drivers/gpu/drm/i915/i915_query.c b/drivers/gpu/drm/i915/i915_query.c
index 782183b78f49..414d0a6d1f70 100644
--- a/drivers/gpu/drm/i915/i915_query.c
+++ b/drivers/gpu/drm/i915/i915_query.c
@@ -96,9 +96,58 @@ static int query_topology_info(struct drm_i915_private *dev_priv,
 	return total_length;
 }
 
+static int
+query_engine_info(struct drm_i915_private *i915,
+		  struct drm_i915_query_item *query_item)
+{
+	struct drm_i915_query_engine_info __user *query_ptr =
+				u64_to_user_ptr(query_item->data_ptr);
+	struct drm_i915_engine_info __user *info_ptr;
+	struct drm_i915_query_engine_info query;
+	struct drm_i915_engine_info info = { };
+	struct intel_engine_cs *engine;
+	enum intel_engine_id id;
+	int len, ret;
+
+	if (query_item->flags)
+		return -EINVAL;
+
+	len = sizeof(struct drm_i915_query_engine_info) +
+	      RUNTIME_INFO(i915)->num_engines *
+	      sizeof(struct drm_i915_engine_info);
+
+	ret = copy_query_item(&query, sizeof(query), len, query_item);
+	if (ret != 0)
+		return ret;
+
+	if (query.num_engines || query.rsvd[0] || query.rsvd[1] ||
+	    query.rsvd[2])
+		return -EINVAL;
+
+	info_ptr = &query_ptr->engines[0];
+
+	for_each_engine(engine, i915, id) {
+		info.engine.engine_class = engine->uabi_class;
+		info.engine.engine_instance = engine->instance;
+		info.capabilities = engine->uabi_capabilities;
+
+		if (__copy_to_user(info_ptr, &info, sizeof(info)))
+			return -EFAULT;
+
+		query.num_engines++;
+		info_ptr++;
+	}
+
+	if (__copy_to_user(query_ptr, &query, sizeof(query)))
+		return -EFAULT;
+
+	return len;
+}
+
 static int (* const i915_query_funcs[])(struct drm_i915_private *dev_priv,
 					struct drm_i915_query_item *query_item) = {
 	query_topology_info,
+	query_engine_info,
 };
 
 int i915_query_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index 3a73f5316766..8c54b766e9a1 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -1821,6 +1821,7 @@ struct drm_i915_perf_oa_config {
 struct drm_i915_query_item {
 	__u64 query_id;
 #define DRM_I915_QUERY_TOPOLOGY_INFO    1
+#define DRM_I915_QUERY_ENGINE_INFO	2
 /* Must be kept compact -- no holes and well documented */
 
 	/*
@@ -1919,6 +1920,47 @@ struct drm_i915_query_topology_info {
 	__u8 data[];
 };
 
+/**
+ * struct drm_i915_engine_info
+ *
+ * Describes one engine and it's capabilities as known to the driver.
+ */
+struct drm_i915_engine_info {
+	/** Engine class and instance. */
+	struct i915_engine_class_instance engine;
+
+	/** Reserved field. */
+	__u32 rsvd0;
+
+	/** Engine flags. */
+	__u64 flags;
+
+	/** Capabilities of this engine. */
+	__u64 capabilities;
+#define I915_VIDEO_CLASS_CAPABILITY_HEVC		(1 << 0)
+#define I915_VIDEO_AND_ENHANCE_CLASS_CAPABILITY_SFC	(1 << 1)
+
+	/** Reserved fields. */
+	__u64 rsvd1[4];
+};
+
+/**
+ * struct drm_i915_query_engine_info
+ *
+ * Engine info query enumerates all engines known to the driver by filling in
+ * an array of struct drm_i915_engine_info structures.
+ */
+struct drm_i915_query_engine_info {
+	/** Number of struct drm_i915_engine_info structs following. */
+	__u32 num_engines;
+
+	/** MBZ */
+	__u32 rsvd[3];
+
+	/** Marker for drm_i915_engine_info structures. */
+	struct drm_i915_engine_info engines[];
+};
+
 #if defined(__cplusplus)
 }
 #endif
-- 
2.19.1

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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-05-02 13:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-02  6:30 [PATCH v11] drm/i915: Engine discovery query Tvrtko Ursulin
2019-05-02  6:58 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Engine discovery query (rev10) Patchwork
2019-05-02  7:14 ` ✓ Fi.CI.BAT: success " Patchwork
2019-05-02 13:15 ` ✓ Fi.CI.IGT: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2019-05-01 10:52 [PATCH v11] drm/i915: Engine discovery query Tvrtko Ursulin
2019-05-01 11:10 ` Chris Wilson
2019-05-01 11:45   ` Tvrtko Ursulin
2019-05-01 11:55     ` Chris Wilson
2019-05-01 15:51       ` Tvrtko Ursulin
2019-05-01 15:58         ` Chris Wilson

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.