From: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v2 07/10] include: bump drm headers for i915 timeline semaphores
Date: Fri, 22 Nov 2019 15:02:57 +0200 [thread overview]
Message-ID: <20191122130300.558951-8-lionel.g.landwerlin@intel.com> (raw)
In-Reply-To: <20191122130300.558951-1-lionel.g.landwerlin@intel.com>
Commit to be update with proper drm-next reference once merged.
---
include/drm-uapi/drm.h | 17 ++++++++++
include/drm-uapi/i915_drm.h | 64 +++++++++++++++++++++++++++++++++++--
2 files changed, 78 insertions(+), 3 deletions(-)
diff --git a/include/drm-uapi/drm.h b/include/drm-uapi/drm.h
index ab940339..5a2f7f7e 100644
--- a/include/drm-uapi/drm.h
+++ b/include/drm-uapi/drm.h
@@ -780,6 +780,22 @@ struct drm_syncobj_timeline_array {
__u32 flags;
};
+struct drm_syncobj_binary_array {
+ /* A pointer to an array of u32 syncobj handles. */
+ __u64 handles;
+ /* A pointer to an array of u32 access flags for each handle. */
+ __u64 access_flags;
+ /* The binary value of a syncobj is read before it is incremented. */
+#define DRM_SYNCOBJ_BINARY_VALUE_READ (1u << 0)
+#define DRM_SYNCOBJ_BINARY_VALUE_INC (1u << 1)
+ /* A pointer to an array of u64 values written to by the kernel if the
+ * handle is flagged for reading.
+ */
+ __u64 values;
+ /* The length of the 3 arrays above. */
+ __u32 count_handles;
+ __u32 pad;
+};
/* Query current scanout sequence number */
struct drm_crtc_get_sequence {
@@ -941,6 +957,7 @@ extern "C" {
#define DRM_IOCTL_SYNCOBJ_QUERY DRM_IOWR(0xCB, struct drm_syncobj_timeline_array)
#define DRM_IOCTL_SYNCOBJ_TRANSFER DRM_IOWR(0xCC, struct drm_syncobj_transfer)
#define DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNAL DRM_IOWR(0xCD, struct drm_syncobj_timeline_array)
+#define DRM_IOCTL_SYNCOBJ_BINARY DRM_IOWR(0xCE, struct drm_syncobj_binary_array)
/**
* Device specific ioctls should only be in their respective headers
diff --git a/include/drm-uapi/i915_drm.h b/include/drm-uapi/i915_drm.h
index ab899abb..4ac9d735 100644
--- a/include/drm-uapi/i915_drm.h
+++ b/include/drm-uapi/i915_drm.h
@@ -618,6 +618,12 @@ typedef struct drm_i915_irq_wait {
*/
#define I915_PARAM_PERF_REVISION 54
+/* Query whether DRM_I915_GEM_EXECBUFFER2 supports supplying an array of
+ * timeline syncobj through drm_i915_gem_execbuf_ext_timeline_fences. See
+ * I915_EXEC_USE_EXTENSIONS.
+ */
+#define I915_PARAM_HAS_EXEC_TIMELINE_FENCES 55
+
/* Must be kept compact -- no holes and well documented */
typedef struct drm_i915_getparam {
@@ -1014,6 +1020,42 @@ struct drm_i915_gem_exec_fence {
__u32 flags;
};
+enum drm_i915_gem_execbuffer_ext {
+ /**
+ * See drm_i915_gem_execbuf_ext_timeline_fences.
+ */
+ DRM_I915_GEM_EXECBUFFER_EXT_TIMELINE_FENCES = 1,
+
+ DRM_I915_GEM_EXECBUFFER_EXT_MAX /* non-ABI */
+};
+
+/**
+ * This structure describes an array of drm_syncobj and associated points for
+ * timeline variants of drm_syncobj. It is invalid to append this structure to
+ * the execbuf if I915_EXEC_FENCE_ARRAY is set.
+ */
+struct drm_i915_gem_execbuffer_ext_timeline_fences {
+ struct i915_user_extension base;
+
+ /**
+ * Number of element in the handles_ptr & value_ptr arrays.
+ */
+ __u64 fence_count;
+
+ /**
+ * Pointer to an array of struct drm_i915_gem_exec_fence of length
+ * fence_count.
+ */
+ __u64 handles_ptr;
+
+ /**
+ * Pointer to an array of u64 values of length fence_count. Values
+ * must be 0 for a binary drm_syncobj. A Value of 0 for a timeline
+ * drm_syncobj is invalid as it turns a drm_syncobj into a binary one.
+ */
+ __u64 values_ptr;
+};
+
struct drm_i915_gem_execbuffer2 {
/**
* List of gem_exec_object2 structs
@@ -1030,8 +1072,15 @@ struct drm_i915_gem_execbuffer2 {
__u32 num_cliprects;
/**
* This is a struct drm_clip_rect *cliprects if I915_EXEC_FENCE_ARRAY
- * is not set. If I915_EXEC_FENCE_ARRAY is set, then this is a
- * struct drm_i915_gem_exec_fence *fences.
+ * & I915_EXEC_USE_EXTENSIONS are not set.
+ *
+ * If I915_EXEC_FENCE_ARRAY is set, then this is a pointer to an array
+ * of struct drm_i915_gem_exec_fence and num_cliprects is the length
+ * of the array.
+ *
+ * If I915_EXEC_USE_EXTENSIONS is set, then this is a pointer to a
+ * single struct drm_i915_gem_base_execbuffer_ext and num_cliprects is
+ * 0.
*/
__u64 cliprects_ptr;
#define I915_EXEC_RING_MASK (0x3f)
@@ -1149,7 +1198,16 @@ struct drm_i915_gem_execbuffer2 {
*/
#define I915_EXEC_FENCE_SUBMIT (1 << 20)
-#define __I915_EXEC_UNKNOWN_FLAGS (-(I915_EXEC_FENCE_SUBMIT << 1))
+/*
+ * Setting I915_EXEC_USE_EXTENSIONS implies that
+ * drm_i915_gem_execbuffer2.cliprects_ptr is treated as a pointer to an linked
+ * list of i915_user_extension. Each i915_user_extension node is the base of a
+ * larger structure. The list of supported structures are listed in the
+ * drm_i915_gem_execbuffer_ext enum.
+ */
+#define I915_EXEC_USE_EXTENSIONS (1 << 21)
+
+#define __I915_EXEC_UNKNOWN_FLAGS (-(I915_EXEC_USE_EXTENSIONS<<1))
#define I915_EXEC_CONTEXT_ID_MASK (0xffffffff)
#define i915_execbuffer2_set_context_id(eb2, context) \
--
2.24.0
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2019-11-22 13:03 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-22 13:02 [igt-dev] [PATCH i-g-t v2 00/10] tests: Add timeline syncobj testing Lionel Landwerlin
2019-11-22 13:02 ` [igt-dev] [PATCH i-g-t v2 01/10] lib/syncobj: drop local declarations Lionel Landwerlin
2019-11-22 13:02 ` [igt-dev] [PATCH i-g-t v2 02/10] drm-uapi: Update drm headers to 17cc51390c141662748dbbc2fe98f3ed10f2e13e Lionel Landwerlin
2019-11-22 13:02 ` [igt-dev] [PATCH i-g-t v2 03/10] igt: add timeline test cases Lionel Landwerlin
2019-11-22 13:02 ` [igt-dev] [PATCH i-g-t v2 04/10] tests/syncobj_timeline: add more timeline tests Lionel Landwerlin
2019-11-22 13:02 ` [igt-dev] [PATCH i-g-t v2 05/10] tests/i915/exec_fence: switch to internal headers Lionel Landwerlin
2019-11-22 13:02 ` [igt-dev] [PATCH i-g-t v2 06/10] tests/i915/exec_fence: reuse syncobj helpers Lionel Landwerlin
2019-11-22 13:02 ` Lionel Landwerlin [this message]
2019-11-22 13:02 ` [igt-dev] [PATCH i-g-t v2 08/10] tests/i915/exec_fence: add timeline fence tests Lionel Landwerlin
2019-11-22 15:13 ` Chris Wilson
2019-11-22 15:17 ` Lionel Landwerlin
2019-11-22 15:23 ` Chris Wilson
2019-11-22 15:47 ` Lionel Landwerlin
2019-11-22 15:26 ` Chris Wilson
2019-11-22 15:43 ` Lionel Landwerlin
2019-11-22 15:51 ` Chris Wilson
2019-11-22 16:03 ` Lionel Landwerlin
2019-11-22 16:11 ` Chris Wilson
2019-11-27 16:04 ` Lionel Landwerlin
2019-11-22 13:02 ` [igt-dev] [PATCH i-g-t v2 09/10] lib/i915: Parse mmio base from debugfs Lionel Landwerlin
2019-11-22 13:03 ` [igt-dev] [PATCH i-g-t v2 10/10] tests/i915/gem_exec_fence: add engine chaining tests Lionel Landwerlin
2019-11-22 14:10 ` [igt-dev] ✗ GitLab.Pipeline: warning for tests: Add timeline syncobj testing (rev2) Patchwork
2019-11-22 14:16 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2019-11-23 21:15 ` [igt-dev] ✓ Fi.CI.IGT: " 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=20191122130300.558951-8-lionel.g.landwerlin@intel.com \
--to=lionel.g.landwerlin@intel.com \
--cc=igt-dev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox