[igt-dev] [PATCH i-g-t v2 1/3] include/drm-uapi/i915_drm: Add local defs for mmap_offset

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Mon Nov 25 11:05:35 UTC 2019


Contains local definitions and structures for GEM_MMAP_OFFSET.
To be removed on upstream merge.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
---
 include/drm-uapi/i915_drm.h | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/include/drm-uapi/i915_drm.h b/include/drm-uapi/i915_drm.h
index ab899abb..154e07ce 100644
--- a/include/drm-uapi/i915_drm.h
+++ b/include/drm-uapi/i915_drm.h
@@ -2245,6 +2245,39 @@ struct drm_i915_query_perf_config {
 	__u8 data[];
 };
 
+/*
+ * Local structures and definitions to be removed on upstream merge
+ */
+struct local_i915_gem_mmap_offset {
+	/** Handle for the object being mapped. */
+	__u32 handle;
+	__u32 pad;
+	/**
+	 * Fake offset to use for subsequent mmap call
+	 *
+	 * This is a fixed-size type for 32/64 compatibility.
+	 */
+	__u64 offset;
+	/**
+	 * Flags for extended behaviour.
+	 *
+	 * It is mandatory that either one of the _WC/_WB flags
+	 * should be passed here.
+	 */
+	__u64 flags;
+
+#define LOCAL_I915_MMAP_OFFSET_GTT 0
+#define LOCAL_I915_MMAP_OFFSET_WC  1
+#define LOCAL_I915_MMAP_OFFSET_WB  2
+#define LOCAL_I915_MMAP_OFFSET_UC  3
+
+	__u64 extensions;
+};
+
+#define LOCAL_I915_GEM_MMAP_OFFSET       DRM_I915_GEM_MMAP_GTT
+#define LOCAL_IOCTL_I915_GEM_MMAP_OFFSET         DRM_IOWR(DRM_COMMAND_BASE + \
+	LOCAL_I915_GEM_MMAP_OFFSET, struct local_i915_gem_mmap_offset)
+
 #if defined(__cplusplus)
 }
 #endif
-- 
2.23.0



More information about the igt-dev mailing list