[igt-dev] [PATCH i-g-t v7 02/17] Update IOCTL wrapper with DRM_IOCTL_I915_GEM_CONTEXT_CREATE_EXT
Teres Alexis, Alan Previn
alan.previn.teres.alexis at intel.com
Thu Sep 2 15:35:37 UTC 2021
I need to remove this patch. Looks like between the start of this series until now, we didnt have a wrapper for CONTEXT_CREATE_EXT, then i was asked to create one, and now a wrapper was merged in lib/i915/gem_context.h. So i have to remove this patch and modify the pxp code to call that wrapper.
...alan
-----Original Message-----
From: Teres Alexis, Alan Previn <alan.previn.teres.alexis at intel.com>
Sent: Tuesday, August 24, 2021 10:31 PM
To: igt-dev at lists.freedesktop.org
Cc: Teres Alexis, Alan Previn <alan.previn.teres.alexis at intel.com>; Vivi, Rodrigo <rodrigo.vivi at intel.com>
Subject: [PATCH i-g-t v7 02/17] Update IOCTL wrapper with DRM_IOCTL_I915_GEM_CONTEXT_CREATE_EXT
Update IOCTL wrapper with DRM_IOCTL_I915_GEM_CONTEXT_CREATE_EXT
Signed-off-by: Alan Previn <alan.previn.teres.alexis at intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
---
lib/ioctl_wrappers.c | 34 ++++++++++++++++++++++++++++++++++
lib/ioctl_wrappers.h | 2 ++
2 files changed, 36 insertions(+)
diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c index 09eb3ce7..5c59a259 100644
--- a/lib/ioctl_wrappers.c
+++ b/lib/ioctl_wrappers.c
@@ -706,6 +706,40 @@ void gem_execbuf_wr(int fd, struct drm_i915_gem_execbuffer2 *execbuf)
igt_assert_eq(__gem_execbuf_wr(fd, execbuf), 0); }
+/**
+ * __gem_ctx_create_ext:
+ * @fd: open i915 drm file descriptor
+ * @ctx_ext: context_create_ext data structure
+ *
+ * This wraps the GEM_CONTEXT_CREATE_EXT ioctl, which allocates gem
+context based on
+ * additional drm_i915_gem_context_create_ext_setparam input
+extensions. This is
+ * allowed to fail, with -errno returned */ int
+__gem_ctx_create_ext(int fd, struct drm_i915_gem_context_create_ext
+*ctx_ext) {
+ int err = 0;
+
+ if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_CONTEXT_CREATE_EXT, ctx_ext)) {
+ err = -errno;
+ igt_assume(err != 0);
+ }
+ errno = 0;
+ return err;
+}
+
+/**
+ * gem_ctx_create_ext:
+ * @fd: open i915 drm file descriptor
+ * @ctx_ext: context_create_ext data structure
+ *
+ * This wraps the GEM_CONTEXT_CREATE_EXT ioctl, which allocates gem
+context based on
+ * additional drm_i915_gem_context_create_ext_setparam input extensions.
+ */
+void gem_ctx_create_ext(int fd, struct drm_i915_gem_context_create_ext
+*ctx_ext) {
+ igt_assert_eq(__gem_ctx_create_ext(fd, ctx_ext), 0); }
+
/**
* gem_madvise:
* @fd: open i915 drm file descriptor
diff --git a/lib/ioctl_wrappers.h b/lib/ioctl_wrappers.h index 9a897fec..6f7fbf1a 100644
--- a/lib/ioctl_wrappers.h
+++ b/lib/ioctl_wrappers.h
@@ -84,6 +84,8 @@ void gem_execbuf_wr(int fd, struct drm_i915_gem_execbuffer2 *execbuf); int __gem_execbuf_wr(int fd, struct drm_i915_gem_execbuffer2 *execbuf); void gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *execbuf); int __gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *execbuf);
+int __gem_ctx_create_ext(int fd, struct drm_i915_gem_context_create_ext
+*ctx_ext); void gem_ctx_create_ext(int fd, struct
+drm_i915_gem_context_create_ext *ctx_ext);
#ifndef I915_GEM_DOMAIN_WC
#define I915_GEM_DOMAIN_WC 0x80
--
2.25.1
More information about the igt-dev
mailing list