[igt-dev] [PATCH i-g-t v5 1/4] include/drm-uapi/i915_drm: Add local defs for memory region uAPI
Zbigniew Kempczyński
zbigniew.kempczynski at intel.com
Fri Nov 22 08:13:54 UTC 2019
Contains local definitions and structures for memory region uAPI
until upstream changes will be merged.
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
---
include/drm-uapi/i915_drm.h | 92 +++++++++++++++++++++++++++++++++++++
1 file changed, 92 insertions(+)
diff --git a/include/drm-uapi/i915_drm.h b/include/drm-uapi/i915_drm.h
index ab899abb..3accb290 100644
--- a/include/drm-uapi/i915_drm.h
+++ b/include/drm-uapi/i915_drm.h
@@ -2245,6 +2245,98 @@ 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_QUERY_MEMREGION_INFO 4
+struct local_i915_memory_region_info {
+
+ /** Base type of a region */
+#define LOCAL_I915_SYSTEM_MEMORY 0
+#define LOCAL_I915_DEVICE_MEMORY 1
+#define LOCAL_I915_STOLEN_MEMORY 2
+
+ /** The region id is encoded in a layout which makes it possible to
+ * retrieve the following information:
+ *
+ * Base type: log2(ID >> 16)
+ */
+ __u32 id;
+
+ /** Reserved field. MBZ */
+ __u32 rsvd0;
+
+ /** Unused for now. MBZ */
+ __u64 flags;
+
+ __u64 size;
+
+ /** Reserved fields must be cleared to zero. */
+ __u64 rsvd1[4];
+};
+
+struct local_i915_query_memory_region_info {
+
+ /** Number of struct drm_i915_memory_region_info structs */
+ __u32 num_regions;
+
+ /** MBZ */
+ __u32 rsvd[3];
+
+ struct local_i915_memory_region_info regions[];
+};
+
+struct local_i915_gem_object_param {
+ /** Handle for the object */
+ __u32 handle;
+
+ __u32 size;
+
+ /** Set the memory region for the object listed in preference order
+ * as an array of region ids within data. To force an object
+ * to a particular memory region, set the region as the sole entry.
+ *
+ * Valid region ids are derived from the id field of
+ * struct drm_i915_memory_region_info.
+ * See struct drm_i915_query_memory_region_info.
+ */
+#define I915_OBJECT_PARAM (1ull<<32)
+#define I915_PARAM_MEMORY_REGION 0x1
+ __u64 param;
+
+ __u64 data;
+};
+
+#define LOCAL_I915_GEM_OBJECT_SETPARAM DRM_I915_GEM_CONTEXT_SETPARAM
+#define LOCAL_IOCTL_I915_GEM_OBJECT_SETPARAM DRM_IOWR(DRM_COMMAND_BASE \
+ + LOCAL_I915_GEM_OBJECT_SETPARAM, struct local_i915_gem_object_param)
+
#if defined(__cplusplus)
}
#endif
--
2.23.0
More information about the igt-dev
mailing list