All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH i-g-t v3 1/9] i915_drm.h sync
@ 2021-05-26 13:00 ` Matthew Auld
  0 siblings, 0 replies; 20+ messages in thread
From: Matthew Auld @ 2021-05-26 13:00 UTC (permalink / raw)
  To: igt-dev; +Cc: intel-gfx

Sync to get gem_create_ext and the regions query stuff.

Generated from kernel commit: 2459e56fd8af ("drm/i915/uapi: implement
object placement extension")

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Acked-by: Petri Latvala <petri.latvala@intel.com>
---
 include/drm-uapi/i915_drm.h | 394 ++++++++++++++++++++++++++++++++----
 1 file changed, 360 insertions(+), 34 deletions(-)

diff --git a/include/drm-uapi/i915_drm.h b/include/drm-uapi/i915_drm.h
index bf9ea471..a1c0030c 100644
--- a/include/drm-uapi/i915_drm.h
+++ b/include/drm-uapi/i915_drm.h
@@ -62,8 +62,8 @@ extern "C" {
 #define I915_ERROR_UEVENT		"ERROR"
 #define I915_RESET_UEVENT		"RESET"
 
-/*
- * i915_user_extension: Base class for defining a chain of extensions
+/**
+ * struct i915_user_extension - Base class for defining a chain of extensions
  *
  * Many interfaces need to grow over time. In most cases we can simply
  * extend the struct and have userspace pass in more data. Another option,
@@ -76,12 +76,58 @@ extern "C" {
  * increasing complexity, and for large parts of that interface to be
  * entirely optional. The downside is more pointer chasing; chasing across
  * the boundary with pointers encapsulated inside u64.
+ *
+ * Example chaining:
+ *
+ * .. code-block:: C
+ *
+ *	struct i915_user_extension ext3 {
+ *		.next_extension = 0, // end
+ *		.name = ...,
+ *	};
+ *	struct i915_user_extension ext2 {
+ *		.next_extension = (uintptr_t)&ext3,
+ *		.name = ...,
+ *	};
+ *	struct i915_user_extension ext1 {
+ *		.next_extension = (uintptr_t)&ext2,
+ *		.name = ...,
+ *	};
+ *
+ * Typically the struct i915_user_extension would be embedded in some uAPI
+ * struct, and in this case we would feed it the head of the chain(i.e ext1),
+ * which would then apply all of the above extensions.
+ *
  */
 struct i915_user_extension {
+	/**
+	 * @next_extension:
+	 *
+	 * Pointer to the next struct i915_user_extension, or zero if the end.
+	 */
 	__u64 next_extension;
+	/**
+	 * @name: Name of the extension.
+	 *
+	 * Note that the name here is just some integer.
+	 *
+	 * Also note that the name space for this is not global for the whole
+	 * driver, but rather its scope/meaning is limited to the specific piece
+	 * of uAPI which has embedded the struct i915_user_extension.
+	 */
 	__u32 name;
-	__u32 flags; /* All undefined bits must be zero. */
-	__u32 rsvd[4]; /* Reserved for future use; must be zero. */
+	/**
+	 * @flags: MBZ
+	 *
+	 * All undefined bits must be zero.
+	 */
+	__u32 flags;
+	/**
+	 * @rsvd: MBZ
+	 *
+	 * Reserved for future use; must be zero.
+	 */
+	__u32 rsvd[4];
 };
 
 /*
@@ -360,6 +406,7 @@ typedef struct _drm_i915_sarea {
 #define DRM_I915_QUERY			0x39
 #define DRM_I915_GEM_VM_CREATE		0x3a
 #define DRM_I915_GEM_VM_DESTROY		0x3b
+#define DRM_I915_GEM_CREATE_EXT		0x3c
 /* Must be kept compact -- no holes */
 
 #define DRM_IOCTL_I915_INIT		DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t)
@@ -392,6 +439,7 @@ typedef struct _drm_i915_sarea {
 #define DRM_IOCTL_I915_GEM_ENTERVT	DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_ENTERVT)
 #define DRM_IOCTL_I915_GEM_LEAVEVT	DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_LEAVEVT)
 #define DRM_IOCTL_I915_GEM_CREATE	DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_CREATE, struct drm_i915_gem_create)
+#define DRM_IOCTL_I915_GEM_CREATE_EXT	DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_CREATE_EXT, struct drm_i915_gem_create_ext)
 #define DRM_IOCTL_I915_GEM_PREAD	DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_PREAD, struct drm_i915_gem_pread)
 #define DRM_IOCTL_I915_GEM_PWRITE	DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_PWRITE, struct drm_i915_gem_pwrite)
 #define DRM_IOCTL_I915_GEM_MMAP		DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP, struct drm_i915_gem_mmap)
@@ -943,6 +991,7 @@ struct drm_i915_gem_exec_object {
 	__u64 offset;
 };
 
+/* DRM_IOCTL_I915_GEM_EXECBUFFER was removed in Linux 5.13 */
 struct drm_i915_gem_execbuffer {
 	/**
 	 * List of buffers to be validated with their relocations to be
@@ -1053,12 +1102,12 @@ struct drm_i915_gem_exec_fence {
 	__u32 flags;
 };
 
-/**
+/*
  * See drm_i915_gem_execbuffer_ext_timeline_fences.
  */
 #define DRM_I915_GEM_EXECBUFFER_EXT_TIMELINE_FENCES 0
 
-/**
+/*
  * 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.
@@ -1699,7 +1748,7 @@ struct drm_i915_gem_context_param {
 	__u64 value;
 };
 
-/**
+/*
  * Context SSEU programming
  *
  * It may be necessary for either functional or performance reason to configure
@@ -2066,7 +2115,7 @@ struct drm_i915_perf_open_param {
 	__u64 properties_ptr;
 };
 
-/**
+/*
  * Enable data capture for a stream that was either opened in a disabled state
  * via I915_PERF_FLAG_DISABLED or was later disabled via
  * I915_PERF_IOCTL_DISABLE.
@@ -2080,7 +2129,7 @@ struct drm_i915_perf_open_param {
  */
 #define I915_PERF_IOCTL_ENABLE	_IO('i', 0x0)
 
-/**
+/*
  * Disable data capture for a stream.
  *
  * It is an error to try and read a stream that is disabled.
@@ -2089,7 +2138,7 @@ struct drm_i915_perf_open_param {
  */
 #define I915_PERF_IOCTL_DISABLE	_IO('i', 0x1)
 
-/**
+/*
  * Change metrics_set captured by a stream.
  *
  * If the stream is bound to a specific context, the configuration change
@@ -2102,7 +2151,7 @@ struct drm_i915_perf_open_param {
  */
 #define I915_PERF_IOCTL_CONFIG	_IO('i', 0x2)
 
-/**
+/*
  * Common to all i915 perf records
  */
 struct drm_i915_perf_record_header {
@@ -2150,7 +2199,7 @@ enum drm_i915_perf_record_type {
 	DRM_I915_PERF_RECORD_MAX /* non-ABI */
 };
 
-/**
+/*
  * Structure to upload perf dynamic configuration into the kernel.
  */
 struct drm_i915_perf_oa_config {
@@ -2171,53 +2220,95 @@ struct drm_i915_perf_oa_config {
 	__u64 flex_regs_ptr;
 };
 
+/**
+ * struct drm_i915_query_item - An individual query for the kernel to process.
+ *
+ * The behaviour is determined by the @query_id. Note that exactly what
+ * @data_ptr is also depends on the specific @query_id.
+ */
 struct drm_i915_query_item {
+	/** @query_id: The id for this query */
 	__u64 query_id;
 #define DRM_I915_QUERY_TOPOLOGY_INFO    1
 #define DRM_I915_QUERY_ENGINE_INFO	2
 #define DRM_I915_QUERY_PERF_CONFIG      3
+#define DRM_I915_QUERY_MEMORY_REGIONS   4
 /* Must be kept compact -- no holes and well documented */
 
-	/*
+	/**
+	 * @length:
+	 *
 	 * When set to zero by userspace, this is filled with the size of the
-	 * data to be written at the data_ptr pointer. The kernel sets this
+	 * data to be written at the @data_ptr pointer. The kernel sets this
 	 * value to a negative value to signal an error on a particular query
 	 * item.
 	 */
 	__s32 length;
 
-	/*
+	/**
+	 * @flags:
+	 *
 	 * When query_id == DRM_I915_QUERY_TOPOLOGY_INFO, must be 0.
 	 *
 	 * When query_id == DRM_I915_QUERY_PERF_CONFIG, must be one of the
-	 * following :
-	 *         - DRM_I915_QUERY_PERF_CONFIG_LIST
-	 *         - DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID
-	 *         - DRM_I915_QUERY_PERF_CONFIG_FOR_UUID
+	 * following:
+	 *
+	 *	- DRM_I915_QUERY_PERF_CONFIG_LIST
+	 *      - DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID
+	 *      - DRM_I915_QUERY_PERF_CONFIG_FOR_UUID
 	 */
 	__u32 flags;
 #define DRM_I915_QUERY_PERF_CONFIG_LIST          1
 #define DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID 2
 #define DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_ID   3
 
-	/*
-	 * Data will be written at the location pointed by data_ptr when the
-	 * value of length matches the length of the data to be written by the
+	/**
+	 * @data_ptr:
+	 *
+	 * Data will be written at the location pointed by @data_ptr when the
+	 * value of @length matches the length of the data to be written by the
 	 * kernel.
 	 */
 	__u64 data_ptr;
 };
 
+/**
+ * struct drm_i915_query - Supply an array of struct drm_i915_query_item for the
+ * kernel to fill out.
+ *
+ * Note that this is generally a two step process for each struct
+ * drm_i915_query_item in the array:
+ *
+ * 1. Call the DRM_IOCTL_I915_QUERY, giving it our array of struct
+ *    drm_i915_query_item, with &drm_i915_query_item.length set to zero. The
+ *    kernel will then fill in the size, in bytes, which tells userspace how
+ *    memory it needs to allocate for the blob(say for an array of properties).
+ *
+ * 2. Next we call DRM_IOCTL_I915_QUERY again, this time with the
+ *    &drm_i915_query_item.data_ptr equal to our newly allocated blob. Note that
+ *    the &drm_i915_query_item.length should still be the same as what the
+ *    kernel previously set. At this point the kernel can fill in the blob.
+ *
+ * Note that for some query items it can make sense for userspace to just pass
+ * in a buffer/blob equal to or larger than the required size. In this case only
+ * a single ioctl call is needed. For some smaller query items this can work
+ * quite well.
+ *
+ */
 struct drm_i915_query {
+	/** @num_items: The number of elements in the @items_ptr array */
 	__u32 num_items;
 
-	/*
-	 * Unused for now. Must be cleared to zero.
+	/**
+	 * @flags: Unused for now. Must be cleared to zero.
 	 */
 	__u32 flags;
 
-	/*
-	 * This points to an array of num_items drm_i915_query_item structures.
+	/**
+	 * @items_ptr:
+	 *
+	 * Pointer to an array of struct drm_i915_query_item. The number of
+	 * array elements is @num_items.
 	 */
 	__u64 items_ptr;
 };
@@ -2291,21 +2382,21 @@ struct drm_i915_query_topology_info {
  * Describes one engine and it's capabilities as known to the driver.
  */
 struct drm_i915_engine_info {
-	/** Engine class and instance. */
+	/** @engine: Engine class and instance. */
 	struct i915_engine_class_instance engine;
 
-	/** Reserved field. */
+	/** @rsvd0: Reserved field. */
 	__u32 rsvd0;
 
-	/** Engine flags. */
+	/** @flags: Engine flags. */
 	__u64 flags;
 
-	/** Capabilities of this engine. */
+	/** @capabilities: 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. */
+	/** @rsvd1: Reserved fields. */
 	__u64 rsvd1[4];
 };
 
@@ -2316,13 +2407,13 @@ struct drm_i915_engine_info {
  * an array of struct drm_i915_engine_info structures.
  */
 struct drm_i915_query_engine_info {
-	/** Number of struct drm_i915_engine_info structs following. */
+	/** @num_engines: Number of struct drm_i915_engine_info structs following. */
 	__u32 num_engines;
 
-	/** MBZ */
+	/** @rsvd: MBZ */
 	__u32 rsvd[3];
 
-	/** Marker for drm_i915_engine_info structures. */
+	/** @engines: Marker for drm_i915_engine_info structures. */
 	struct drm_i915_engine_info engines[];
 };
 
@@ -2376,6 +2467,241 @@ struct drm_i915_query_perf_config {
 	__u8 data[];
 };
 
+/**
+ * enum drm_i915_gem_memory_class - Supported memory classes
+ */
+enum drm_i915_gem_memory_class {
+	/** @I915_MEMORY_CLASS_SYSTEM: System memory */
+	I915_MEMORY_CLASS_SYSTEM = 0,
+	/** @I915_MEMORY_CLASS_DEVICE: Device local-memory */
+	I915_MEMORY_CLASS_DEVICE,
+};
+
+/**
+ * struct drm_i915_gem_memory_class_instance - Identify particular memory region
+ */
+struct drm_i915_gem_memory_class_instance {
+	/** @memory_class: See enum drm_i915_gem_memory_class */
+	__u16 memory_class;
+
+	/** @memory_instance: Which instance */
+	__u16 memory_instance;
+};
+
+/**
+ * struct drm_i915_memory_region_info - Describes one region as known to the
+ * driver.
+ *
+ * Note that we reserve some stuff here for potential future work. As an example
+ * we might want expose the capabilities for a given region, which could include
+ * things like if the region is CPU mappable/accessible, what are the supported
+ * mapping types etc.
+ *
+ * Note that to extend struct drm_i915_memory_region_info and struct
+ * drm_i915_query_memory_regions in the future the plan is to do the following:
+ *
+ * .. code-block:: C
+ *
+ *	struct drm_i915_memory_region_info {
+ *		struct drm_i915_gem_memory_class_instance region;
+ *		union {
+ *			__u32 rsvd0;
+ *			__u32 new_thing1;
+ *		};
+ *		...
+ *		union {
+ *			__u64 rsvd1[8];
+ *			struct {
+ *				__u64 new_thing2;
+ *				__u64 new_thing3;
+ *				...
+ *			};
+ *		};
+ *	};
+ *
+ * With this things should remain source compatible between versions for
+ * userspace, even as we add new fields.
+ *
+ * Note this is using both struct drm_i915_query_item and struct drm_i915_query.
+ * For this new query we are adding the new query id DRM_I915_QUERY_MEMORY_REGIONS
+ * at &drm_i915_query_item.query_id.
+ */
+struct drm_i915_memory_region_info {
+	/** @region: The class:instance pair encoding */
+	struct drm_i915_gem_memory_class_instance region;
+
+	/** @rsvd0: MBZ */
+	__u32 rsvd0;
+
+	/** @probed_size: Memory probed by the driver (-1 = unknown) */
+	__u64 probed_size;
+
+	/** @unallocated_size: Estimate of memory remaining (-1 = unknown) */
+	__u64 unallocated_size;
+
+	/** @rsvd1: MBZ */
+	__u64 rsvd1[8];
+};
+
+/**
+ * struct drm_i915_query_memory_regions
+ *
+ * The region info query enumerates all regions known to the driver by filling
+ * in an array of struct drm_i915_memory_region_info structures.
+ *
+ * Example for getting the list of supported regions:
+ *
+ * .. code-block:: C
+ *
+ *	struct drm_i915_query_memory_regions *info;
+ *	struct drm_i915_query_item item = {
+ *		.query_id = DRM_I915_QUERY_MEMORY_REGIONS;
+ *	};
+ *	struct drm_i915_query query = {
+ *		.num_items = 1,
+ *		.items_ptr = (uintptr_t)&item,
+ *	};
+ *	int err, i;
+ *
+ *	// First query the size of the blob we need, this needs to be large
+ *	// enough to hold our array of regions. The kernel will fill out the
+ *	// item.length for us, which is the number of bytes we need.
+ *	err = ioctl(fd, DRM_IOCTL_I915_QUERY, &query);
+ *	if (err) ...
+ *
+ *	info = calloc(1, item.length);
+ *	// Now that we allocated the required number of bytes, we call the ioctl
+ *	// again, this time with the data_ptr pointing to our newly allocated
+ *	// blob, which the kernel can then populate with the all the region info.
+ *	item.data_ptr = (uintptr_t)&info,
+ *
+ *	err = ioctl(fd, DRM_IOCTL_I915_QUERY, &query);
+ *	if (err) ...
+ *
+ *	// We can now access each region in the array
+ *	for (i = 0; i < info->num_regions; i++) {
+ *		struct drm_i915_memory_region_info mr = info->regions[i];
+ *		u16 class = mr.region.class;
+ *		u16 instance = mr.region.instance;
+ *
+ *		....
+ *	}
+ *
+ *	free(info);
+ */
+struct drm_i915_query_memory_regions {
+	/** @num_regions: Number of supported regions */
+	__u32 num_regions;
+
+	/** @rsvd: MBZ */
+	__u32 rsvd[3];
+
+	/** @regions: Info about each supported region */
+	struct drm_i915_memory_region_info regions[];
+};
+
+/**
+ * struct drm_i915_gem_create_ext - Existing gem_create behaviour, with added
+ * extension support using struct i915_user_extension.
+ *
+ * Note that in the future we want to have our buffer flags here, at least for
+ * the stuff that is immutable. Previously we would have two ioctls, one to
+ * create the object with gem_create, and another to apply various parameters,
+ * however this creates some ambiguity for the params which are considered
+ * immutable. Also in general we're phasing out the various SET/GET ioctls.
+ */
+struct drm_i915_gem_create_ext {
+	/**
+	 * @size: Requested size for the object.
+	 *
+	 * The (page-aligned) allocated size for the object will be returned.
+	 *
+	 * Note that for some devices we have might have further minimum
+	 * page-size restrictions(larger than 4K), like for device local-memory.
+	 * However in general the final size here should always reflect any
+	 * rounding up, if for example using the I915_GEM_CREATE_EXT_MEMORY_REGIONS
+	 * extension to place the object in device local-memory.
+	 */
+	__u64 size;
+	/**
+	 * @handle: Returned handle for the object.
+	 *
+	 * Object handles are nonzero.
+	 */
+	__u32 handle;
+	/** @flags: MBZ */
+	__u32 flags;
+	/**
+	 * @extensions: The chain of extensions to apply to this object.
+	 *
+	 * This will be useful in the future when we need to support several
+	 * different extensions, and we need to apply more than one when
+	 * creating the object. See struct i915_user_extension.
+	 *
+	 * If we don't supply any extensions then we get the same old gem_create
+	 * behaviour.
+	 *
+	 * For I915_GEM_CREATE_EXT_MEMORY_REGIONS usage see
+	 * struct drm_i915_gem_create_ext_memory_regions.
+	 */
+#define I915_GEM_CREATE_EXT_MEMORY_REGIONS 0
+	__u64 extensions;
+};
+
+/**
+ * struct drm_i915_gem_create_ext_memory_regions - The
+ * I915_GEM_CREATE_EXT_MEMORY_REGIONS extension.
+ *
+ * Set the object with the desired set of placements/regions in priority
+ * order. Each entry must be unique and supported by the device.
+ *
+ * This is provided as an array of struct drm_i915_gem_memory_class_instance, or
+ * an equivalent layout of class:instance pair encodings. See struct
+ * drm_i915_query_memory_regions and DRM_I915_QUERY_MEMORY_REGIONS for how to
+ * query the supported regions for a device.
+ *
+ * As an example, on discrete devices, if we wish to set the placement as
+ * device local-memory we can do something like:
+ *
+ * .. code-block:: C
+ *
+ *	struct drm_i915_gem_memory_class_instance region_lmem = {
+ *              .memory_class = I915_MEMORY_CLASS_DEVICE,
+ *              .memory_instance = 0,
+ *      };
+ *      struct drm_i915_gem_create_ext_memory_regions regions = {
+ *              .base = { .name = I915_GEM_CREATE_EXT_MEMORY_REGIONS },
+ *              .regions = (uintptr_t)&region_lmem,
+ *              .num_regions = 1,
+ *      };
+ *      struct drm_i915_gem_create_ext create_ext = {
+ *              .size = 16 * PAGE_SIZE,
+ *              .extensions = (uintptr_t)&regions,
+ *      };
+ *
+ *      int err = ioctl(fd, DRM_IOCTL_I915_GEM_CREATE_EXT, &create_ext);
+ *      if (err) ...
+ *
+ * At which point we get the object handle in &drm_i915_gem_create_ext.handle,
+ * along with the final object size in &drm_i915_gem_create_ext.size, which
+ * should account for any rounding up, if required.
+ */
+struct drm_i915_gem_create_ext_memory_regions {
+	/** @base: Extension link. See struct i915_user_extension. */
+	struct i915_user_extension base;
+
+	/** @pad: MBZ */
+	__u32 pad;
+	/** @num_regions: Number of elements in the @regions array. */
+	__u32 num_regions;
+	/**
+	 * @regions: The regions/placements array.
+	 *
+	 * An array of struct drm_i915_gem_memory_class_instance.
+	 */
+	__u64 regions;
+};
+
 #if defined(__cplusplus)
 }
 #endif
-- 
2.26.3

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

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

* [igt-dev] [PATCH i-g-t v3 1/9] i915_drm.h sync
@ 2021-05-26 13:00 ` Matthew Auld
  0 siblings, 0 replies; 20+ messages in thread
From: Matthew Auld @ 2021-05-26 13:00 UTC (permalink / raw)
  To: igt-dev; +Cc: intel-gfx, Petri Latvala

Sync to get gem_create_ext and the regions query stuff.

Generated from kernel commit: 2459e56fd8af ("drm/i915/uapi: implement
object placement extension")

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Acked-by: Petri Latvala <petri.latvala@intel.com>
---
 include/drm-uapi/i915_drm.h | 394 ++++++++++++++++++++++++++++++++----
 1 file changed, 360 insertions(+), 34 deletions(-)

diff --git a/include/drm-uapi/i915_drm.h b/include/drm-uapi/i915_drm.h
index bf9ea471..a1c0030c 100644
--- a/include/drm-uapi/i915_drm.h
+++ b/include/drm-uapi/i915_drm.h
@@ -62,8 +62,8 @@ extern "C" {
 #define I915_ERROR_UEVENT		"ERROR"
 #define I915_RESET_UEVENT		"RESET"
 
-/*
- * i915_user_extension: Base class for defining a chain of extensions
+/**
+ * struct i915_user_extension - Base class for defining a chain of extensions
  *
  * Many interfaces need to grow over time. In most cases we can simply
  * extend the struct and have userspace pass in more data. Another option,
@@ -76,12 +76,58 @@ extern "C" {
  * increasing complexity, and for large parts of that interface to be
  * entirely optional. The downside is more pointer chasing; chasing across
  * the boundary with pointers encapsulated inside u64.
+ *
+ * Example chaining:
+ *
+ * .. code-block:: C
+ *
+ *	struct i915_user_extension ext3 {
+ *		.next_extension = 0, // end
+ *		.name = ...,
+ *	};
+ *	struct i915_user_extension ext2 {
+ *		.next_extension = (uintptr_t)&ext3,
+ *		.name = ...,
+ *	};
+ *	struct i915_user_extension ext1 {
+ *		.next_extension = (uintptr_t)&ext2,
+ *		.name = ...,
+ *	};
+ *
+ * Typically the struct i915_user_extension would be embedded in some uAPI
+ * struct, and in this case we would feed it the head of the chain(i.e ext1),
+ * which would then apply all of the above extensions.
+ *
  */
 struct i915_user_extension {
+	/**
+	 * @next_extension:
+	 *
+	 * Pointer to the next struct i915_user_extension, or zero if the end.
+	 */
 	__u64 next_extension;
+	/**
+	 * @name: Name of the extension.
+	 *
+	 * Note that the name here is just some integer.
+	 *
+	 * Also note that the name space for this is not global for the whole
+	 * driver, but rather its scope/meaning is limited to the specific piece
+	 * of uAPI which has embedded the struct i915_user_extension.
+	 */
 	__u32 name;
-	__u32 flags; /* All undefined bits must be zero. */
-	__u32 rsvd[4]; /* Reserved for future use; must be zero. */
+	/**
+	 * @flags: MBZ
+	 *
+	 * All undefined bits must be zero.
+	 */
+	__u32 flags;
+	/**
+	 * @rsvd: MBZ
+	 *
+	 * Reserved for future use; must be zero.
+	 */
+	__u32 rsvd[4];
 };
 
 /*
@@ -360,6 +406,7 @@ typedef struct _drm_i915_sarea {
 #define DRM_I915_QUERY			0x39
 #define DRM_I915_GEM_VM_CREATE		0x3a
 #define DRM_I915_GEM_VM_DESTROY		0x3b
+#define DRM_I915_GEM_CREATE_EXT		0x3c
 /* Must be kept compact -- no holes */
 
 #define DRM_IOCTL_I915_INIT		DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t)
@@ -392,6 +439,7 @@ typedef struct _drm_i915_sarea {
 #define DRM_IOCTL_I915_GEM_ENTERVT	DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_ENTERVT)
 #define DRM_IOCTL_I915_GEM_LEAVEVT	DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_LEAVEVT)
 #define DRM_IOCTL_I915_GEM_CREATE	DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_CREATE, struct drm_i915_gem_create)
+#define DRM_IOCTL_I915_GEM_CREATE_EXT	DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_CREATE_EXT, struct drm_i915_gem_create_ext)
 #define DRM_IOCTL_I915_GEM_PREAD	DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_PREAD, struct drm_i915_gem_pread)
 #define DRM_IOCTL_I915_GEM_PWRITE	DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_PWRITE, struct drm_i915_gem_pwrite)
 #define DRM_IOCTL_I915_GEM_MMAP		DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP, struct drm_i915_gem_mmap)
@@ -943,6 +991,7 @@ struct drm_i915_gem_exec_object {
 	__u64 offset;
 };
 
+/* DRM_IOCTL_I915_GEM_EXECBUFFER was removed in Linux 5.13 */
 struct drm_i915_gem_execbuffer {
 	/**
 	 * List of buffers to be validated with their relocations to be
@@ -1053,12 +1102,12 @@ struct drm_i915_gem_exec_fence {
 	__u32 flags;
 };
 
-/**
+/*
  * See drm_i915_gem_execbuffer_ext_timeline_fences.
  */
 #define DRM_I915_GEM_EXECBUFFER_EXT_TIMELINE_FENCES 0
 
-/**
+/*
  * 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.
@@ -1699,7 +1748,7 @@ struct drm_i915_gem_context_param {
 	__u64 value;
 };
 
-/**
+/*
  * Context SSEU programming
  *
  * It may be necessary for either functional or performance reason to configure
@@ -2066,7 +2115,7 @@ struct drm_i915_perf_open_param {
 	__u64 properties_ptr;
 };
 
-/**
+/*
  * Enable data capture for a stream that was either opened in a disabled state
  * via I915_PERF_FLAG_DISABLED or was later disabled via
  * I915_PERF_IOCTL_DISABLE.
@@ -2080,7 +2129,7 @@ struct drm_i915_perf_open_param {
  */
 #define I915_PERF_IOCTL_ENABLE	_IO('i', 0x0)
 
-/**
+/*
  * Disable data capture for a stream.
  *
  * It is an error to try and read a stream that is disabled.
@@ -2089,7 +2138,7 @@ struct drm_i915_perf_open_param {
  */
 #define I915_PERF_IOCTL_DISABLE	_IO('i', 0x1)
 
-/**
+/*
  * Change metrics_set captured by a stream.
  *
  * If the stream is bound to a specific context, the configuration change
@@ -2102,7 +2151,7 @@ struct drm_i915_perf_open_param {
  */
 #define I915_PERF_IOCTL_CONFIG	_IO('i', 0x2)
 
-/**
+/*
  * Common to all i915 perf records
  */
 struct drm_i915_perf_record_header {
@@ -2150,7 +2199,7 @@ enum drm_i915_perf_record_type {
 	DRM_I915_PERF_RECORD_MAX /* non-ABI */
 };
 
-/**
+/*
  * Structure to upload perf dynamic configuration into the kernel.
  */
 struct drm_i915_perf_oa_config {
@@ -2171,53 +2220,95 @@ struct drm_i915_perf_oa_config {
 	__u64 flex_regs_ptr;
 };
 
+/**
+ * struct drm_i915_query_item - An individual query for the kernel to process.
+ *
+ * The behaviour is determined by the @query_id. Note that exactly what
+ * @data_ptr is also depends on the specific @query_id.
+ */
 struct drm_i915_query_item {
+	/** @query_id: The id for this query */
 	__u64 query_id;
 #define DRM_I915_QUERY_TOPOLOGY_INFO    1
 #define DRM_I915_QUERY_ENGINE_INFO	2
 #define DRM_I915_QUERY_PERF_CONFIG      3
+#define DRM_I915_QUERY_MEMORY_REGIONS   4
 /* Must be kept compact -- no holes and well documented */
 
-	/*
+	/**
+	 * @length:
+	 *
 	 * When set to zero by userspace, this is filled with the size of the
-	 * data to be written at the data_ptr pointer. The kernel sets this
+	 * data to be written at the @data_ptr pointer. The kernel sets this
 	 * value to a negative value to signal an error on a particular query
 	 * item.
 	 */
 	__s32 length;
 
-	/*
+	/**
+	 * @flags:
+	 *
 	 * When query_id == DRM_I915_QUERY_TOPOLOGY_INFO, must be 0.
 	 *
 	 * When query_id == DRM_I915_QUERY_PERF_CONFIG, must be one of the
-	 * following :
-	 *         - DRM_I915_QUERY_PERF_CONFIG_LIST
-	 *         - DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID
-	 *         - DRM_I915_QUERY_PERF_CONFIG_FOR_UUID
+	 * following:
+	 *
+	 *	- DRM_I915_QUERY_PERF_CONFIG_LIST
+	 *      - DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID
+	 *      - DRM_I915_QUERY_PERF_CONFIG_FOR_UUID
 	 */
 	__u32 flags;
 #define DRM_I915_QUERY_PERF_CONFIG_LIST          1
 #define DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID 2
 #define DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_ID   3
 
-	/*
-	 * Data will be written at the location pointed by data_ptr when the
-	 * value of length matches the length of the data to be written by the
+	/**
+	 * @data_ptr:
+	 *
+	 * Data will be written at the location pointed by @data_ptr when the
+	 * value of @length matches the length of the data to be written by the
 	 * kernel.
 	 */
 	__u64 data_ptr;
 };
 
+/**
+ * struct drm_i915_query - Supply an array of struct drm_i915_query_item for the
+ * kernel to fill out.
+ *
+ * Note that this is generally a two step process for each struct
+ * drm_i915_query_item in the array:
+ *
+ * 1. Call the DRM_IOCTL_I915_QUERY, giving it our array of struct
+ *    drm_i915_query_item, with &drm_i915_query_item.length set to zero. The
+ *    kernel will then fill in the size, in bytes, which tells userspace how
+ *    memory it needs to allocate for the blob(say for an array of properties).
+ *
+ * 2. Next we call DRM_IOCTL_I915_QUERY again, this time with the
+ *    &drm_i915_query_item.data_ptr equal to our newly allocated blob. Note that
+ *    the &drm_i915_query_item.length should still be the same as what the
+ *    kernel previously set. At this point the kernel can fill in the blob.
+ *
+ * Note that for some query items it can make sense for userspace to just pass
+ * in a buffer/blob equal to or larger than the required size. In this case only
+ * a single ioctl call is needed. For some smaller query items this can work
+ * quite well.
+ *
+ */
 struct drm_i915_query {
+	/** @num_items: The number of elements in the @items_ptr array */
 	__u32 num_items;
 
-	/*
-	 * Unused for now. Must be cleared to zero.
+	/**
+	 * @flags: Unused for now. Must be cleared to zero.
 	 */
 	__u32 flags;
 
-	/*
-	 * This points to an array of num_items drm_i915_query_item structures.
+	/**
+	 * @items_ptr:
+	 *
+	 * Pointer to an array of struct drm_i915_query_item. The number of
+	 * array elements is @num_items.
 	 */
 	__u64 items_ptr;
 };
@@ -2291,21 +2382,21 @@ struct drm_i915_query_topology_info {
  * Describes one engine and it's capabilities as known to the driver.
  */
 struct drm_i915_engine_info {
-	/** Engine class and instance. */
+	/** @engine: Engine class and instance. */
 	struct i915_engine_class_instance engine;
 
-	/** Reserved field. */
+	/** @rsvd0: Reserved field. */
 	__u32 rsvd0;
 
-	/** Engine flags. */
+	/** @flags: Engine flags. */
 	__u64 flags;
 
-	/** Capabilities of this engine. */
+	/** @capabilities: 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. */
+	/** @rsvd1: Reserved fields. */
 	__u64 rsvd1[4];
 };
 
@@ -2316,13 +2407,13 @@ struct drm_i915_engine_info {
  * an array of struct drm_i915_engine_info structures.
  */
 struct drm_i915_query_engine_info {
-	/** Number of struct drm_i915_engine_info structs following. */
+	/** @num_engines: Number of struct drm_i915_engine_info structs following. */
 	__u32 num_engines;
 
-	/** MBZ */
+	/** @rsvd: MBZ */
 	__u32 rsvd[3];
 
-	/** Marker for drm_i915_engine_info structures. */
+	/** @engines: Marker for drm_i915_engine_info structures. */
 	struct drm_i915_engine_info engines[];
 };
 
@@ -2376,6 +2467,241 @@ struct drm_i915_query_perf_config {
 	__u8 data[];
 };
 
+/**
+ * enum drm_i915_gem_memory_class - Supported memory classes
+ */
+enum drm_i915_gem_memory_class {
+	/** @I915_MEMORY_CLASS_SYSTEM: System memory */
+	I915_MEMORY_CLASS_SYSTEM = 0,
+	/** @I915_MEMORY_CLASS_DEVICE: Device local-memory */
+	I915_MEMORY_CLASS_DEVICE,
+};
+
+/**
+ * struct drm_i915_gem_memory_class_instance - Identify particular memory region
+ */
+struct drm_i915_gem_memory_class_instance {
+	/** @memory_class: See enum drm_i915_gem_memory_class */
+	__u16 memory_class;
+
+	/** @memory_instance: Which instance */
+	__u16 memory_instance;
+};
+
+/**
+ * struct drm_i915_memory_region_info - Describes one region as known to the
+ * driver.
+ *
+ * Note that we reserve some stuff here for potential future work. As an example
+ * we might want expose the capabilities for a given region, which could include
+ * things like if the region is CPU mappable/accessible, what are the supported
+ * mapping types etc.
+ *
+ * Note that to extend struct drm_i915_memory_region_info and struct
+ * drm_i915_query_memory_regions in the future the plan is to do the following:
+ *
+ * .. code-block:: C
+ *
+ *	struct drm_i915_memory_region_info {
+ *		struct drm_i915_gem_memory_class_instance region;
+ *		union {
+ *			__u32 rsvd0;
+ *			__u32 new_thing1;
+ *		};
+ *		...
+ *		union {
+ *			__u64 rsvd1[8];
+ *			struct {
+ *				__u64 new_thing2;
+ *				__u64 new_thing3;
+ *				...
+ *			};
+ *		};
+ *	};
+ *
+ * With this things should remain source compatible between versions for
+ * userspace, even as we add new fields.
+ *
+ * Note this is using both struct drm_i915_query_item and struct drm_i915_query.
+ * For this new query we are adding the new query id DRM_I915_QUERY_MEMORY_REGIONS
+ * at &drm_i915_query_item.query_id.
+ */
+struct drm_i915_memory_region_info {
+	/** @region: The class:instance pair encoding */
+	struct drm_i915_gem_memory_class_instance region;
+
+	/** @rsvd0: MBZ */
+	__u32 rsvd0;
+
+	/** @probed_size: Memory probed by the driver (-1 = unknown) */
+	__u64 probed_size;
+
+	/** @unallocated_size: Estimate of memory remaining (-1 = unknown) */
+	__u64 unallocated_size;
+
+	/** @rsvd1: MBZ */
+	__u64 rsvd1[8];
+};
+
+/**
+ * struct drm_i915_query_memory_regions
+ *
+ * The region info query enumerates all regions known to the driver by filling
+ * in an array of struct drm_i915_memory_region_info structures.
+ *
+ * Example for getting the list of supported regions:
+ *
+ * .. code-block:: C
+ *
+ *	struct drm_i915_query_memory_regions *info;
+ *	struct drm_i915_query_item item = {
+ *		.query_id = DRM_I915_QUERY_MEMORY_REGIONS;
+ *	};
+ *	struct drm_i915_query query = {
+ *		.num_items = 1,
+ *		.items_ptr = (uintptr_t)&item,
+ *	};
+ *	int err, i;
+ *
+ *	// First query the size of the blob we need, this needs to be large
+ *	// enough to hold our array of regions. The kernel will fill out the
+ *	// item.length for us, which is the number of bytes we need.
+ *	err = ioctl(fd, DRM_IOCTL_I915_QUERY, &query);
+ *	if (err) ...
+ *
+ *	info = calloc(1, item.length);
+ *	// Now that we allocated the required number of bytes, we call the ioctl
+ *	// again, this time with the data_ptr pointing to our newly allocated
+ *	// blob, which the kernel can then populate with the all the region info.
+ *	item.data_ptr = (uintptr_t)&info,
+ *
+ *	err = ioctl(fd, DRM_IOCTL_I915_QUERY, &query);
+ *	if (err) ...
+ *
+ *	// We can now access each region in the array
+ *	for (i = 0; i < info->num_regions; i++) {
+ *		struct drm_i915_memory_region_info mr = info->regions[i];
+ *		u16 class = mr.region.class;
+ *		u16 instance = mr.region.instance;
+ *
+ *		....
+ *	}
+ *
+ *	free(info);
+ */
+struct drm_i915_query_memory_regions {
+	/** @num_regions: Number of supported regions */
+	__u32 num_regions;
+
+	/** @rsvd: MBZ */
+	__u32 rsvd[3];
+
+	/** @regions: Info about each supported region */
+	struct drm_i915_memory_region_info regions[];
+};
+
+/**
+ * struct drm_i915_gem_create_ext - Existing gem_create behaviour, with added
+ * extension support using struct i915_user_extension.
+ *
+ * Note that in the future we want to have our buffer flags here, at least for
+ * the stuff that is immutable. Previously we would have two ioctls, one to
+ * create the object with gem_create, and another to apply various parameters,
+ * however this creates some ambiguity for the params which are considered
+ * immutable. Also in general we're phasing out the various SET/GET ioctls.
+ */
+struct drm_i915_gem_create_ext {
+	/**
+	 * @size: Requested size for the object.
+	 *
+	 * The (page-aligned) allocated size for the object will be returned.
+	 *
+	 * Note that for some devices we have might have further minimum
+	 * page-size restrictions(larger than 4K), like for device local-memory.
+	 * However in general the final size here should always reflect any
+	 * rounding up, if for example using the I915_GEM_CREATE_EXT_MEMORY_REGIONS
+	 * extension to place the object in device local-memory.
+	 */
+	__u64 size;
+	/**
+	 * @handle: Returned handle for the object.
+	 *
+	 * Object handles are nonzero.
+	 */
+	__u32 handle;
+	/** @flags: MBZ */
+	__u32 flags;
+	/**
+	 * @extensions: The chain of extensions to apply to this object.
+	 *
+	 * This will be useful in the future when we need to support several
+	 * different extensions, and we need to apply more than one when
+	 * creating the object. See struct i915_user_extension.
+	 *
+	 * If we don't supply any extensions then we get the same old gem_create
+	 * behaviour.
+	 *
+	 * For I915_GEM_CREATE_EXT_MEMORY_REGIONS usage see
+	 * struct drm_i915_gem_create_ext_memory_regions.
+	 */
+#define I915_GEM_CREATE_EXT_MEMORY_REGIONS 0
+	__u64 extensions;
+};
+
+/**
+ * struct drm_i915_gem_create_ext_memory_regions - The
+ * I915_GEM_CREATE_EXT_MEMORY_REGIONS extension.
+ *
+ * Set the object with the desired set of placements/regions in priority
+ * order. Each entry must be unique and supported by the device.
+ *
+ * This is provided as an array of struct drm_i915_gem_memory_class_instance, or
+ * an equivalent layout of class:instance pair encodings. See struct
+ * drm_i915_query_memory_regions and DRM_I915_QUERY_MEMORY_REGIONS for how to
+ * query the supported regions for a device.
+ *
+ * As an example, on discrete devices, if we wish to set the placement as
+ * device local-memory we can do something like:
+ *
+ * .. code-block:: C
+ *
+ *	struct drm_i915_gem_memory_class_instance region_lmem = {
+ *              .memory_class = I915_MEMORY_CLASS_DEVICE,
+ *              .memory_instance = 0,
+ *      };
+ *      struct drm_i915_gem_create_ext_memory_regions regions = {
+ *              .base = { .name = I915_GEM_CREATE_EXT_MEMORY_REGIONS },
+ *              .regions = (uintptr_t)&region_lmem,
+ *              .num_regions = 1,
+ *      };
+ *      struct drm_i915_gem_create_ext create_ext = {
+ *              .size = 16 * PAGE_SIZE,
+ *              .extensions = (uintptr_t)&regions,
+ *      };
+ *
+ *      int err = ioctl(fd, DRM_IOCTL_I915_GEM_CREATE_EXT, &create_ext);
+ *      if (err) ...
+ *
+ * At which point we get the object handle in &drm_i915_gem_create_ext.handle,
+ * along with the final object size in &drm_i915_gem_create_ext.size, which
+ * should account for any rounding up, if required.
+ */
+struct drm_i915_gem_create_ext_memory_regions {
+	/** @base: Extension link. See struct i915_user_extension. */
+	struct i915_user_extension base;
+
+	/** @pad: MBZ */
+	__u32 pad;
+	/** @num_regions: Number of elements in the @regions array. */
+	__u32 num_regions;
+	/**
+	 * @regions: The regions/placements array.
+	 *
+	 * An array of struct drm_i915_gem_memory_class_instance.
+	 */
+	__u64 regions;
+};
+
 #if defined(__cplusplus)
 }
 #endif
-- 
2.26.3

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [Intel-gfx] [PATCH i-g-t v3 2/9] lib/i915/gem_create: Add gem_create_ext
  2021-05-26 13:00 ` [igt-dev] " Matthew Auld
@ 2021-05-26 13:00   ` Matthew Auld
  -1 siblings, 0 replies; 20+ messages in thread
From: Matthew Auld @ 2021-05-26 13:00 UTC (permalink / raw)
  To: igt-dev; +Cc: Dominik Grzegorzek, intel-gfx, Chris P Wilson, Andrzej Turko

From: Andrzej Turko <andrzej.turko@linux.intel.com>

Add a wrapper for gem_create_ext ioctl (a version of gem_create that
accepts extensions). In preparation for the driver change implementing it,
a local definition of its id and necessary structs have been added,
which are to be erased as soon as those definitions
appear in the i915_drm.h file.

The new ioctl wrapper is added to a separate file.
For consistency the wrapper of the old ioctl, gem_create
is moved from ioctl_wrappers to gem_create.

Signed-off-by: Andrzej Turko <andrzej.turko@linux.intel.com>
Cc: Zbigniew Kempczynski <zbigniew.kempczynski@intel.com>
Cc: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Cc: Chris P Wilson <chris.p.wilson@intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Acked-by: Petri Latvala <petri.latvala@intel.com>
---
 benchmarks/gem_blt.c                    |  2 +-
 benchmarks/gem_busy.c                   |  2 +-
 benchmarks/gem_create.c                 |  2 +-
 benchmarks/gem_exec_ctx.c               |  2 +-
 benchmarks/gem_exec_fault.c             |  2 +-
 benchmarks/gem_exec_nop.c               |  2 +-
 benchmarks/gem_exec_reloc.c             |  2 +-
 benchmarks/gem_exec_trace.c             |  2 +-
 benchmarks/gem_latency.c                |  2 +-
 benchmarks/gem_prw.c                    |  2 +-
 benchmarks/gem_set_domain.c             |  2 +-
 benchmarks/gem_syslatency.c             |  2 +-
 benchmarks/gem_wsim.c                   |  2 +-
 benchmarks/prime_lookup.c               |  2 +-
 lib/i915/gem.h                          |  3 --
 lib/i915/gem_create.c                   | 43 ++++++++++++++++++++++++-
 lib/i915/gem_create.h                   | 19 +++++++++++
 lib/i915/gem_mman.c                     |  2 +-
 lib/i915/gem_ring.c                     |  1 +
 lib/i915/gem_submission.c               |  1 +
 lib/igt_draw.c                          |  2 +-
 lib/igt_dummyload.c                     |  2 +-
 lib/igt_fb.c                            |  2 +-
 lib/intel_batchbuffer.c                 |  2 +-
 lib/intel_bufops.c                      |  2 +-
 lib/ioctl_wrappers.c                    |  2 +-
 tests/amdgpu/amd_prime.c                |  1 +
 tests/core_hotunplug.c                  |  1 +
 tests/i915/api_intel_allocator.c        |  1 +
 tests/i915/api_intel_bb.c               |  1 +
 tests/i915/gem_bad_reloc.c              |  1 +
 tests/i915/gem_basic.c                  |  2 +-
 tests/i915/gem_blits.c                  |  1 +
 tests/i915/gem_busy.c                   |  1 +
 tests/i915/gem_close.c                  |  1 +
 tests/i915/gem_close_race.c             |  1 +
 tests/i915/gem_concurrent_all.c         |  1 +
 tests/i915/gem_create.c                 |  1 +
 tests/i915/gem_cs_tlb.c                 |  1 +
 tests/i915/gem_ctx_clone.c              |  1 +
 tests/i915/gem_ctx_create.c             |  1 +
 tests/i915/gem_ctx_engines.c            |  1 +
 tests/i915/gem_ctx_exec.c               |  1 +
 tests/i915/gem_ctx_isolation.c          |  1 +
 tests/i915/gem_ctx_param.c              |  1 +
 tests/i915/gem_ctx_shared.c             |  1 +
 tests/i915/gem_ctx_sseu.c               |  1 +
 tests/i915/gem_ctx_switch.c             |  1 +
 tests/i915/gem_eio.c                    |  1 +
 tests/i915/gem_evict_alignment.c        |  1 +
 tests/i915/gem_evict_everything.c       |  1 +
 tests/i915/gem_exec_alignment.c         |  1 +
 tests/i915/gem_exec_async.c             |  1 +
 tests/i915/gem_exec_await.c             |  1 +
 tests/i915/gem_exec_balancer.c          |  1 +
 tests/i915/gem_exec_basic.c             |  2 +-
 tests/i915/gem_exec_big.c               |  1 +
 tests/i915/gem_exec_capture.c           |  1 +
 tests/i915/gem_exec_create.c            |  1 +
 tests/i915/gem_exec_endless.c           |  1 +
 tests/i915/gem_exec_fair.c              |  1 +
 tests/i915/gem_exec_fence.c             |  1 +
 tests/i915/gem_exec_flush.c             |  1 +
 tests/i915/gem_exec_gttfill.c           |  1 +
 tests/i915/gem_exec_latency.c           |  1 +
 tests/i915/gem_exec_lut_handle.c        |  1 +
 tests/i915/gem_exec_nop.c               |  1 +
 tests/i915/gem_exec_parallel.c          |  1 +
 tests/i915/gem_exec_params.c            |  1 +
 tests/i915/gem_exec_reloc.c             |  1 +
 tests/i915/gem_exec_schedule.c          |  1 +
 tests/i915/gem_exec_store.c             |  1 +
 tests/i915/gem_exec_suspend.c           |  1 +
 tests/i915/gem_exec_whisper.c           |  1 +
 tests/i915/gem_fd_exhaustion.c          |  2 +-
 tests/i915/gem_fence_thrash.c           |  2 +-
 tests/i915/gem_fence_upload.c           |  2 +-
 tests/i915/gem_fenced_exec_thrash.c     |  1 +
 tests/i915/gem_flink_race.c             |  2 +-
 tests/i915/gem_gtt_cpu_tlb.c            |  2 +-
 tests/i915/gem_gtt_hog.c                |  1 +
 tests/i915/gem_gtt_speed.c              |  2 +-
 tests/i915/gem_huc_copy.c               |  1 +
 tests/i915/gem_linear_blits.c           |  1 +
 tests/i915/gem_lut_handle.c             |  2 +-
 tests/i915/gem_madvise.c                |  2 +-
 tests/i915/gem_mmap.c                   |  2 +-
 tests/i915/gem_mmap_gtt.c               |  1 +
 tests/i915/gem_mmap_offset.c            |  1 +
 tests/i915/gem_mmap_wc.c                |  2 +-
 tests/i915/gem_ppgtt.c                  |  1 +
 tests/i915/gem_pread.c                  |  2 +-
 tests/i915/gem_pwrite.c                 |  2 +-
 tests/i915/gem_readwrite.c              |  2 +-
 tests/i915/gem_reset_stats.c            |  1 +
 tests/i915/gem_ringfill.c               |  1 +
 tests/i915/gem_set_tiling_vs_gtt.c      |  2 +-
 tests/i915/gem_set_tiling_vs_pwrite.c   |  2 +-
 tests/i915/gem_shrink.c                 |  1 +
 tests/i915/gem_softpin.c                |  1 +
 tests/i915/gem_streaming_writes.c       |  1 +
 tests/i915/gem_sync.c                   |  1 +
 tests/i915/gem_tiled_fence_blits.c      |  1 +
 tests/i915/gem_tiled_pread_basic.c      |  2 +-
 tests/i915/gem_tiled_pread_pwrite.c     |  2 +-
 tests/i915/gem_tiled_swapping.c         |  2 +-
 tests/i915/gem_tiled_wb.c               |  2 +-
 tests/i915/gem_tiled_wc.c               |  2 +-
 tests/i915/gem_tiling_max_stride.c      |  2 +-
 tests/i915/gem_unfence_active_buffers.c |  1 +
 tests/i915/gem_unref_active_buffers.c   |  1 +
 tests/i915/gem_userptr_blits.c          |  1 +
 tests/i915/gem_vm_create.c              |  1 +
 tests/i915/gem_wait.c                   |  1 +
 tests/i915/gem_watchdog.c               |  1 +
 tests/i915/gem_workarounds.c            |  1 +
 tests/i915/gen3_mixed_blits.c           |  1 +
 tests/i915/gen3_render_linear_blits.c   |  1 +
 tests/i915/gen3_render_mixed_blits.c    |  1 +
 tests/i915/gen3_render_tiledx_blits.c   |  1 +
 tests/i915/gen3_render_tiledy_blits.c   |  1 +
 tests/i915/gen7_exec_parse.c            |  1 +
 tests/i915/gen9_exec_parse.c            |  1 +
 tests/i915/i915_hangman.c               |  1 +
 tests/i915/i915_module_load.c           |  2 +-
 tests/i915/i915_pm_rc6_residency.c      |  1 +
 tests/i915/i915_pm_rpm.c                |  1 +
 tests/i915/i915_suspend.c               |  1 +
 tests/i915/perf_pmu.c                   |  1 +
 tests/i915/sysfs_clients.c              |  1 +
 tests/i915/sysfs_timeslice_duration.c   |  1 +
 tests/kms_big_fb.c                      |  2 +-
 tests/kms_ccs.c                         |  2 +-
 tests/kms_flip.c                        |  2 +-
 tests/kms_frontbuffer_tracking.c        |  1 +
 tests/kms_getfb.c                       |  2 +-
 tests/prime_busy.c                      |  1 +
 tests/prime_mmap.c                      |  2 +-
 tests/prime_mmap_kms.c                  |  2 +-
 tests/prime_self_import.c               |  2 +-
 tests/prime_vgem.c                      |  1 +
 tools/intel_reg.c                       |  2 +-
 142 files changed, 200 insertions(+), 57 deletions(-)
 create mode 100644 lib/i915/gem_create.h

diff --git a/benchmarks/gem_blt.c b/benchmarks/gem_blt.c
index 34b82a87..424ce8e7 100644
--- a/benchmarks/gem_blt.c
+++ b/benchmarks/gem_blt.c
@@ -41,7 +41,7 @@
 #include <time.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 #define COPY_BLT_CMD		(2<<29|0x53<<22|0x6)
 #define BLT_WRITE_ALPHA		(1<<21)
diff --git a/benchmarks/gem_busy.c b/benchmarks/gem_busy.c
index 69be8c17..70885e25 100644
--- a/benchmarks/gem_busy.c
+++ b/benchmarks/gem_busy.c
@@ -45,7 +45,7 @@
 #include "intel_chipset.h"
 #include "intel_reg.h"
 #include "igt_stats.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_mman.h"
 
 #define ENGINE_FLAGS  (I915_EXEC_RING_MASK | I915_EXEC_BSD_MASK)
diff --git a/benchmarks/gem_create.c b/benchmarks/gem_create.c
index d4e297ed..7808f43a 100644
--- a/benchmarks/gem_create.c
+++ b/benchmarks/gem_create.c
@@ -40,7 +40,7 @@
 
 #include "drm.h"
 #include "drmtest.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt_aux.h"
 #include "igt_stats.h"
 #include "intel_reg.h"
diff --git a/benchmarks/gem_exec_ctx.c b/benchmarks/gem_exec_ctx.c
index b6f403fb..b0c62e4c 100644
--- a/benchmarks/gem_exec_ctx.c
+++ b/benchmarks/gem_exec_ctx.c
@@ -40,7 +40,7 @@
 
 #include "drm.h"
 #include "drmtest.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "intel_io.h"
 #include "intel_reg.h"
 #include "igt_stats.h"
diff --git a/benchmarks/gem_exec_fault.c b/benchmarks/gem_exec_fault.c
index a3a0992c..d53fab96 100644
--- a/benchmarks/gem_exec_fault.c
+++ b/benchmarks/gem_exec_fault.c
@@ -42,7 +42,7 @@
 
 #include "drm.h"
 #include "drmtest.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt_stats.h"
 #include "intel_io.h"
 #include "intel_reg.h"
diff --git a/benchmarks/gem_exec_nop.c b/benchmarks/gem_exec_nop.c
index c44d3454..9f8634a7 100644
--- a/benchmarks/gem_exec_nop.c
+++ b/benchmarks/gem_exec_nop.c
@@ -40,7 +40,7 @@
 
 #include "drm.h"
 #include "drmtest.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt_stats.h"
 #include "intel_io.h"
 #include "intel_reg.h"
diff --git a/benchmarks/gem_exec_reloc.c b/benchmarks/gem_exec_reloc.c
index abaf9345..dadc064f 100644
--- a/benchmarks/gem_exec_reloc.c
+++ b/benchmarks/gem_exec_reloc.c
@@ -38,7 +38,7 @@
 
 #include "drm.h"
 #include "drmtest.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_mman.h"
 #include "igt_debugfs.h"
 #include "intel_reg.h"
diff --git a/benchmarks/gem_exec_trace.c b/benchmarks/gem_exec_trace.c
index e37f6fb7..4263ccb0 100644
--- a/benchmarks/gem_exec_trace.c
+++ b/benchmarks/gem_exec_trace.c
@@ -41,7 +41,7 @@
 
 #include "drm.h"
 #include "drmtest.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt_stats.h"
 #include "intel_io.h"
 #include "ioctl_wrappers.h"
diff --git a/benchmarks/gem_latency.c b/benchmarks/gem_latency.c
index 9b3d22b7..cc8b3de5 100644
--- a/benchmarks/gem_latency.c
+++ b/benchmarks/gem_latency.c
@@ -43,7 +43,7 @@
 #include <sys/resource.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_device.h"
 
diff --git a/benchmarks/gem_prw.c b/benchmarks/gem_prw.c
index 5d3fda9a..c6f3e066 100644
--- a/benchmarks/gem_prw.c
+++ b/benchmarks/gem_prw.c
@@ -40,7 +40,7 @@
 
 #include "drm.h"
 #include "drmtest.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt_aux.h"
 #include "igt_stats.h"
 #include "ioctl_wrappers.h"
diff --git a/benchmarks/gem_set_domain.c b/benchmarks/gem_set_domain.c
index 1c9d797c..c92beea4 100644
--- a/benchmarks/gem_set_domain.c
+++ b/benchmarks/gem_set_domain.c
@@ -40,7 +40,7 @@
 
 #include "drm.h"
 #include "drmtest.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt_aux.h"
 #include "ioctl_wrappers.h"
 
diff --git a/benchmarks/gem_syslatency.c b/benchmarks/gem_syslatency.c
index c10d4f50..035ee934 100644
--- a/benchmarks/gem_syslatency.c
+++ b/benchmarks/gem_syslatency.c
@@ -44,7 +44,7 @@
 
 #include <linux/unistd.h>
 
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_ring.h"
 
 #define sigev_notify_thread_id _sigev_un._tid
diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c
index 1b66e63e..d1435222 100644
--- a/benchmarks/gem_wsim.c
+++ b/benchmarks/gem_wsim.c
@@ -56,7 +56,7 @@
 #include "igt_perf.h"
 #include "sw_sync.h"
 
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_engine_topology.h"
 #include "i915/gem_mman.h"
 
diff --git a/benchmarks/prime_lookup.c b/benchmarks/prime_lookup.c
index b1891756..9c885367 100644
--- a/benchmarks/prime_lookup.c
+++ b/benchmarks/prime_lookup.c
@@ -38,7 +38,7 @@
 
 #include "drm.h"
 #include "drmtest.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt_rand.h"
 #include "intel_io.h"
 #include "ioctl_wrappers.h"
diff --git a/lib/i915/gem.h b/lib/i915/gem.h
index bd23a277..feabac8d 100644
--- a/lib/i915/gem.h
+++ b/lib/i915/gem.h
@@ -32,7 +32,4 @@ void gem_quiescent_gpu(int i915);
 
 int gem_reopen_driver(int i915);
 
-int __gem_create(int fd, uint64_t *size, uint32_t *handle);
-uint32_t gem_create(int fd, uint64_t size);
-
 #endif /* I915_GEM_H */
diff --git a/lib/i915/gem_create.c b/lib/i915/gem_create.c
index a8c1a581..b2e8d559 100644
--- a/lib/i915/gem_create.c
+++ b/lib/i915/gem_create.c
@@ -5,7 +5,7 @@
 
 #include <errno.h>
 
-#include "gem.h"
+#include "gem_create.h"
 #include "i915_drm.h"
 #include "igt_core.h"
 #include "ioctl_wrappers.h"
@@ -47,3 +47,44 @@ uint32_t gem_create(int fd, uint64_t size)
 
 	return handle;
 }
+
+int __gem_create_ext(int fd, uint64_t *size, uint32_t *handle,
+		     struct i915_user_extension *ext)
+{
+	struct drm_i915_gem_create_ext create = {
+		.size = *size,
+		.extensions = to_user_pointer(ext),
+	};
+	int err = 0;
+
+	if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_CREATE_EXT, &create) == 0) {
+		*handle = create.handle;
+		*size = create.size;
+	} else {
+		err = -errno;
+		igt_assume(err != 0);
+	}
+
+	errno = 0;
+	return err;
+}
+
+/**
+ * gem_create_ext:
+ * @fd: open i915 drm file descriptor
+ * @size: desired size of the buffer
+ * @ext: optional extensions chain
+ *
+ * This wraps the GEM_CREATE_EXT ioctl, which allocates a new gem buffer object
+ * of @size.
+ *
+ * Returns: The file-private handle of the created buffer object
+ */
+uint32_t gem_create_ext(int fd, uint64_t size, struct i915_user_extension *ext)
+{
+	uint32_t handle;
+
+	igt_assert_eq(__gem_create_ext(fd, &size, &handle, ext), 0);
+
+	return handle;
+}
diff --git a/lib/i915/gem_create.h b/lib/i915/gem_create.h
new file mode 100644
index 00000000..c2b531b4
--- /dev/null
+++ b/lib/i915/gem_create.h
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: MIT
+/*
+ * Copyright © 2021 Intel Corporation
+ */
+
+#ifndef GEM_CREATE_H
+#define GEM_CREATE_H
+
+#include <stdint.h>
+
+#include "i915_drm.h"
+
+int __gem_create(int fd, uint64_t *size, uint32_t *handle);
+uint32_t gem_create(int fd, uint64_t size);
+int __gem_create_ext(int fd, uint64_t *size, uint32_t *handle,
+                     struct i915_user_extension *ext);
+uint32_t gem_create_ext(int fd, uint64_t size, struct i915_user_extension *ext);
+
+#endif /* GEM_CREATE_H */
diff --git a/lib/i915/gem_mman.c b/lib/i915/gem_mman.c
index ab04cbec..300ca13d 100644
--- a/lib/i915/gem_mman.c
+++ b/lib/i915/gem_mman.c
@@ -31,7 +31,7 @@
 #include "ioctl_wrappers.h"
 #include "intel_chipset.h"
 
-#include "gem.h"
+#include "gem_create.h"
 #include "gem_mman.h"
 
 #ifdef HAVE_VALGRIND
diff --git a/lib/i915/gem_ring.c b/lib/i915/gem_ring.c
index f224e822..6d28b5d9 100644
--- a/lib/i915/gem_ring.c
+++ b/lib/i915/gem_ring.c
@@ -27,6 +27,7 @@
 #include <sys/time.h>
 
 #include "gem.h"
+#include "gem_create.h"
 #include "gem_ring.h"
 #include "gem_submission.h"
 
diff --git a/lib/i915/gem_submission.c b/lib/i915/gem_submission.c
index 051f9d04..bd4bbb3e 100644
--- a/lib/i915/gem_submission.c
+++ b/lib/i915/gem_submission.c
@@ -31,6 +31,7 @@
 #include <i915_drm.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_engine_topology.h"
 #include "i915/gem_submission.h"
 
diff --git a/lib/igt_draw.c b/lib/igt_draw.c
index 949c0d77..a3144b50 100644
--- a/lib/igt_draw.c
+++ b/lib/igt_draw.c
@@ -34,7 +34,7 @@
 #include "igt_fb.h"
 #include "ioctl_wrappers.h"
 #include "i830_reg.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_mman.h"
 
 #ifndef PAGE_ALIGN
diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
index 34ad9221..1a3abb5d 100644
--- a/lib/igt_dummyload.c
+++ b/lib/igt_dummyload.c
@@ -31,7 +31,7 @@
 #include <i915_drm.h>
 
 #include "drmtest.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_engine_topology.h"
 #include "i915/gem_mman.h"
 #include "i915/gem_submission.h"
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index f8f02766..3e6841fd 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -33,7 +33,7 @@
 #include <pixman.h>
 
 #include "drmtest.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_mman.h"
 #include "igt_aux.h"
 #include "igt_color_encoding.h"
diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index 0b2c5b21..cc976a62 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -35,7 +35,7 @@
 
 #include "drm.h"
 #include "drmtest.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "intel_batchbuffer.h"
 #include "intel_bufmgr.h"
 #include "intel_bufops.h"
diff --git a/lib/intel_bufops.c b/lib/intel_bufops.c
index 5dece576..3ce68663 100644
--- a/lib/intel_bufops.c
+++ b/lib/intel_bufops.c
@@ -25,7 +25,7 @@
 #include <sys/ioctl.h>
 #include <cairo.h>
 
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_x86.h"
 #include "intel_bufops.h"
diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
index 4440004c..0c1b5e32 100644
--- a/lib/ioctl_wrappers.c
+++ b/lib/ioctl_wrappers.c
@@ -49,7 +49,7 @@
 
 #include "drmtest.h"
 #include "i915_drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "intel_batchbuffer.h"
 #include "intel_chipset.h"
 #include "intel_io.h"
diff --git a/tests/amdgpu/amd_prime.c b/tests/amdgpu/amd_prime.c
index 537b0bcd..3e5cc1a7 100644
--- a/tests/amdgpu/amd_prime.c
+++ b/tests/amdgpu/amd_prime.c
@@ -27,6 +27,7 @@
 #include <sys/poll.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_vgem.h"
 
diff --git a/tests/core_hotunplug.c b/tests/core_hotunplug.c
index e6079fa3..a639cfb4 100644
--- a/tests/core_hotunplug.c
+++ b/tests/core_hotunplug.c
@@ -31,6 +31,7 @@
 #include <unistd.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/perf.h"
 #include "igt.h"
 #include "igt_device_scan.h"
diff --git a/tests/i915/api_intel_allocator.c b/tests/i915/api_intel_allocator.c
index 182d9ba7..ea4ba8bb 100644
--- a/tests/i915/api_intel_allocator.c
+++ b/tests/i915/api_intel_allocator.c
@@ -5,6 +5,7 @@
 
 #include <stdatomic.h>
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_aux.h"
 #include "intel_allocator.h"
diff --git a/tests/i915/api_intel_bb.c b/tests/i915/api_intel_bb.c
index eafa856d..7ffe64fc 100644
--- a/tests/i915/api_intel_bb.c
+++ b/tests/i915/api_intel_bb.c
@@ -23,6 +23,7 @@
 
 #include "igt.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
diff --git a/tests/i915/gem_bad_reloc.c b/tests/i915/gem_bad_reloc.c
index 3d4834bc..3ca0f345 100644
--- a/tests/i915/gem_bad_reloc.c
+++ b/tests/i915/gem_bad_reloc.c
@@ -39,6 +39,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 
 IGT_TEST_DESCRIPTION("Simulates SNA behaviour using negative self-relocations"
diff --git a/tests/i915/gem_basic.c b/tests/i915/gem_basic.c
index 984bdf60..13ecce52 100644
--- a/tests/i915/gem_basic.c
+++ b/tests/i915/gem_basic.c
@@ -37,7 +37,7 @@
 #include <sys/ioctl.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 static void
 test_bad_close(int fd)
diff --git a/tests/i915/gem_blits.c b/tests/i915/gem_blits.c
index 6ed9b60e..21dcee68 100644
--- a/tests/i915/gem_blits.c
+++ b/tests/i915/gem_blits.c
@@ -23,6 +23,7 @@
  */
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_x86.h"
 
diff --git a/tests/i915/gem_busy.c b/tests/i915/gem_busy.c
index 77a55101..dc481f3c 100644
--- a/tests/i915/gem_busy.c
+++ b/tests/i915/gem_busy.c
@@ -26,6 +26,7 @@
 #include <sys/ioctl.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_rand.h"
 #include "igt_vgem.h"
diff --git a/tests/i915/gem_close.c b/tests/i915/gem_close.c
index 58f2d4b3..ee2d690b 100644
--- a/tests/i915/gem_close.c
+++ b/tests/i915/gem_close.c
@@ -22,6 +22,7 @@
  */
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 
 static int batch_create(int fd)
diff --git a/tests/i915/gem_close_race.c b/tests/i915/gem_close_race.c
index 06b80100..ab444945 100644
--- a/tests/i915/gem_close_race.c
+++ b/tests/i915/gem_close_race.c
@@ -42,6 +42,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 
 #define OBJECT_SIZE (256 * 1024)
diff --git a/tests/i915/gem_concurrent_all.c b/tests/i915/gem_concurrent_all.c
index a422a449..d0f9b62e 100644
--- a/tests/i915/gem_concurrent_all.c
+++ b/tests/i915/gem_concurrent_all.c
@@ -49,6 +49,7 @@
 #include <drm.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_vgem.h"
 
diff --git a/tests/i915/gem_create.c b/tests/i915/gem_create.c
index ce985053..8acc2f52 100644
--- a/tests/i915/gem_create.c
+++ b/tests/i915/gem_create.c
@@ -54,6 +54,7 @@
 #include "igt_dummyload.h"
 #include "igt_x86.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_engine_topology.h"
 #include "i915/gem_mman.h"
 #include "i915_drm.h"
diff --git a/tests/i915/gem_cs_tlb.c b/tests/i915/gem_cs_tlb.c
index f72879c3..dec9c107 100644
--- a/tests/i915/gem_cs_tlb.c
+++ b/tests/i915/gem_cs_tlb.c
@@ -50,6 +50,7 @@
 #include <drm.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 
 IGT_TEST_DESCRIPTION("Check whether we correctly invalidate the cs tlb.");
diff --git a/tests/i915/gem_ctx_clone.c b/tests/i915/gem_ctx_clone.c
index b72269bc..225e801b 100644
--- a/tests/i915/gem_ctx_clone.c
+++ b/tests/i915/gem_ctx_clone.c
@@ -22,6 +22,7 @@
  */
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_vm.h"
 #include "i915_drm.h"
 #include "igt.h"
diff --git a/tests/i915/gem_ctx_create.c b/tests/i915/gem_ctx_create.c
index 9a512a03..5b14f7af 100644
--- a/tests/i915/gem_ctx_create.c
+++ b/tests/i915/gem_ctx_create.c
@@ -31,6 +31,7 @@
 #include <time.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_rand.h"
 #include "sw_sync.h"
diff --git a/tests/i915/gem_ctx_engines.c b/tests/i915/gem_ctx_engines.c
index 643a0b2f..02658c4f 100644
--- a/tests/i915/gem_ctx_engines.c
+++ b/tests/i915/gem_ctx_engines.c
@@ -39,6 +39,7 @@
 
 #include "i915/gem.h"
 #include "i915/gem_context.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "sw_sync.h"
 
diff --git a/tests/i915/gem_ctx_exec.c b/tests/i915/gem_ctx_exec.c
index 89776185..2e72bf71 100644
--- a/tests/i915/gem_ctx_exec.c
+++ b/tests/i915/gem_ctx_exec.c
@@ -41,6 +41,7 @@
 #include <drm.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_dummyload.h"
 #include "igt_rand.h"
diff --git a/tests/i915/gem_ctx_isolation.c b/tests/i915/gem_ctx_isolation.c
index 4f174268..4277df34 100644
--- a/tests/i915/gem_ctx_isolation.c
+++ b/tests/i915/gem_ctx_isolation.c
@@ -22,6 +22,7 @@
  */
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_dummyload.h"
 
diff --git a/tests/i915/gem_ctx_param.c b/tests/i915/gem_ctx_param.c
index ab0e3007..c024fe60 100644
--- a/tests/i915/gem_ctx_param.c
+++ b/tests/i915/gem_ctx_param.c
@@ -29,6 +29,7 @@
 
 #include "igt.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_vm.h"
 
 IGT_TEST_DESCRIPTION("Basic test for context set/get param input validation.");
diff --git a/tests/i915/gem_ctx_shared.c b/tests/i915/gem_ctx_shared.c
index 6b21994d..c7e957c4 100644
--- a/tests/i915/gem_ctx_shared.c
+++ b/tests/i915/gem_ctx_shared.c
@@ -38,6 +38,7 @@
 #include <drm.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_engine_topology.h"
 #include "igt.h"
 #include "igt_rand.h"
diff --git a/tests/i915/gem_ctx_sseu.c b/tests/i915/gem_ctx_sseu.c
index 749ce336..7685511f 100644
--- a/tests/i915/gem_ctx_sseu.c
+++ b/tests/i915/gem_ctx_sseu.c
@@ -37,6 +37,7 @@
 #include <sys/wait.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt.h"
 #include "igt_dummyload.h"
diff --git a/tests/i915/gem_ctx_switch.c b/tests/i915/gem_ctx_switch.c
index 6208dacd..44c659f0 100644
--- a/tests/i915/gem_ctx_switch.c
+++ b/tests/i915/gem_ctx_switch.c
@@ -41,6 +41,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_ring.h"
 #include "igt.h"
 
diff --git a/tests/i915/gem_eio.c b/tests/i915/gem_eio.c
index d86ccf2b..25d109d6 100644
--- a/tests/i915/gem_eio.c
+++ b/tests/i915/gem_eio.c
@@ -43,6 +43,7 @@
 #include <drm.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_ring.h"
 #include "igt.h"
 #include "igt_device.h"
diff --git a/tests/i915/gem_evict_alignment.c b/tests/i915/gem_evict_alignment.c
index d4a5877a..e5176b9b 100644
--- a/tests/i915/gem_evict_alignment.c
+++ b/tests/i915/gem_evict_alignment.c
@@ -45,6 +45,7 @@
 #include <drm.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 
 IGT_TEST_DESCRIPTION("Run a couple of big batches to force the unbind on"
diff --git a/tests/i915/gem_evict_everything.c b/tests/i915/gem_evict_everything.c
index 5d4d15c4..37343b53 100644
--- a/tests/i915/gem_evict_everything.c
+++ b/tests/i915/gem_evict_everything.c
@@ -44,6 +44,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 
 #include "eviction_common.c"
diff --git a/tests/i915/gem_exec_alignment.c b/tests/i915/gem_exec_alignment.c
index 7bbd2a8f..c4611bd1 100644
--- a/tests/i915/gem_exec_alignment.c
+++ b/tests/i915/gem_exec_alignment.c
@@ -42,6 +42,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 
 IGT_TEST_DESCRIPTION("Exercises the basic execbuffer using object alignments");
diff --git a/tests/i915/gem_exec_async.c b/tests/i915/gem_exec_async.c
index 412ad737..bf8a856a 100644
--- a/tests/i915/gem_exec_async.c
+++ b/tests/i915/gem_exec_async.c
@@ -22,6 +22,7 @@
  */
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 
 IGT_TEST_DESCRIPTION("Check that we can issue concurrent writes across the engines.");
diff --git a/tests/i915/gem_exec_await.c b/tests/i915/gem_exec_await.c
index e64d2a94..6db30695 100644
--- a/tests/i915/gem_exec_await.c
+++ b/tests/i915/gem_exec_await.c
@@ -26,6 +26,7 @@
 #include <sys/signal.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_rand.h"
 #include "igt_sysfs.h"
diff --git a/tests/i915/gem_exec_balancer.c b/tests/i915/gem_exec_balancer.c
index 01db0e11..12cb55ab 100644
--- a/tests/i915/gem_exec_balancer.c
+++ b/tests/i915/gem_exec_balancer.c
@@ -27,6 +27,7 @@
 #include <sys/signal.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_gt.h"
 #include "igt_perf.h"
diff --git a/tests/i915/gem_exec_basic.c b/tests/i915/gem_exec_basic.c
index 31f6a234..5021852f 100644
--- a/tests/i915/gem_exec_basic.c
+++ b/tests/i915/gem_exec_basic.c
@@ -23,7 +23,7 @@
 
 #include "igt.h"
 
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION("Basic sanity check of execbuf-ioctl rings.");
 
diff --git a/tests/i915/gem_exec_big.c b/tests/i915/gem_exec_big.c
index 63de42d5..1f8c720b 100644
--- a/tests/i915/gem_exec_big.c
+++ b/tests/i915/gem_exec_big.c
@@ -46,6 +46,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 
 IGT_TEST_DESCRIPTION("Run a large nop batch to stress test the error capture"
diff --git a/tests/i915/gem_exec_capture.c b/tests/i915/gem_exec_capture.c
index 3da78d63..a6b3d987 100644
--- a/tests/i915/gem_exec_capture.c
+++ b/tests/i915/gem_exec_capture.c
@@ -25,6 +25,7 @@
 #include <zlib.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_device.h"
 #include "igt_rand.h"
diff --git a/tests/i915/gem_exec_create.c b/tests/i915/gem_exec_create.c
index 6529da7e..8556cb21 100644
--- a/tests/i915/gem_exec_create.c
+++ b/tests/i915/gem_exec_create.c
@@ -40,6 +40,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_ring.h"
 #include "igt.h"
 
diff --git a/tests/i915/gem_exec_endless.c b/tests/i915/gem_exec_endless.c
index 1b320d4c..e7d4b56c 100644
--- a/tests/i915/gem_exec_endless.c
+++ b/tests/i915/gem_exec_endless.c
@@ -24,6 +24,7 @@
 #include <sys/ioctl.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_device.h"
 #include "igt_sysfs.h"
diff --git a/tests/i915/gem_exec_fair.c b/tests/i915/gem_exec_fair.c
index c1a71f77..628f4df2 100644
--- a/tests/i915/gem_exec_fair.c
+++ b/tests/i915/gem_exec_fair.c
@@ -18,6 +18,7 @@
 #include "sync_file.h"
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_rand.h"
 #include "igt_rapl.h"
diff --git a/tests/i915/gem_exec_fence.c b/tests/i915/gem_exec_fence.c
index b7b3f8e3..70bb0011 100644
--- a/tests/i915/gem_exec_fence.c
+++ b/tests/i915/gem_exec_fence.c
@@ -26,6 +26,7 @@
 #include <sys/signal.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_syncobj.h"
 #include "igt_sysfs.h"
diff --git a/tests/i915/gem_exec_flush.c b/tests/i915/gem_exec_flush.c
index a2cac71a..629fdd7a 100644
--- a/tests/i915/gem_exec_flush.c
+++ b/tests/i915/gem_exec_flush.c
@@ -24,6 +24,7 @@
 #include <time.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_ring.h"
 #include "igt.h"
 #include "igt_x86.h"
diff --git a/tests/i915/gem_exec_gttfill.c b/tests/i915/gem_exec_gttfill.c
index c0e27c9b..e711576f 100644
--- a/tests/i915/gem_exec_gttfill.c
+++ b/tests/i915/gem_exec_gttfill.c
@@ -22,6 +22,7 @@
  */
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_rand.h"
 
diff --git a/tests/i915/gem_exec_latency.c b/tests/i915/gem_exec_latency.c
index 8ba924b8..158faee5 100644
--- a/tests/i915/gem_exec_latency.c
+++ b/tests/i915/gem_exec_latency.c
@@ -47,6 +47,7 @@
 #include "igt_stats.h"
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 
 #define ENGINE_FLAGS  (I915_EXEC_RING_MASK | I915_EXEC_BSD_MASK)
 
diff --git a/tests/i915/gem_exec_lut_handle.c b/tests/i915/gem_exec_lut_handle.c
index e642686d..3c5c81f1 100644
--- a/tests/i915/gem_exec_lut_handle.c
+++ b/tests/i915/gem_exec_lut_handle.c
@@ -38,6 +38,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 
 IGT_TEST_DESCRIPTION("Exercises the basic execbuffer using the handle LUT"
diff --git a/tests/i915/gem_exec_nop.c b/tests/i915/gem_exec_nop.c
index 62554ecb..acdf6bde 100644
--- a/tests/i915/gem_exec_nop.c
+++ b/tests/i915/gem_exec_nop.c
@@ -41,6 +41,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_device.h"
 #include "igt_rand.h"
diff --git a/tests/i915/gem_exec_parallel.c b/tests/i915/gem_exec_parallel.c
index c9cf9d7a..11cea5d7 100644
--- a/tests/i915/gem_exec_parallel.c
+++ b/tests/i915/gem_exec_parallel.c
@@ -30,6 +30,7 @@
 #include <pthread.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_gt.h"
 
diff --git a/tests/i915/gem_exec_params.c b/tests/i915/gem_exec_params.c
index 6840cf40..6ab1ab11 100644
--- a/tests/i915/gem_exec_params.c
+++ b/tests/i915/gem_exec_params.c
@@ -39,6 +39,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_ring.h"
 #include "igt.h"
 #include "igt_device.h"
diff --git a/tests/i915/gem_exec_reloc.c b/tests/i915/gem_exec_reloc.c
index 397c335e..c79400fb 100644
--- a/tests/i915/gem_exec_reloc.c
+++ b/tests/i915/gem_exec_reloc.c
@@ -25,6 +25,7 @@
 #include <sys/ioctl.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_device.h"
 #include "igt_dummyload.h"
diff --git a/tests/i915/gem_exec_schedule.c b/tests/i915/gem_exec_schedule.c
index 9585059d..6147ff96 100644
--- a/tests/i915/gem_exec_schedule.c
+++ b/tests/i915/gem_exec_schedule.c
@@ -35,6 +35,7 @@
 #include <unistd.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_rand.h"
 #include "igt_rapl.h"
diff --git a/tests/i915/gem_exec_store.c b/tests/i915/gem_exec_store.c
index 771ee169..99ffc9ab 100644
--- a/tests/i915/gem_exec_store.c
+++ b/tests/i915/gem_exec_store.c
@@ -30,6 +30,7 @@
 #include <strings.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_device.h"
 #include "igt_gt.h"
diff --git a/tests/i915/gem_exec_suspend.c b/tests/i915/gem_exec_suspend.c
index b6558a14..d13c443e 100644
--- a/tests/i915/gem_exec_suspend.c
+++ b/tests/i915/gem_exec_suspend.c
@@ -31,6 +31,7 @@
 #include <unistd.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_dummyload.h"
 #include "igt_gt.h"
diff --git a/tests/i915/gem_exec_whisper.c b/tests/i915/gem_exec_whisper.c
index 71bd610c..a9d3fa05 100644
--- a/tests/i915/gem_exec_whisper.c
+++ b/tests/i915/gem_exec_whisper.c
@@ -28,6 +28,7 @@
  */
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_debugfs.h"
 #include "igt_rapl.h"
diff --git a/tests/i915/gem_fd_exhaustion.c b/tests/i915/gem_fd_exhaustion.c
index 13e8a23a..a6463685 100644
--- a/tests/i915/gem_fd_exhaustion.c
+++ b/tests/i915/gem_fd_exhaustion.c
@@ -33,7 +33,7 @@
 #include <fcntl.h>
 #include <limits.h>
 
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 igt_simple_main
 {
diff --git a/tests/i915/gem_fence_thrash.c b/tests/i915/gem_fence_thrash.c
index 872dc554..89a5ae29 100644
--- a/tests/i915/gem_fence_thrash.c
+++ b/tests/i915/gem_fence_thrash.c
@@ -40,7 +40,7 @@
 #include <pthread.h>
 #include "drm.h"
 
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_x86.h"
 
diff --git a/tests/i915/gem_fence_upload.c b/tests/i915/gem_fence_upload.c
index 87ed1edf..67487d67 100644
--- a/tests/i915/gem_fence_upload.c
+++ b/tests/i915/gem_fence_upload.c
@@ -40,7 +40,7 @@
 
 #include "drm.h"
 #include "i915_drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 #define OBJECT_SIZE (1024*1024) /* restricted to 1MiB alignment on i915 fences */
 
diff --git a/tests/i915/gem_fenced_exec_thrash.c b/tests/i915/gem_fenced_exec_thrash.c
index b577a04f..13812bb7 100644
--- a/tests/i915/gem_fenced_exec_thrash.c
+++ b/tests/i915/gem_fenced_exec_thrash.c
@@ -31,6 +31,7 @@
 #include <errno.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 
 IGT_TEST_DESCRIPTION("Test execbuf fence accounting.");
diff --git a/tests/i915/gem_flink_race.c b/tests/i915/gem_flink_race.c
index 58431b36..70e133d7 100644
--- a/tests/i915/gem_flink_race.c
+++ b/tests/i915/gem_flink_race.c
@@ -32,7 +32,7 @@
 #include <pthread.h>
 #include <errno.h>
 
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_stats.h"
 
diff --git a/tests/i915/gem_gtt_cpu_tlb.c b/tests/i915/gem_gtt_cpu_tlb.c
index 07f8f1a3..8000e58c 100644
--- a/tests/i915/gem_gtt_cpu_tlb.c
+++ b/tests/i915/gem_gtt_cpu_tlb.c
@@ -42,7 +42,7 @@
 #include <sys/ioctl.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION("Check whether gtt tlbs for cpu access are correctly"
 		     " invalidated.");
diff --git a/tests/i915/gem_gtt_hog.c b/tests/i915/gem_gtt_hog.c
index 1372245b..15a6139e 100644
--- a/tests/i915/gem_gtt_hog.c
+++ b/tests/i915/gem_gtt_hog.c
@@ -40,6 +40,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 
 static const uint32_t canary = 0xdeadbeef;
diff --git a/tests/i915/gem_gtt_speed.c b/tests/i915/gem_gtt_speed.c
index 644af3d3..272091fd 100644
--- a/tests/i915/gem_gtt_speed.c
+++ b/tests/i915/gem_gtt_speed.c
@@ -41,7 +41,7 @@
 #include <sys/time.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 #define OBJECT_SIZE 16384
 
diff --git a/tests/i915/gem_huc_copy.c b/tests/i915/gem_huc_copy.c
index 5954d34e..9a32893e 100644
--- a/tests/i915/gem_huc_copy.c
+++ b/tests/i915/gem_huc_copy.c
@@ -34,6 +34,7 @@
 #include <sys/time.h>
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION("A very simple workload for the HuC.");
 
diff --git a/tests/i915/gem_linear_blits.c b/tests/i915/gem_linear_blits.c
index 7b7cf05a..6504c9f2 100644
--- a/tests/i915/gem_linear_blits.c
+++ b/tests/i915/gem_linear_blits.c
@@ -45,6 +45,7 @@
 #include <drm.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 
 IGT_TEST_DESCRIPTION("Test doing many blits with a working set larger than the"
diff --git a/tests/i915/gem_lut_handle.c b/tests/i915/gem_lut_handle.c
index f14a9bda..64dbb87c 100644
--- a/tests/i915/gem_lut_handle.c
+++ b/tests/i915/gem_lut_handle.c
@@ -38,7 +38,7 @@
 #include <sys/time.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION("Exercises the basic execbuffer using the handle LUT"
 		     " interface.");
diff --git a/tests/i915/gem_madvise.c b/tests/i915/gem_madvise.c
index d772d3ab..d88747a9 100644
--- a/tests/i915/gem_madvise.c
+++ b/tests/i915/gem_madvise.c
@@ -37,7 +37,7 @@
 #include <signal.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION("Checks that the kernel reports EFAULT when trying to use"
 		     " purged bo.");
diff --git a/tests/i915/gem_mmap.c b/tests/i915/gem_mmap.c
index 7c36571c..d12a4c0b 100644
--- a/tests/i915/gem_mmap.c
+++ b/tests/i915/gem_mmap.c
@@ -37,7 +37,7 @@
 #include <sys/ioctl.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 #define OBJECT_SIZE 16384
 #define PAGE_SIZE 4096
diff --git a/tests/i915/gem_mmap_gtt.c b/tests/i915/gem_mmap_gtt.c
index 528a7c72..cbfa222a 100644
--- a/tests/i915/gem_mmap_gtt.c
+++ b/tests/i915/gem_mmap_gtt.c
@@ -42,6 +42,7 @@
 #include "drm.h"
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_sysfs.h"
 #include "igt_x86.h"
diff --git a/tests/i915/gem_mmap_offset.c b/tests/i915/gem_mmap_offset.c
index 95c934db..f1ba67b7 100644
--- a/tests/i915/gem_mmap_offset.c
+++ b/tests/i915/gem_mmap_offset.c
@@ -32,6 +32,7 @@
 #include "drm.h"
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_x86.h"
 
diff --git a/tests/i915/gem_mmap_wc.c b/tests/i915/gem_mmap_wc.c
index 4a2192b3..7130a510 100644
--- a/tests/i915/gem_mmap_wc.c
+++ b/tests/i915/gem_mmap_wc.c
@@ -38,7 +38,7 @@
 #include <sys/ioctl.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 struct local_i915_gem_mmap_v2 {
 	uint32_t handle;
diff --git a/tests/i915/gem_ppgtt.c b/tests/i915/gem_ppgtt.c
index da83484a..4c9691e3 100644
--- a/tests/i915/gem_ppgtt.c
+++ b/tests/i915/gem_ppgtt.c
@@ -36,6 +36,7 @@
 #include <drm.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_debugfs.h"
 
diff --git a/tests/i915/gem_pread.c b/tests/i915/gem_pread.c
index ec9991ee..a8bf2b05 100644
--- a/tests/i915/gem_pread.c
+++ b/tests/i915/gem_pread.c
@@ -43,7 +43,7 @@
 #include <pthread.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt_vgem.h"
 
 #define MiB(x) ((x) * 1024 * 1024)
diff --git a/tests/i915/gem_pwrite.c b/tests/i915/gem_pwrite.c
index 5fd15e6a..e8e8c7ad 100644
--- a/tests/i915/gem_pwrite.c
+++ b/tests/i915/gem_pwrite.c
@@ -42,7 +42,7 @@
 #include <sys/time.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_rand.h"
 #include "igt_vgem.h"
diff --git a/tests/i915/gem_readwrite.c b/tests/i915/gem_readwrite.c
index 8a958cc9..2d437dec 100644
--- a/tests/i915/gem_readwrite.c
+++ b/tests/i915/gem_readwrite.c
@@ -37,7 +37,7 @@
 #include <sys/ioctl.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 #define OBJECT_SIZE 16384
 
diff --git a/tests/i915/gem_reset_stats.c b/tests/i915/gem_reset_stats.c
index e1feecb6..627a10ab 100644
--- a/tests/i915/gem_reset_stats.c
+++ b/tests/i915/gem_reset_stats.c
@@ -41,6 +41,7 @@
 #include <signal.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_ring.h"
 #include "igt.h"
 #include "igt_sysfs.h"
diff --git a/tests/i915/gem_ringfill.c b/tests/i915/gem_ringfill.c
index 78903707..9ad97532 100644
--- a/tests/i915/gem_ringfill.c
+++ b/tests/i915/gem_ringfill.c
@@ -32,6 +32,7 @@
  */
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_ring.h"
 #include "igt.h"
 #include "igt_device.h"
diff --git a/tests/i915/gem_set_tiling_vs_gtt.c b/tests/i915/gem_set_tiling_vs_gtt.c
index f09022c6..2f890e83 100644
--- a/tests/i915/gem_set_tiling_vs_gtt.c
+++ b/tests/i915/gem_set_tiling_vs_gtt.c
@@ -37,7 +37,7 @@
 #include <sys/ioctl.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION("Check set_tiling vs gtt mmap coherency.");
 
diff --git a/tests/i915/gem_set_tiling_vs_pwrite.c b/tests/i915/gem_set_tiling_vs_pwrite.c
index 87909d3c..6bec7f27 100644
--- a/tests/i915/gem_set_tiling_vs_pwrite.c
+++ b/tests/i915/gem_set_tiling_vs_pwrite.c
@@ -37,7 +37,7 @@
 #include <sys/ioctl.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION("Check set_tiling vs pwrite coherency.");
 
diff --git a/tests/i915/gem_shrink.c b/tests/i915/gem_shrink.c
index 2269da49..b6450a6f 100644
--- a/tests/i915/gem_shrink.c
+++ b/tests/i915/gem_shrink.c
@@ -28,6 +28,7 @@
  */
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_gt.h"
 #include "igt_debugfs.h"
diff --git a/tests/i915/gem_softpin.c b/tests/i915/gem_softpin.c
index c3bfd10a..bdb04821 100644
--- a/tests/i915/gem_softpin.c
+++ b/tests/i915/gem_softpin.c
@@ -27,6 +27,7 @@
  */
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "intel_allocator.h"
 
diff --git a/tests/i915/gem_streaming_writes.c b/tests/i915/gem_streaming_writes.c
index b18ff848..c104792b 100644
--- a/tests/i915/gem_streaming_writes.c
+++ b/tests/i915/gem_streaming_writes.c
@@ -38,6 +38,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 
 #define OBJECT_SIZE 1024*1024
diff --git a/tests/i915/gem_sync.c b/tests/i915/gem_sync.c
index 6ad31517..e1b3ab7d 100644
--- a/tests/i915/gem_sync.c
+++ b/tests/i915/gem_sync.c
@@ -25,6 +25,7 @@
 #include <pthread.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_ring.h"
 #include "igt_debugfs.h"
 #include "igt_dummyload.h"
diff --git a/tests/i915/gem_tiled_fence_blits.c b/tests/i915/gem_tiled_fence_blits.c
index 28beea89..6ce3a38d 100644
--- a/tests/i915/gem_tiled_fence_blits.c
+++ b/tests/i915/gem_tiled_fence_blits.c
@@ -42,6 +42,7 @@
  */
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_x86.h"
 
diff --git a/tests/i915/gem_tiled_pread_basic.c b/tests/i915/gem_tiled_pread_basic.c
index 186f630f..2b4cec6e 100644
--- a/tests/i915/gem_tiled_pread_basic.c
+++ b/tests/i915/gem_tiled_pread_basic.c
@@ -47,7 +47,7 @@
 #include <sys/ioctl.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION("Test pread behavior on tiled objects with respect to the"
 		     " reported swizzling value.");
diff --git a/tests/i915/gem_tiled_pread_pwrite.c b/tests/i915/gem_tiled_pread_pwrite.c
index ef1e1b3c..f77cd3bd 100644
--- a/tests/i915/gem_tiled_pread_pwrite.c
+++ b/tests/i915/gem_tiled_pread_pwrite.c
@@ -57,7 +57,7 @@
 #include <sys/ioctl.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION("Test swizzling by testing pwrite does the inverse of"
 		     " pread.");
diff --git a/tests/i915/gem_tiled_swapping.c b/tests/i915/gem_tiled_swapping.c
index 1bcf2fa4..d33b76db 100644
--- a/tests/i915/gem_tiled_swapping.c
+++ b/tests/i915/gem_tiled_swapping.c
@@ -57,7 +57,7 @@
 #include <pthread.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION("Exercise swizzle code for swapping.");
 
diff --git a/tests/i915/gem_tiled_wb.c b/tests/i915/gem_tiled_wb.c
index 2ba424e8..e9efbdf2 100644
--- a/tests/i915/gem_tiled_wb.c
+++ b/tests/i915/gem_tiled_wb.c
@@ -44,7 +44,7 @@
 #include <sys/ioctl.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION("This is a test of write-combining mmap's behavior on"
 		     " tiled objects with respect to the reported swizzling"
diff --git a/tests/i915/gem_tiled_wc.c b/tests/i915/gem_tiled_wc.c
index 898aad40..29ea700e 100644
--- a/tests/i915/gem_tiled_wc.c
+++ b/tests/i915/gem_tiled_wc.c
@@ -44,7 +44,7 @@
 #include <sys/ioctl.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 #define WIDTH 512
 #define HEIGHT 512
diff --git a/tests/i915/gem_tiling_max_stride.c b/tests/i915/gem_tiling_max_stride.c
index 4a273441..513d579d 100644
--- a/tests/i915/gem_tiling_max_stride.c
+++ b/tests/i915/gem_tiling_max_stride.c
@@ -38,7 +38,7 @@
 #include <sys/ioctl.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION("Check that max fence stride works.");
 
diff --git a/tests/i915/gem_unfence_active_buffers.c b/tests/i915/gem_unfence_active_buffers.c
index 887d6177..2c9cebb6 100644
--- a/tests/i915/gem_unfence_active_buffers.c
+++ b/tests/i915/gem_unfence_active_buffers.c
@@ -50,6 +50,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 
 IGT_TEST_DESCRIPTION("Check for use-after-free in the fence stealing code.");
diff --git a/tests/i915/gem_unref_active_buffers.c b/tests/i915/gem_unref_active_buffers.c
index e4a82360..731190b3 100644
--- a/tests/i915/gem_unref_active_buffers.c
+++ b/tests/i915/gem_unref_active_buffers.c
@@ -40,6 +40,7 @@
 
 #include "igt.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION("Test unreferencing of active buffers.");
 
diff --git a/tests/i915/gem_userptr_blits.c b/tests/i915/gem_userptr_blits.c
index 2814e3c3..e0e202c5 100644
--- a/tests/i915/gem_userptr_blits.c
+++ b/tests/i915/gem_userptr_blits.c
@@ -59,6 +59,7 @@
 #include "i915_drm.h"
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_sysfs.h"
 #include "sw_sync.h"
diff --git a/tests/i915/gem_vm_create.c b/tests/i915/gem_vm_create.c
index 6d93c98a..5f982d4d 100644
--- a/tests/i915/gem_vm_create.c
+++ b/tests/i915/gem_vm_create.c
@@ -22,6 +22,7 @@
  */
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_vm.h"
 #include "igt.h"
 #include "igt_rand.h"
diff --git a/tests/i915/gem_wait.c b/tests/i915/gem_wait.c
index 7b2b1c2b..81ac25b5 100644
--- a/tests/i915/gem_wait.c
+++ b/tests/i915/gem_wait.c
@@ -28,6 +28,7 @@
 #include <sys/poll.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_vgem.h"
 
diff --git a/tests/i915/gem_watchdog.c b/tests/i915/gem_watchdog.c
index 8f9fb177..286002bd 100644
--- a/tests/i915/gem_watchdog.c
+++ b/tests/i915/gem_watchdog.c
@@ -30,6 +30,7 @@
 #include <sched.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_params.h"
 #include "sw_sync.h"
diff --git a/tests/i915/gem_workarounds.c b/tests/i915/gem_workarounds.c
index 00b475c2..8312e20a 100644
--- a/tests/i915/gem_workarounds.c
+++ b/tests/i915/gem_workarounds.c
@@ -28,6 +28,7 @@
 #include <fcntl.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_device.h"
 
diff --git a/tests/i915/gen3_mixed_blits.c b/tests/i915/gen3_mixed_blits.c
index 10a8cd3e..184effec 100644
--- a/tests/i915/gen3_mixed_blits.c
+++ b/tests/i915/gen3_mixed_blits.c
@@ -45,6 +45,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915_reg.h"
 #include "igt.h"
 
diff --git a/tests/i915/gen3_render_linear_blits.c b/tests/i915/gen3_render_linear_blits.c
index d88a2c93..f01df69e 100644
--- a/tests/i915/gen3_render_linear_blits.c
+++ b/tests/i915/gen3_render_linear_blits.c
@@ -44,6 +44,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915_reg.h"
 #include "igt.h"
 
diff --git a/tests/i915/gen3_render_mixed_blits.c b/tests/i915/gen3_render_mixed_blits.c
index cda175bd..9ebb93be 100644
--- a/tests/i915/gen3_render_mixed_blits.c
+++ b/tests/i915/gen3_render_mixed_blits.c
@@ -45,6 +45,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915_reg.h"
 #include "igt.h"
 
diff --git a/tests/i915/gen3_render_tiledx_blits.c b/tests/i915/gen3_render_tiledx_blits.c
index 579205f3..b8aa0edc 100644
--- a/tests/i915/gen3_render_tiledx_blits.c
+++ b/tests/i915/gen3_render_tiledx_blits.c
@@ -45,6 +45,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915_reg.h"
 #include "igt.h"
 
diff --git a/tests/i915/gen3_render_tiledy_blits.c b/tests/i915/gen3_render_tiledy_blits.c
index 931e91a3..2d1b2d8e 100644
--- a/tests/i915/gen3_render_tiledy_blits.c
+++ b/tests/i915/gen3_render_tiledy_blits.c
@@ -45,6 +45,7 @@
 #include "drm.h"
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915_reg.h"
 #include "igt.h"
 
diff --git a/tests/i915/gen7_exec_parse.c b/tests/i915/gen7_exec_parse.c
index f7201bb9..8326fd5c 100644
--- a/tests/i915/gen7_exec_parse.c
+++ b/tests/i915/gen7_exec_parse.c
@@ -32,6 +32,7 @@
 #include "igt.h"
 #include "igt_device.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "sw_sync.h"
 
 #define DERRMR 0x44050
diff --git a/tests/i915/gen9_exec_parse.c b/tests/i915/gen9_exec_parse.c
index f9de90d2..e10c6ce9 100644
--- a/tests/i915/gen9_exec_parse.c
+++ b/tests/i915/gen9_exec_parse.c
@@ -29,6 +29,7 @@
 #include <stdlib.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_submission.h"
 #include "igt.h"
 #include "sw_sync.h"
diff --git a/tests/i915/i915_hangman.c b/tests/i915/i915_hangman.c
index 72e4d8b8..f6fac283 100644
--- a/tests/i915/i915_hangman.c
+++ b/tests/i915/i915_hangman.c
@@ -33,6 +33,7 @@
 #include <fcntl.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_sysfs.h"
 #include "igt_debugfs.h"
diff --git a/tests/i915/i915_module_load.c b/tests/i915/i915_module_load.c
index 03dec60d..281454a5 100644
--- a/tests/i915/i915_module_load.c
+++ b/tests/i915/i915_module_load.c
@@ -30,7 +30,7 @@
 #include <sys/ioctl.h>
 #include <fcntl.h>
 
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt_debugfs.h"
 #include "igt_aux.h"
 #include "igt_kmod.h"
diff --git a/tests/i915/i915_pm_rc6_residency.c b/tests/i915/i915_pm_rc6_residency.c
index d484121e..bfbe4ab0 100644
--- a/tests/i915/i915_pm_rc6_residency.c
+++ b/tests/i915/i915_pm_rc6_residency.c
@@ -34,6 +34,7 @@
 #include <time.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_perf.h"
 #include "igt_rapl.h"
diff --git a/tests/i915/i915_pm_rpm.c b/tests/i915/i915_pm_rpm.c
index d9ec0388..da498ad6 100644
--- a/tests/i915/i915_pm_rpm.c
+++ b/tests/i915/i915_pm_rpm.c
@@ -46,6 +46,7 @@
 #include <drm.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_kmod.h"
 #include "igt_sysfs.h"
diff --git a/tests/i915/i915_suspend.c b/tests/i915/i915_suspend.c
index 15340edc..da27ce09 100644
--- a/tests/i915/i915_suspend.c
+++ b/tests/i915/i915_suspend.c
@@ -39,6 +39,7 @@
 #include <drm.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_device.h"
 
diff --git a/tests/i915/perf_pmu.c b/tests/i915/perf_pmu.c
index 50b5c82b..172dd161 100644
--- a/tests/i915/perf_pmu.c
+++ b/tests/i915/perf_pmu.c
@@ -39,6 +39,7 @@
 #include <sched.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_core.h"
 #include "igt_device.h"
diff --git a/tests/i915/sysfs_clients.c b/tests/i915/sysfs_clients.c
index 0b7066c0..04636777 100644
--- a/tests/i915/sysfs_clients.c
+++ b/tests/i915/sysfs_clients.c
@@ -19,6 +19,7 @@
 #include "drmtest.h"
 #include "i915/gem.h"
 #include "i915/gem_context.h"
+#include "i915/gem_create.h"
 #include "i915/gem_engine_topology.h"
 #include "i915/gem_mman.h"
 #include "igt_aux.h"
diff --git a/tests/i915/sysfs_timeslice_duration.c b/tests/i915/sysfs_timeslice_duration.c
index 754b7ca6..05ab7966 100644
--- a/tests/i915/sysfs_timeslice_duration.c
+++ b/tests/i915/sysfs_timeslice_duration.c
@@ -32,6 +32,7 @@
 #include "igt_params.h"
 #include "drmtest.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_engine_topology.h"
 #include "i915/gem_mman.h"
 #include "igt_dummyload.h"
diff --git a/tests/kms_big_fb.c b/tests/kms_big_fb.c
index b2027b6b..b35727a0 100644
--- a/tests/kms_big_fb.c
+++ b/tests/kms_big_fb.c
@@ -27,7 +27,7 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION("Test big framebuffers");
 
diff --git a/tests/kms_ccs.c b/tests/kms_ccs.c
index bba49fd8..01e3b979 100644
--- a/tests/kms_ccs.c
+++ b/tests/kms_ccs.c
@@ -24,7 +24,7 @@
 
 #include "igt.h"
 
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 #define SDR_PLANE_BASE	3
 
diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 64907c2c..8f736652 100755
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -42,7 +42,7 @@
 #include <time.h>
 #include <pthread.h>
 
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt_stats.h"
 
 #define TEST_DPMS		(1 << 0)
diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index 65c2ddb5..906caa4c 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -31,6 +31,7 @@
 #include <pthread.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_sysfs.h"
 #include "igt_psr.h"
diff --git a/tests/kms_getfb.c b/tests/kms_getfb.c
index 5f4758c6..917b57bb 100644
--- a/tests/kms_getfb.c
+++ b/tests/kms_getfb.c
@@ -40,7 +40,7 @@
 
 #include "drm.h"
 #include "drm_fourcc.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt_device.h"
 
 IGT_TEST_DESCRIPTION("Tests GETFB and GETFB2 ioctls.");
diff --git a/tests/prime_busy.c b/tests/prime_busy.c
index aec76393..8bf50eaf 100644
--- a/tests/prime_busy.c
+++ b/tests/prime_busy.c
@@ -24,6 +24,7 @@
 #include <sys/poll.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 
 IGT_TEST_DESCRIPTION("Basic check of polling for prime fences.");
diff --git a/tests/prime_mmap.c b/tests/prime_mmap.c
index cdf2d514..a4e4b4b6 100644
--- a/tests/prime_mmap.c
+++ b/tests/prime_mmap.c
@@ -43,7 +43,7 @@
 #include "drm.h"
 #include "drmtest.h"
 #include "i915_drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_mman.h"
 #include "igt_debugfs.h"
 #include "ioctl_wrappers.h"
diff --git a/tests/prime_mmap_kms.c b/tests/prime_mmap_kms.c
index 6cc1db87..1575eeb1 100644
--- a/tests/prime_mmap_kms.c
+++ b/tests/prime_mmap_kms.c
@@ -32,7 +32,7 @@
 
 #include "igt.h"
 
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION(
    "Efficiently sharing CPU and GPU buffers");
diff --git a/tests/prime_self_import.c b/tests/prime_self_import.c
index 4a0a9803..38a55439 100644
--- a/tests/prime_self_import.c
+++ b/tests/prime_self_import.c
@@ -44,7 +44,7 @@
 #include <pthread.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION("Check whether prime import/export works on the same"
 		     " device... but with different fds.");
diff --git a/tests/prime_vgem.c b/tests/prime_vgem.c
index 07ff69a2..aeff282b 100644
--- a/tests/prime_vgem.c
+++ b/tests/prime_vgem.c
@@ -26,6 +26,7 @@
 #include <time.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_vgem.h"
 #include "intel_batchbuffer.h"	/* igt_blitter_src_copy() */
diff --git a/tools/intel_reg.c b/tools/intel_reg.c
index da1832be..584a2ccd 100644
--- a/tools/intel_reg.c
+++ b/tools/intel_reg.c
@@ -32,7 +32,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_gt.h"
 #include "intel_io.h"
-- 
2.26.3

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

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

* [igt-dev] [PATCH i-g-t v3 2/9] lib/i915/gem_create: Add gem_create_ext
@ 2021-05-26 13:00   ` Matthew Auld
  0 siblings, 0 replies; 20+ messages in thread
From: Matthew Auld @ 2021-05-26 13:00 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala, intel-gfx, Chris P Wilson

From: Andrzej Turko <andrzej.turko@linux.intel.com>

Add a wrapper for gem_create_ext ioctl (a version of gem_create that
accepts extensions). In preparation for the driver change implementing it,
a local definition of its id and necessary structs have been added,
which are to be erased as soon as those definitions
appear in the i915_drm.h file.

The new ioctl wrapper is added to a separate file.
For consistency the wrapper of the old ioctl, gem_create
is moved from ioctl_wrappers to gem_create.

Signed-off-by: Andrzej Turko <andrzej.turko@linux.intel.com>
Cc: Zbigniew Kempczynski <zbigniew.kempczynski@intel.com>
Cc: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Cc: Chris P Wilson <chris.p.wilson@intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Acked-by: Petri Latvala <petri.latvala@intel.com>
---
 benchmarks/gem_blt.c                    |  2 +-
 benchmarks/gem_busy.c                   |  2 +-
 benchmarks/gem_create.c                 |  2 +-
 benchmarks/gem_exec_ctx.c               |  2 +-
 benchmarks/gem_exec_fault.c             |  2 +-
 benchmarks/gem_exec_nop.c               |  2 +-
 benchmarks/gem_exec_reloc.c             |  2 +-
 benchmarks/gem_exec_trace.c             |  2 +-
 benchmarks/gem_latency.c                |  2 +-
 benchmarks/gem_prw.c                    |  2 +-
 benchmarks/gem_set_domain.c             |  2 +-
 benchmarks/gem_syslatency.c             |  2 +-
 benchmarks/gem_wsim.c                   |  2 +-
 benchmarks/prime_lookup.c               |  2 +-
 lib/i915/gem.h                          |  3 --
 lib/i915/gem_create.c                   | 43 ++++++++++++++++++++++++-
 lib/i915/gem_create.h                   | 19 +++++++++++
 lib/i915/gem_mman.c                     |  2 +-
 lib/i915/gem_ring.c                     |  1 +
 lib/i915/gem_submission.c               |  1 +
 lib/igt_draw.c                          |  2 +-
 lib/igt_dummyload.c                     |  2 +-
 lib/igt_fb.c                            |  2 +-
 lib/intel_batchbuffer.c                 |  2 +-
 lib/intel_bufops.c                      |  2 +-
 lib/ioctl_wrappers.c                    |  2 +-
 tests/amdgpu/amd_prime.c                |  1 +
 tests/core_hotunplug.c                  |  1 +
 tests/i915/api_intel_allocator.c        |  1 +
 tests/i915/api_intel_bb.c               |  1 +
 tests/i915/gem_bad_reloc.c              |  1 +
 tests/i915/gem_basic.c                  |  2 +-
 tests/i915/gem_blits.c                  |  1 +
 tests/i915/gem_busy.c                   |  1 +
 tests/i915/gem_close.c                  |  1 +
 tests/i915/gem_close_race.c             |  1 +
 tests/i915/gem_concurrent_all.c         |  1 +
 tests/i915/gem_create.c                 |  1 +
 tests/i915/gem_cs_tlb.c                 |  1 +
 tests/i915/gem_ctx_clone.c              |  1 +
 tests/i915/gem_ctx_create.c             |  1 +
 tests/i915/gem_ctx_engines.c            |  1 +
 tests/i915/gem_ctx_exec.c               |  1 +
 tests/i915/gem_ctx_isolation.c          |  1 +
 tests/i915/gem_ctx_param.c              |  1 +
 tests/i915/gem_ctx_shared.c             |  1 +
 tests/i915/gem_ctx_sseu.c               |  1 +
 tests/i915/gem_ctx_switch.c             |  1 +
 tests/i915/gem_eio.c                    |  1 +
 tests/i915/gem_evict_alignment.c        |  1 +
 tests/i915/gem_evict_everything.c       |  1 +
 tests/i915/gem_exec_alignment.c         |  1 +
 tests/i915/gem_exec_async.c             |  1 +
 tests/i915/gem_exec_await.c             |  1 +
 tests/i915/gem_exec_balancer.c          |  1 +
 tests/i915/gem_exec_basic.c             |  2 +-
 tests/i915/gem_exec_big.c               |  1 +
 tests/i915/gem_exec_capture.c           |  1 +
 tests/i915/gem_exec_create.c            |  1 +
 tests/i915/gem_exec_endless.c           |  1 +
 tests/i915/gem_exec_fair.c              |  1 +
 tests/i915/gem_exec_fence.c             |  1 +
 tests/i915/gem_exec_flush.c             |  1 +
 tests/i915/gem_exec_gttfill.c           |  1 +
 tests/i915/gem_exec_latency.c           |  1 +
 tests/i915/gem_exec_lut_handle.c        |  1 +
 tests/i915/gem_exec_nop.c               |  1 +
 tests/i915/gem_exec_parallel.c          |  1 +
 tests/i915/gem_exec_params.c            |  1 +
 tests/i915/gem_exec_reloc.c             |  1 +
 tests/i915/gem_exec_schedule.c          |  1 +
 tests/i915/gem_exec_store.c             |  1 +
 tests/i915/gem_exec_suspend.c           |  1 +
 tests/i915/gem_exec_whisper.c           |  1 +
 tests/i915/gem_fd_exhaustion.c          |  2 +-
 tests/i915/gem_fence_thrash.c           |  2 +-
 tests/i915/gem_fence_upload.c           |  2 +-
 tests/i915/gem_fenced_exec_thrash.c     |  1 +
 tests/i915/gem_flink_race.c             |  2 +-
 tests/i915/gem_gtt_cpu_tlb.c            |  2 +-
 tests/i915/gem_gtt_hog.c                |  1 +
 tests/i915/gem_gtt_speed.c              |  2 +-
 tests/i915/gem_huc_copy.c               |  1 +
 tests/i915/gem_linear_blits.c           |  1 +
 tests/i915/gem_lut_handle.c             |  2 +-
 tests/i915/gem_madvise.c                |  2 +-
 tests/i915/gem_mmap.c                   |  2 +-
 tests/i915/gem_mmap_gtt.c               |  1 +
 tests/i915/gem_mmap_offset.c            |  1 +
 tests/i915/gem_mmap_wc.c                |  2 +-
 tests/i915/gem_ppgtt.c                  |  1 +
 tests/i915/gem_pread.c                  |  2 +-
 tests/i915/gem_pwrite.c                 |  2 +-
 tests/i915/gem_readwrite.c              |  2 +-
 tests/i915/gem_reset_stats.c            |  1 +
 tests/i915/gem_ringfill.c               |  1 +
 tests/i915/gem_set_tiling_vs_gtt.c      |  2 +-
 tests/i915/gem_set_tiling_vs_pwrite.c   |  2 +-
 tests/i915/gem_shrink.c                 |  1 +
 tests/i915/gem_softpin.c                |  1 +
 tests/i915/gem_streaming_writes.c       |  1 +
 tests/i915/gem_sync.c                   |  1 +
 tests/i915/gem_tiled_fence_blits.c      |  1 +
 tests/i915/gem_tiled_pread_basic.c      |  2 +-
 tests/i915/gem_tiled_pread_pwrite.c     |  2 +-
 tests/i915/gem_tiled_swapping.c         |  2 +-
 tests/i915/gem_tiled_wb.c               |  2 +-
 tests/i915/gem_tiled_wc.c               |  2 +-
 tests/i915/gem_tiling_max_stride.c      |  2 +-
 tests/i915/gem_unfence_active_buffers.c |  1 +
 tests/i915/gem_unref_active_buffers.c   |  1 +
 tests/i915/gem_userptr_blits.c          |  1 +
 tests/i915/gem_vm_create.c              |  1 +
 tests/i915/gem_wait.c                   |  1 +
 tests/i915/gem_watchdog.c               |  1 +
 tests/i915/gem_workarounds.c            |  1 +
 tests/i915/gen3_mixed_blits.c           |  1 +
 tests/i915/gen3_render_linear_blits.c   |  1 +
 tests/i915/gen3_render_mixed_blits.c    |  1 +
 tests/i915/gen3_render_tiledx_blits.c   |  1 +
 tests/i915/gen3_render_tiledy_blits.c   |  1 +
 tests/i915/gen7_exec_parse.c            |  1 +
 tests/i915/gen9_exec_parse.c            |  1 +
 tests/i915/i915_hangman.c               |  1 +
 tests/i915/i915_module_load.c           |  2 +-
 tests/i915/i915_pm_rc6_residency.c      |  1 +
 tests/i915/i915_pm_rpm.c                |  1 +
 tests/i915/i915_suspend.c               |  1 +
 tests/i915/perf_pmu.c                   |  1 +
 tests/i915/sysfs_clients.c              |  1 +
 tests/i915/sysfs_timeslice_duration.c   |  1 +
 tests/kms_big_fb.c                      |  2 +-
 tests/kms_ccs.c                         |  2 +-
 tests/kms_flip.c                        |  2 +-
 tests/kms_frontbuffer_tracking.c        |  1 +
 tests/kms_getfb.c                       |  2 +-
 tests/prime_busy.c                      |  1 +
 tests/prime_mmap.c                      |  2 +-
 tests/prime_mmap_kms.c                  |  2 +-
 tests/prime_self_import.c               |  2 +-
 tests/prime_vgem.c                      |  1 +
 tools/intel_reg.c                       |  2 +-
 142 files changed, 200 insertions(+), 57 deletions(-)
 create mode 100644 lib/i915/gem_create.h

diff --git a/benchmarks/gem_blt.c b/benchmarks/gem_blt.c
index 34b82a87..424ce8e7 100644
--- a/benchmarks/gem_blt.c
+++ b/benchmarks/gem_blt.c
@@ -41,7 +41,7 @@
 #include <time.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 #define COPY_BLT_CMD		(2<<29|0x53<<22|0x6)
 #define BLT_WRITE_ALPHA		(1<<21)
diff --git a/benchmarks/gem_busy.c b/benchmarks/gem_busy.c
index 69be8c17..70885e25 100644
--- a/benchmarks/gem_busy.c
+++ b/benchmarks/gem_busy.c
@@ -45,7 +45,7 @@
 #include "intel_chipset.h"
 #include "intel_reg.h"
 #include "igt_stats.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_mman.h"
 
 #define ENGINE_FLAGS  (I915_EXEC_RING_MASK | I915_EXEC_BSD_MASK)
diff --git a/benchmarks/gem_create.c b/benchmarks/gem_create.c
index d4e297ed..7808f43a 100644
--- a/benchmarks/gem_create.c
+++ b/benchmarks/gem_create.c
@@ -40,7 +40,7 @@
 
 #include "drm.h"
 #include "drmtest.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt_aux.h"
 #include "igt_stats.h"
 #include "intel_reg.h"
diff --git a/benchmarks/gem_exec_ctx.c b/benchmarks/gem_exec_ctx.c
index b6f403fb..b0c62e4c 100644
--- a/benchmarks/gem_exec_ctx.c
+++ b/benchmarks/gem_exec_ctx.c
@@ -40,7 +40,7 @@
 
 #include "drm.h"
 #include "drmtest.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "intel_io.h"
 #include "intel_reg.h"
 #include "igt_stats.h"
diff --git a/benchmarks/gem_exec_fault.c b/benchmarks/gem_exec_fault.c
index a3a0992c..d53fab96 100644
--- a/benchmarks/gem_exec_fault.c
+++ b/benchmarks/gem_exec_fault.c
@@ -42,7 +42,7 @@
 
 #include "drm.h"
 #include "drmtest.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt_stats.h"
 #include "intel_io.h"
 #include "intel_reg.h"
diff --git a/benchmarks/gem_exec_nop.c b/benchmarks/gem_exec_nop.c
index c44d3454..9f8634a7 100644
--- a/benchmarks/gem_exec_nop.c
+++ b/benchmarks/gem_exec_nop.c
@@ -40,7 +40,7 @@
 
 #include "drm.h"
 #include "drmtest.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt_stats.h"
 #include "intel_io.h"
 #include "intel_reg.h"
diff --git a/benchmarks/gem_exec_reloc.c b/benchmarks/gem_exec_reloc.c
index abaf9345..dadc064f 100644
--- a/benchmarks/gem_exec_reloc.c
+++ b/benchmarks/gem_exec_reloc.c
@@ -38,7 +38,7 @@
 
 #include "drm.h"
 #include "drmtest.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_mman.h"
 #include "igt_debugfs.h"
 #include "intel_reg.h"
diff --git a/benchmarks/gem_exec_trace.c b/benchmarks/gem_exec_trace.c
index e37f6fb7..4263ccb0 100644
--- a/benchmarks/gem_exec_trace.c
+++ b/benchmarks/gem_exec_trace.c
@@ -41,7 +41,7 @@
 
 #include "drm.h"
 #include "drmtest.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt_stats.h"
 #include "intel_io.h"
 #include "ioctl_wrappers.h"
diff --git a/benchmarks/gem_latency.c b/benchmarks/gem_latency.c
index 9b3d22b7..cc8b3de5 100644
--- a/benchmarks/gem_latency.c
+++ b/benchmarks/gem_latency.c
@@ -43,7 +43,7 @@
 #include <sys/resource.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_device.h"
 
diff --git a/benchmarks/gem_prw.c b/benchmarks/gem_prw.c
index 5d3fda9a..c6f3e066 100644
--- a/benchmarks/gem_prw.c
+++ b/benchmarks/gem_prw.c
@@ -40,7 +40,7 @@
 
 #include "drm.h"
 #include "drmtest.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt_aux.h"
 #include "igt_stats.h"
 #include "ioctl_wrappers.h"
diff --git a/benchmarks/gem_set_domain.c b/benchmarks/gem_set_domain.c
index 1c9d797c..c92beea4 100644
--- a/benchmarks/gem_set_domain.c
+++ b/benchmarks/gem_set_domain.c
@@ -40,7 +40,7 @@
 
 #include "drm.h"
 #include "drmtest.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt_aux.h"
 #include "ioctl_wrappers.h"
 
diff --git a/benchmarks/gem_syslatency.c b/benchmarks/gem_syslatency.c
index c10d4f50..035ee934 100644
--- a/benchmarks/gem_syslatency.c
+++ b/benchmarks/gem_syslatency.c
@@ -44,7 +44,7 @@
 
 #include <linux/unistd.h>
 
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_ring.h"
 
 #define sigev_notify_thread_id _sigev_un._tid
diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c
index 1b66e63e..d1435222 100644
--- a/benchmarks/gem_wsim.c
+++ b/benchmarks/gem_wsim.c
@@ -56,7 +56,7 @@
 #include "igt_perf.h"
 #include "sw_sync.h"
 
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_engine_topology.h"
 #include "i915/gem_mman.h"
 
diff --git a/benchmarks/prime_lookup.c b/benchmarks/prime_lookup.c
index b1891756..9c885367 100644
--- a/benchmarks/prime_lookup.c
+++ b/benchmarks/prime_lookup.c
@@ -38,7 +38,7 @@
 
 #include "drm.h"
 #include "drmtest.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt_rand.h"
 #include "intel_io.h"
 #include "ioctl_wrappers.h"
diff --git a/lib/i915/gem.h b/lib/i915/gem.h
index bd23a277..feabac8d 100644
--- a/lib/i915/gem.h
+++ b/lib/i915/gem.h
@@ -32,7 +32,4 @@ void gem_quiescent_gpu(int i915);
 
 int gem_reopen_driver(int i915);
 
-int __gem_create(int fd, uint64_t *size, uint32_t *handle);
-uint32_t gem_create(int fd, uint64_t size);
-
 #endif /* I915_GEM_H */
diff --git a/lib/i915/gem_create.c b/lib/i915/gem_create.c
index a8c1a581..b2e8d559 100644
--- a/lib/i915/gem_create.c
+++ b/lib/i915/gem_create.c
@@ -5,7 +5,7 @@
 
 #include <errno.h>
 
-#include "gem.h"
+#include "gem_create.h"
 #include "i915_drm.h"
 #include "igt_core.h"
 #include "ioctl_wrappers.h"
@@ -47,3 +47,44 @@ uint32_t gem_create(int fd, uint64_t size)
 
 	return handle;
 }
+
+int __gem_create_ext(int fd, uint64_t *size, uint32_t *handle,
+		     struct i915_user_extension *ext)
+{
+	struct drm_i915_gem_create_ext create = {
+		.size = *size,
+		.extensions = to_user_pointer(ext),
+	};
+	int err = 0;
+
+	if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_CREATE_EXT, &create) == 0) {
+		*handle = create.handle;
+		*size = create.size;
+	} else {
+		err = -errno;
+		igt_assume(err != 0);
+	}
+
+	errno = 0;
+	return err;
+}
+
+/**
+ * gem_create_ext:
+ * @fd: open i915 drm file descriptor
+ * @size: desired size of the buffer
+ * @ext: optional extensions chain
+ *
+ * This wraps the GEM_CREATE_EXT ioctl, which allocates a new gem buffer object
+ * of @size.
+ *
+ * Returns: The file-private handle of the created buffer object
+ */
+uint32_t gem_create_ext(int fd, uint64_t size, struct i915_user_extension *ext)
+{
+	uint32_t handle;
+
+	igt_assert_eq(__gem_create_ext(fd, &size, &handle, ext), 0);
+
+	return handle;
+}
diff --git a/lib/i915/gem_create.h b/lib/i915/gem_create.h
new file mode 100644
index 00000000..c2b531b4
--- /dev/null
+++ b/lib/i915/gem_create.h
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: MIT
+/*
+ * Copyright © 2021 Intel Corporation
+ */
+
+#ifndef GEM_CREATE_H
+#define GEM_CREATE_H
+
+#include <stdint.h>
+
+#include "i915_drm.h"
+
+int __gem_create(int fd, uint64_t *size, uint32_t *handle);
+uint32_t gem_create(int fd, uint64_t size);
+int __gem_create_ext(int fd, uint64_t *size, uint32_t *handle,
+                     struct i915_user_extension *ext);
+uint32_t gem_create_ext(int fd, uint64_t size, struct i915_user_extension *ext);
+
+#endif /* GEM_CREATE_H */
diff --git a/lib/i915/gem_mman.c b/lib/i915/gem_mman.c
index ab04cbec..300ca13d 100644
--- a/lib/i915/gem_mman.c
+++ b/lib/i915/gem_mman.c
@@ -31,7 +31,7 @@
 #include "ioctl_wrappers.h"
 #include "intel_chipset.h"
 
-#include "gem.h"
+#include "gem_create.h"
 #include "gem_mman.h"
 
 #ifdef HAVE_VALGRIND
diff --git a/lib/i915/gem_ring.c b/lib/i915/gem_ring.c
index f224e822..6d28b5d9 100644
--- a/lib/i915/gem_ring.c
+++ b/lib/i915/gem_ring.c
@@ -27,6 +27,7 @@
 #include <sys/time.h>
 
 #include "gem.h"
+#include "gem_create.h"
 #include "gem_ring.h"
 #include "gem_submission.h"
 
diff --git a/lib/i915/gem_submission.c b/lib/i915/gem_submission.c
index 051f9d04..bd4bbb3e 100644
--- a/lib/i915/gem_submission.c
+++ b/lib/i915/gem_submission.c
@@ -31,6 +31,7 @@
 #include <i915_drm.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_engine_topology.h"
 #include "i915/gem_submission.h"
 
diff --git a/lib/igt_draw.c b/lib/igt_draw.c
index 949c0d77..a3144b50 100644
--- a/lib/igt_draw.c
+++ b/lib/igt_draw.c
@@ -34,7 +34,7 @@
 #include "igt_fb.h"
 #include "ioctl_wrappers.h"
 #include "i830_reg.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_mman.h"
 
 #ifndef PAGE_ALIGN
diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
index 34ad9221..1a3abb5d 100644
--- a/lib/igt_dummyload.c
+++ b/lib/igt_dummyload.c
@@ -31,7 +31,7 @@
 #include <i915_drm.h>
 
 #include "drmtest.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_engine_topology.h"
 #include "i915/gem_mman.h"
 #include "i915/gem_submission.h"
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index f8f02766..3e6841fd 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -33,7 +33,7 @@
 #include <pixman.h>
 
 #include "drmtest.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_mman.h"
 #include "igt_aux.h"
 #include "igt_color_encoding.h"
diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index 0b2c5b21..cc976a62 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -35,7 +35,7 @@
 
 #include "drm.h"
 #include "drmtest.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "intel_batchbuffer.h"
 #include "intel_bufmgr.h"
 #include "intel_bufops.h"
diff --git a/lib/intel_bufops.c b/lib/intel_bufops.c
index 5dece576..3ce68663 100644
--- a/lib/intel_bufops.c
+++ b/lib/intel_bufops.c
@@ -25,7 +25,7 @@
 #include <sys/ioctl.h>
 #include <cairo.h>
 
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_x86.h"
 #include "intel_bufops.h"
diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
index 4440004c..0c1b5e32 100644
--- a/lib/ioctl_wrappers.c
+++ b/lib/ioctl_wrappers.c
@@ -49,7 +49,7 @@
 
 #include "drmtest.h"
 #include "i915_drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "intel_batchbuffer.h"
 #include "intel_chipset.h"
 #include "intel_io.h"
diff --git a/tests/amdgpu/amd_prime.c b/tests/amdgpu/amd_prime.c
index 537b0bcd..3e5cc1a7 100644
--- a/tests/amdgpu/amd_prime.c
+++ b/tests/amdgpu/amd_prime.c
@@ -27,6 +27,7 @@
 #include <sys/poll.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_vgem.h"
 
diff --git a/tests/core_hotunplug.c b/tests/core_hotunplug.c
index e6079fa3..a639cfb4 100644
--- a/tests/core_hotunplug.c
+++ b/tests/core_hotunplug.c
@@ -31,6 +31,7 @@
 #include <unistd.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/perf.h"
 #include "igt.h"
 #include "igt_device_scan.h"
diff --git a/tests/i915/api_intel_allocator.c b/tests/i915/api_intel_allocator.c
index 182d9ba7..ea4ba8bb 100644
--- a/tests/i915/api_intel_allocator.c
+++ b/tests/i915/api_intel_allocator.c
@@ -5,6 +5,7 @@
 
 #include <stdatomic.h>
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_aux.h"
 #include "intel_allocator.h"
diff --git a/tests/i915/api_intel_bb.c b/tests/i915/api_intel_bb.c
index eafa856d..7ffe64fc 100644
--- a/tests/i915/api_intel_bb.c
+++ b/tests/i915/api_intel_bb.c
@@ -23,6 +23,7 @@
 
 #include "igt.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
diff --git a/tests/i915/gem_bad_reloc.c b/tests/i915/gem_bad_reloc.c
index 3d4834bc..3ca0f345 100644
--- a/tests/i915/gem_bad_reloc.c
+++ b/tests/i915/gem_bad_reloc.c
@@ -39,6 +39,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 
 IGT_TEST_DESCRIPTION("Simulates SNA behaviour using negative self-relocations"
diff --git a/tests/i915/gem_basic.c b/tests/i915/gem_basic.c
index 984bdf60..13ecce52 100644
--- a/tests/i915/gem_basic.c
+++ b/tests/i915/gem_basic.c
@@ -37,7 +37,7 @@
 #include <sys/ioctl.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 static void
 test_bad_close(int fd)
diff --git a/tests/i915/gem_blits.c b/tests/i915/gem_blits.c
index 6ed9b60e..21dcee68 100644
--- a/tests/i915/gem_blits.c
+++ b/tests/i915/gem_blits.c
@@ -23,6 +23,7 @@
  */
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_x86.h"
 
diff --git a/tests/i915/gem_busy.c b/tests/i915/gem_busy.c
index 77a55101..dc481f3c 100644
--- a/tests/i915/gem_busy.c
+++ b/tests/i915/gem_busy.c
@@ -26,6 +26,7 @@
 #include <sys/ioctl.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_rand.h"
 #include "igt_vgem.h"
diff --git a/tests/i915/gem_close.c b/tests/i915/gem_close.c
index 58f2d4b3..ee2d690b 100644
--- a/tests/i915/gem_close.c
+++ b/tests/i915/gem_close.c
@@ -22,6 +22,7 @@
  */
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 
 static int batch_create(int fd)
diff --git a/tests/i915/gem_close_race.c b/tests/i915/gem_close_race.c
index 06b80100..ab444945 100644
--- a/tests/i915/gem_close_race.c
+++ b/tests/i915/gem_close_race.c
@@ -42,6 +42,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 
 #define OBJECT_SIZE (256 * 1024)
diff --git a/tests/i915/gem_concurrent_all.c b/tests/i915/gem_concurrent_all.c
index a422a449..d0f9b62e 100644
--- a/tests/i915/gem_concurrent_all.c
+++ b/tests/i915/gem_concurrent_all.c
@@ -49,6 +49,7 @@
 #include <drm.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_vgem.h"
 
diff --git a/tests/i915/gem_create.c b/tests/i915/gem_create.c
index ce985053..8acc2f52 100644
--- a/tests/i915/gem_create.c
+++ b/tests/i915/gem_create.c
@@ -54,6 +54,7 @@
 #include "igt_dummyload.h"
 #include "igt_x86.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_engine_topology.h"
 #include "i915/gem_mman.h"
 #include "i915_drm.h"
diff --git a/tests/i915/gem_cs_tlb.c b/tests/i915/gem_cs_tlb.c
index f72879c3..dec9c107 100644
--- a/tests/i915/gem_cs_tlb.c
+++ b/tests/i915/gem_cs_tlb.c
@@ -50,6 +50,7 @@
 #include <drm.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 
 IGT_TEST_DESCRIPTION("Check whether we correctly invalidate the cs tlb.");
diff --git a/tests/i915/gem_ctx_clone.c b/tests/i915/gem_ctx_clone.c
index b72269bc..225e801b 100644
--- a/tests/i915/gem_ctx_clone.c
+++ b/tests/i915/gem_ctx_clone.c
@@ -22,6 +22,7 @@
  */
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_vm.h"
 #include "i915_drm.h"
 #include "igt.h"
diff --git a/tests/i915/gem_ctx_create.c b/tests/i915/gem_ctx_create.c
index 9a512a03..5b14f7af 100644
--- a/tests/i915/gem_ctx_create.c
+++ b/tests/i915/gem_ctx_create.c
@@ -31,6 +31,7 @@
 #include <time.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_rand.h"
 #include "sw_sync.h"
diff --git a/tests/i915/gem_ctx_engines.c b/tests/i915/gem_ctx_engines.c
index 643a0b2f..02658c4f 100644
--- a/tests/i915/gem_ctx_engines.c
+++ b/tests/i915/gem_ctx_engines.c
@@ -39,6 +39,7 @@
 
 #include "i915/gem.h"
 #include "i915/gem_context.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "sw_sync.h"
 
diff --git a/tests/i915/gem_ctx_exec.c b/tests/i915/gem_ctx_exec.c
index 89776185..2e72bf71 100644
--- a/tests/i915/gem_ctx_exec.c
+++ b/tests/i915/gem_ctx_exec.c
@@ -41,6 +41,7 @@
 #include <drm.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_dummyload.h"
 #include "igt_rand.h"
diff --git a/tests/i915/gem_ctx_isolation.c b/tests/i915/gem_ctx_isolation.c
index 4f174268..4277df34 100644
--- a/tests/i915/gem_ctx_isolation.c
+++ b/tests/i915/gem_ctx_isolation.c
@@ -22,6 +22,7 @@
  */
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_dummyload.h"
 
diff --git a/tests/i915/gem_ctx_param.c b/tests/i915/gem_ctx_param.c
index ab0e3007..c024fe60 100644
--- a/tests/i915/gem_ctx_param.c
+++ b/tests/i915/gem_ctx_param.c
@@ -29,6 +29,7 @@
 
 #include "igt.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_vm.h"
 
 IGT_TEST_DESCRIPTION("Basic test for context set/get param input validation.");
diff --git a/tests/i915/gem_ctx_shared.c b/tests/i915/gem_ctx_shared.c
index 6b21994d..c7e957c4 100644
--- a/tests/i915/gem_ctx_shared.c
+++ b/tests/i915/gem_ctx_shared.c
@@ -38,6 +38,7 @@
 #include <drm.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_engine_topology.h"
 #include "igt.h"
 #include "igt_rand.h"
diff --git a/tests/i915/gem_ctx_sseu.c b/tests/i915/gem_ctx_sseu.c
index 749ce336..7685511f 100644
--- a/tests/i915/gem_ctx_sseu.c
+++ b/tests/i915/gem_ctx_sseu.c
@@ -37,6 +37,7 @@
 #include <sys/wait.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt.h"
 #include "igt_dummyload.h"
diff --git a/tests/i915/gem_ctx_switch.c b/tests/i915/gem_ctx_switch.c
index 6208dacd..44c659f0 100644
--- a/tests/i915/gem_ctx_switch.c
+++ b/tests/i915/gem_ctx_switch.c
@@ -41,6 +41,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_ring.h"
 #include "igt.h"
 
diff --git a/tests/i915/gem_eio.c b/tests/i915/gem_eio.c
index d86ccf2b..25d109d6 100644
--- a/tests/i915/gem_eio.c
+++ b/tests/i915/gem_eio.c
@@ -43,6 +43,7 @@
 #include <drm.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_ring.h"
 #include "igt.h"
 #include "igt_device.h"
diff --git a/tests/i915/gem_evict_alignment.c b/tests/i915/gem_evict_alignment.c
index d4a5877a..e5176b9b 100644
--- a/tests/i915/gem_evict_alignment.c
+++ b/tests/i915/gem_evict_alignment.c
@@ -45,6 +45,7 @@
 #include <drm.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 
 IGT_TEST_DESCRIPTION("Run a couple of big batches to force the unbind on"
diff --git a/tests/i915/gem_evict_everything.c b/tests/i915/gem_evict_everything.c
index 5d4d15c4..37343b53 100644
--- a/tests/i915/gem_evict_everything.c
+++ b/tests/i915/gem_evict_everything.c
@@ -44,6 +44,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 
 #include "eviction_common.c"
diff --git a/tests/i915/gem_exec_alignment.c b/tests/i915/gem_exec_alignment.c
index 7bbd2a8f..c4611bd1 100644
--- a/tests/i915/gem_exec_alignment.c
+++ b/tests/i915/gem_exec_alignment.c
@@ -42,6 +42,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 
 IGT_TEST_DESCRIPTION("Exercises the basic execbuffer using object alignments");
diff --git a/tests/i915/gem_exec_async.c b/tests/i915/gem_exec_async.c
index 412ad737..bf8a856a 100644
--- a/tests/i915/gem_exec_async.c
+++ b/tests/i915/gem_exec_async.c
@@ -22,6 +22,7 @@
  */
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 
 IGT_TEST_DESCRIPTION("Check that we can issue concurrent writes across the engines.");
diff --git a/tests/i915/gem_exec_await.c b/tests/i915/gem_exec_await.c
index e64d2a94..6db30695 100644
--- a/tests/i915/gem_exec_await.c
+++ b/tests/i915/gem_exec_await.c
@@ -26,6 +26,7 @@
 #include <sys/signal.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_rand.h"
 #include "igt_sysfs.h"
diff --git a/tests/i915/gem_exec_balancer.c b/tests/i915/gem_exec_balancer.c
index 01db0e11..12cb55ab 100644
--- a/tests/i915/gem_exec_balancer.c
+++ b/tests/i915/gem_exec_balancer.c
@@ -27,6 +27,7 @@
 #include <sys/signal.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_gt.h"
 #include "igt_perf.h"
diff --git a/tests/i915/gem_exec_basic.c b/tests/i915/gem_exec_basic.c
index 31f6a234..5021852f 100644
--- a/tests/i915/gem_exec_basic.c
+++ b/tests/i915/gem_exec_basic.c
@@ -23,7 +23,7 @@
 
 #include "igt.h"
 
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION("Basic sanity check of execbuf-ioctl rings.");
 
diff --git a/tests/i915/gem_exec_big.c b/tests/i915/gem_exec_big.c
index 63de42d5..1f8c720b 100644
--- a/tests/i915/gem_exec_big.c
+++ b/tests/i915/gem_exec_big.c
@@ -46,6 +46,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 
 IGT_TEST_DESCRIPTION("Run a large nop batch to stress test the error capture"
diff --git a/tests/i915/gem_exec_capture.c b/tests/i915/gem_exec_capture.c
index 3da78d63..a6b3d987 100644
--- a/tests/i915/gem_exec_capture.c
+++ b/tests/i915/gem_exec_capture.c
@@ -25,6 +25,7 @@
 #include <zlib.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_device.h"
 #include "igt_rand.h"
diff --git a/tests/i915/gem_exec_create.c b/tests/i915/gem_exec_create.c
index 6529da7e..8556cb21 100644
--- a/tests/i915/gem_exec_create.c
+++ b/tests/i915/gem_exec_create.c
@@ -40,6 +40,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_ring.h"
 #include "igt.h"
 
diff --git a/tests/i915/gem_exec_endless.c b/tests/i915/gem_exec_endless.c
index 1b320d4c..e7d4b56c 100644
--- a/tests/i915/gem_exec_endless.c
+++ b/tests/i915/gem_exec_endless.c
@@ -24,6 +24,7 @@
 #include <sys/ioctl.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_device.h"
 #include "igt_sysfs.h"
diff --git a/tests/i915/gem_exec_fair.c b/tests/i915/gem_exec_fair.c
index c1a71f77..628f4df2 100644
--- a/tests/i915/gem_exec_fair.c
+++ b/tests/i915/gem_exec_fair.c
@@ -18,6 +18,7 @@
 #include "sync_file.h"
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_rand.h"
 #include "igt_rapl.h"
diff --git a/tests/i915/gem_exec_fence.c b/tests/i915/gem_exec_fence.c
index b7b3f8e3..70bb0011 100644
--- a/tests/i915/gem_exec_fence.c
+++ b/tests/i915/gem_exec_fence.c
@@ -26,6 +26,7 @@
 #include <sys/signal.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_syncobj.h"
 #include "igt_sysfs.h"
diff --git a/tests/i915/gem_exec_flush.c b/tests/i915/gem_exec_flush.c
index a2cac71a..629fdd7a 100644
--- a/tests/i915/gem_exec_flush.c
+++ b/tests/i915/gem_exec_flush.c
@@ -24,6 +24,7 @@
 #include <time.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_ring.h"
 #include "igt.h"
 #include "igt_x86.h"
diff --git a/tests/i915/gem_exec_gttfill.c b/tests/i915/gem_exec_gttfill.c
index c0e27c9b..e711576f 100644
--- a/tests/i915/gem_exec_gttfill.c
+++ b/tests/i915/gem_exec_gttfill.c
@@ -22,6 +22,7 @@
  */
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_rand.h"
 
diff --git a/tests/i915/gem_exec_latency.c b/tests/i915/gem_exec_latency.c
index 8ba924b8..158faee5 100644
--- a/tests/i915/gem_exec_latency.c
+++ b/tests/i915/gem_exec_latency.c
@@ -47,6 +47,7 @@
 #include "igt_stats.h"
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 
 #define ENGINE_FLAGS  (I915_EXEC_RING_MASK | I915_EXEC_BSD_MASK)
 
diff --git a/tests/i915/gem_exec_lut_handle.c b/tests/i915/gem_exec_lut_handle.c
index e642686d..3c5c81f1 100644
--- a/tests/i915/gem_exec_lut_handle.c
+++ b/tests/i915/gem_exec_lut_handle.c
@@ -38,6 +38,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 
 IGT_TEST_DESCRIPTION("Exercises the basic execbuffer using the handle LUT"
diff --git a/tests/i915/gem_exec_nop.c b/tests/i915/gem_exec_nop.c
index 62554ecb..acdf6bde 100644
--- a/tests/i915/gem_exec_nop.c
+++ b/tests/i915/gem_exec_nop.c
@@ -41,6 +41,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_device.h"
 #include "igt_rand.h"
diff --git a/tests/i915/gem_exec_parallel.c b/tests/i915/gem_exec_parallel.c
index c9cf9d7a..11cea5d7 100644
--- a/tests/i915/gem_exec_parallel.c
+++ b/tests/i915/gem_exec_parallel.c
@@ -30,6 +30,7 @@
 #include <pthread.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_gt.h"
 
diff --git a/tests/i915/gem_exec_params.c b/tests/i915/gem_exec_params.c
index 6840cf40..6ab1ab11 100644
--- a/tests/i915/gem_exec_params.c
+++ b/tests/i915/gem_exec_params.c
@@ -39,6 +39,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_ring.h"
 #include "igt.h"
 #include "igt_device.h"
diff --git a/tests/i915/gem_exec_reloc.c b/tests/i915/gem_exec_reloc.c
index 397c335e..c79400fb 100644
--- a/tests/i915/gem_exec_reloc.c
+++ b/tests/i915/gem_exec_reloc.c
@@ -25,6 +25,7 @@
 #include <sys/ioctl.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_device.h"
 #include "igt_dummyload.h"
diff --git a/tests/i915/gem_exec_schedule.c b/tests/i915/gem_exec_schedule.c
index 9585059d..6147ff96 100644
--- a/tests/i915/gem_exec_schedule.c
+++ b/tests/i915/gem_exec_schedule.c
@@ -35,6 +35,7 @@
 #include <unistd.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_rand.h"
 #include "igt_rapl.h"
diff --git a/tests/i915/gem_exec_store.c b/tests/i915/gem_exec_store.c
index 771ee169..99ffc9ab 100644
--- a/tests/i915/gem_exec_store.c
+++ b/tests/i915/gem_exec_store.c
@@ -30,6 +30,7 @@
 #include <strings.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_device.h"
 #include "igt_gt.h"
diff --git a/tests/i915/gem_exec_suspend.c b/tests/i915/gem_exec_suspend.c
index b6558a14..d13c443e 100644
--- a/tests/i915/gem_exec_suspend.c
+++ b/tests/i915/gem_exec_suspend.c
@@ -31,6 +31,7 @@
 #include <unistd.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_dummyload.h"
 #include "igt_gt.h"
diff --git a/tests/i915/gem_exec_whisper.c b/tests/i915/gem_exec_whisper.c
index 71bd610c..a9d3fa05 100644
--- a/tests/i915/gem_exec_whisper.c
+++ b/tests/i915/gem_exec_whisper.c
@@ -28,6 +28,7 @@
  */
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_debugfs.h"
 #include "igt_rapl.h"
diff --git a/tests/i915/gem_fd_exhaustion.c b/tests/i915/gem_fd_exhaustion.c
index 13e8a23a..a6463685 100644
--- a/tests/i915/gem_fd_exhaustion.c
+++ b/tests/i915/gem_fd_exhaustion.c
@@ -33,7 +33,7 @@
 #include <fcntl.h>
 #include <limits.h>
 
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 igt_simple_main
 {
diff --git a/tests/i915/gem_fence_thrash.c b/tests/i915/gem_fence_thrash.c
index 872dc554..89a5ae29 100644
--- a/tests/i915/gem_fence_thrash.c
+++ b/tests/i915/gem_fence_thrash.c
@@ -40,7 +40,7 @@
 #include <pthread.h>
 #include "drm.h"
 
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_x86.h"
 
diff --git a/tests/i915/gem_fence_upload.c b/tests/i915/gem_fence_upload.c
index 87ed1edf..67487d67 100644
--- a/tests/i915/gem_fence_upload.c
+++ b/tests/i915/gem_fence_upload.c
@@ -40,7 +40,7 @@
 
 #include "drm.h"
 #include "i915_drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 #define OBJECT_SIZE (1024*1024) /* restricted to 1MiB alignment on i915 fences */
 
diff --git a/tests/i915/gem_fenced_exec_thrash.c b/tests/i915/gem_fenced_exec_thrash.c
index b577a04f..13812bb7 100644
--- a/tests/i915/gem_fenced_exec_thrash.c
+++ b/tests/i915/gem_fenced_exec_thrash.c
@@ -31,6 +31,7 @@
 #include <errno.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 
 IGT_TEST_DESCRIPTION("Test execbuf fence accounting.");
diff --git a/tests/i915/gem_flink_race.c b/tests/i915/gem_flink_race.c
index 58431b36..70e133d7 100644
--- a/tests/i915/gem_flink_race.c
+++ b/tests/i915/gem_flink_race.c
@@ -32,7 +32,7 @@
 #include <pthread.h>
 #include <errno.h>
 
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_stats.h"
 
diff --git a/tests/i915/gem_gtt_cpu_tlb.c b/tests/i915/gem_gtt_cpu_tlb.c
index 07f8f1a3..8000e58c 100644
--- a/tests/i915/gem_gtt_cpu_tlb.c
+++ b/tests/i915/gem_gtt_cpu_tlb.c
@@ -42,7 +42,7 @@
 #include <sys/ioctl.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION("Check whether gtt tlbs for cpu access are correctly"
 		     " invalidated.");
diff --git a/tests/i915/gem_gtt_hog.c b/tests/i915/gem_gtt_hog.c
index 1372245b..15a6139e 100644
--- a/tests/i915/gem_gtt_hog.c
+++ b/tests/i915/gem_gtt_hog.c
@@ -40,6 +40,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 
 static const uint32_t canary = 0xdeadbeef;
diff --git a/tests/i915/gem_gtt_speed.c b/tests/i915/gem_gtt_speed.c
index 644af3d3..272091fd 100644
--- a/tests/i915/gem_gtt_speed.c
+++ b/tests/i915/gem_gtt_speed.c
@@ -41,7 +41,7 @@
 #include <sys/time.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 #define OBJECT_SIZE 16384
 
diff --git a/tests/i915/gem_huc_copy.c b/tests/i915/gem_huc_copy.c
index 5954d34e..9a32893e 100644
--- a/tests/i915/gem_huc_copy.c
+++ b/tests/i915/gem_huc_copy.c
@@ -34,6 +34,7 @@
 #include <sys/time.h>
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION("A very simple workload for the HuC.");
 
diff --git a/tests/i915/gem_linear_blits.c b/tests/i915/gem_linear_blits.c
index 7b7cf05a..6504c9f2 100644
--- a/tests/i915/gem_linear_blits.c
+++ b/tests/i915/gem_linear_blits.c
@@ -45,6 +45,7 @@
 #include <drm.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 
 IGT_TEST_DESCRIPTION("Test doing many blits with a working set larger than the"
diff --git a/tests/i915/gem_lut_handle.c b/tests/i915/gem_lut_handle.c
index f14a9bda..64dbb87c 100644
--- a/tests/i915/gem_lut_handle.c
+++ b/tests/i915/gem_lut_handle.c
@@ -38,7 +38,7 @@
 #include <sys/time.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION("Exercises the basic execbuffer using the handle LUT"
 		     " interface.");
diff --git a/tests/i915/gem_madvise.c b/tests/i915/gem_madvise.c
index d772d3ab..d88747a9 100644
--- a/tests/i915/gem_madvise.c
+++ b/tests/i915/gem_madvise.c
@@ -37,7 +37,7 @@
 #include <signal.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION("Checks that the kernel reports EFAULT when trying to use"
 		     " purged bo.");
diff --git a/tests/i915/gem_mmap.c b/tests/i915/gem_mmap.c
index 7c36571c..d12a4c0b 100644
--- a/tests/i915/gem_mmap.c
+++ b/tests/i915/gem_mmap.c
@@ -37,7 +37,7 @@
 #include <sys/ioctl.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 #define OBJECT_SIZE 16384
 #define PAGE_SIZE 4096
diff --git a/tests/i915/gem_mmap_gtt.c b/tests/i915/gem_mmap_gtt.c
index 528a7c72..cbfa222a 100644
--- a/tests/i915/gem_mmap_gtt.c
+++ b/tests/i915/gem_mmap_gtt.c
@@ -42,6 +42,7 @@
 #include "drm.h"
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_sysfs.h"
 #include "igt_x86.h"
diff --git a/tests/i915/gem_mmap_offset.c b/tests/i915/gem_mmap_offset.c
index 95c934db..f1ba67b7 100644
--- a/tests/i915/gem_mmap_offset.c
+++ b/tests/i915/gem_mmap_offset.c
@@ -32,6 +32,7 @@
 #include "drm.h"
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_x86.h"
 
diff --git a/tests/i915/gem_mmap_wc.c b/tests/i915/gem_mmap_wc.c
index 4a2192b3..7130a510 100644
--- a/tests/i915/gem_mmap_wc.c
+++ b/tests/i915/gem_mmap_wc.c
@@ -38,7 +38,7 @@
 #include <sys/ioctl.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 struct local_i915_gem_mmap_v2 {
 	uint32_t handle;
diff --git a/tests/i915/gem_ppgtt.c b/tests/i915/gem_ppgtt.c
index da83484a..4c9691e3 100644
--- a/tests/i915/gem_ppgtt.c
+++ b/tests/i915/gem_ppgtt.c
@@ -36,6 +36,7 @@
 #include <drm.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_debugfs.h"
 
diff --git a/tests/i915/gem_pread.c b/tests/i915/gem_pread.c
index ec9991ee..a8bf2b05 100644
--- a/tests/i915/gem_pread.c
+++ b/tests/i915/gem_pread.c
@@ -43,7 +43,7 @@
 #include <pthread.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt_vgem.h"
 
 #define MiB(x) ((x) * 1024 * 1024)
diff --git a/tests/i915/gem_pwrite.c b/tests/i915/gem_pwrite.c
index 5fd15e6a..e8e8c7ad 100644
--- a/tests/i915/gem_pwrite.c
+++ b/tests/i915/gem_pwrite.c
@@ -42,7 +42,7 @@
 #include <sys/time.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_rand.h"
 #include "igt_vgem.h"
diff --git a/tests/i915/gem_readwrite.c b/tests/i915/gem_readwrite.c
index 8a958cc9..2d437dec 100644
--- a/tests/i915/gem_readwrite.c
+++ b/tests/i915/gem_readwrite.c
@@ -37,7 +37,7 @@
 #include <sys/ioctl.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 #define OBJECT_SIZE 16384
 
diff --git a/tests/i915/gem_reset_stats.c b/tests/i915/gem_reset_stats.c
index e1feecb6..627a10ab 100644
--- a/tests/i915/gem_reset_stats.c
+++ b/tests/i915/gem_reset_stats.c
@@ -41,6 +41,7 @@
 #include <signal.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_ring.h"
 #include "igt.h"
 #include "igt_sysfs.h"
diff --git a/tests/i915/gem_ringfill.c b/tests/i915/gem_ringfill.c
index 78903707..9ad97532 100644
--- a/tests/i915/gem_ringfill.c
+++ b/tests/i915/gem_ringfill.c
@@ -32,6 +32,7 @@
  */
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_ring.h"
 #include "igt.h"
 #include "igt_device.h"
diff --git a/tests/i915/gem_set_tiling_vs_gtt.c b/tests/i915/gem_set_tiling_vs_gtt.c
index f09022c6..2f890e83 100644
--- a/tests/i915/gem_set_tiling_vs_gtt.c
+++ b/tests/i915/gem_set_tiling_vs_gtt.c
@@ -37,7 +37,7 @@
 #include <sys/ioctl.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION("Check set_tiling vs gtt mmap coherency.");
 
diff --git a/tests/i915/gem_set_tiling_vs_pwrite.c b/tests/i915/gem_set_tiling_vs_pwrite.c
index 87909d3c..6bec7f27 100644
--- a/tests/i915/gem_set_tiling_vs_pwrite.c
+++ b/tests/i915/gem_set_tiling_vs_pwrite.c
@@ -37,7 +37,7 @@
 #include <sys/ioctl.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION("Check set_tiling vs pwrite coherency.");
 
diff --git a/tests/i915/gem_shrink.c b/tests/i915/gem_shrink.c
index 2269da49..b6450a6f 100644
--- a/tests/i915/gem_shrink.c
+++ b/tests/i915/gem_shrink.c
@@ -28,6 +28,7 @@
  */
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_gt.h"
 #include "igt_debugfs.h"
diff --git a/tests/i915/gem_softpin.c b/tests/i915/gem_softpin.c
index c3bfd10a..bdb04821 100644
--- a/tests/i915/gem_softpin.c
+++ b/tests/i915/gem_softpin.c
@@ -27,6 +27,7 @@
  */
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "intel_allocator.h"
 
diff --git a/tests/i915/gem_streaming_writes.c b/tests/i915/gem_streaming_writes.c
index b18ff848..c104792b 100644
--- a/tests/i915/gem_streaming_writes.c
+++ b/tests/i915/gem_streaming_writes.c
@@ -38,6 +38,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 
 #define OBJECT_SIZE 1024*1024
diff --git a/tests/i915/gem_sync.c b/tests/i915/gem_sync.c
index 6ad31517..e1b3ab7d 100644
--- a/tests/i915/gem_sync.c
+++ b/tests/i915/gem_sync.c
@@ -25,6 +25,7 @@
 #include <pthread.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_ring.h"
 #include "igt_debugfs.h"
 #include "igt_dummyload.h"
diff --git a/tests/i915/gem_tiled_fence_blits.c b/tests/i915/gem_tiled_fence_blits.c
index 28beea89..6ce3a38d 100644
--- a/tests/i915/gem_tiled_fence_blits.c
+++ b/tests/i915/gem_tiled_fence_blits.c
@@ -42,6 +42,7 @@
  */
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_x86.h"
 
diff --git a/tests/i915/gem_tiled_pread_basic.c b/tests/i915/gem_tiled_pread_basic.c
index 186f630f..2b4cec6e 100644
--- a/tests/i915/gem_tiled_pread_basic.c
+++ b/tests/i915/gem_tiled_pread_basic.c
@@ -47,7 +47,7 @@
 #include <sys/ioctl.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION("Test pread behavior on tiled objects with respect to the"
 		     " reported swizzling value.");
diff --git a/tests/i915/gem_tiled_pread_pwrite.c b/tests/i915/gem_tiled_pread_pwrite.c
index ef1e1b3c..f77cd3bd 100644
--- a/tests/i915/gem_tiled_pread_pwrite.c
+++ b/tests/i915/gem_tiled_pread_pwrite.c
@@ -57,7 +57,7 @@
 #include <sys/ioctl.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION("Test swizzling by testing pwrite does the inverse of"
 		     " pread.");
diff --git a/tests/i915/gem_tiled_swapping.c b/tests/i915/gem_tiled_swapping.c
index 1bcf2fa4..d33b76db 100644
--- a/tests/i915/gem_tiled_swapping.c
+++ b/tests/i915/gem_tiled_swapping.c
@@ -57,7 +57,7 @@
 #include <pthread.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION("Exercise swizzle code for swapping.");
 
diff --git a/tests/i915/gem_tiled_wb.c b/tests/i915/gem_tiled_wb.c
index 2ba424e8..e9efbdf2 100644
--- a/tests/i915/gem_tiled_wb.c
+++ b/tests/i915/gem_tiled_wb.c
@@ -44,7 +44,7 @@
 #include <sys/ioctl.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION("This is a test of write-combining mmap's behavior on"
 		     " tiled objects with respect to the reported swizzling"
diff --git a/tests/i915/gem_tiled_wc.c b/tests/i915/gem_tiled_wc.c
index 898aad40..29ea700e 100644
--- a/tests/i915/gem_tiled_wc.c
+++ b/tests/i915/gem_tiled_wc.c
@@ -44,7 +44,7 @@
 #include <sys/ioctl.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 #define WIDTH 512
 #define HEIGHT 512
diff --git a/tests/i915/gem_tiling_max_stride.c b/tests/i915/gem_tiling_max_stride.c
index 4a273441..513d579d 100644
--- a/tests/i915/gem_tiling_max_stride.c
+++ b/tests/i915/gem_tiling_max_stride.c
@@ -38,7 +38,7 @@
 #include <sys/ioctl.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION("Check that max fence stride works.");
 
diff --git a/tests/i915/gem_unfence_active_buffers.c b/tests/i915/gem_unfence_active_buffers.c
index 887d6177..2c9cebb6 100644
--- a/tests/i915/gem_unfence_active_buffers.c
+++ b/tests/i915/gem_unfence_active_buffers.c
@@ -50,6 +50,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 
 IGT_TEST_DESCRIPTION("Check for use-after-free in the fence stealing code.");
diff --git a/tests/i915/gem_unref_active_buffers.c b/tests/i915/gem_unref_active_buffers.c
index e4a82360..731190b3 100644
--- a/tests/i915/gem_unref_active_buffers.c
+++ b/tests/i915/gem_unref_active_buffers.c
@@ -40,6 +40,7 @@
 
 #include "igt.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION("Test unreferencing of active buffers.");
 
diff --git a/tests/i915/gem_userptr_blits.c b/tests/i915/gem_userptr_blits.c
index 2814e3c3..e0e202c5 100644
--- a/tests/i915/gem_userptr_blits.c
+++ b/tests/i915/gem_userptr_blits.c
@@ -59,6 +59,7 @@
 #include "i915_drm.h"
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_sysfs.h"
 #include "sw_sync.h"
diff --git a/tests/i915/gem_vm_create.c b/tests/i915/gem_vm_create.c
index 6d93c98a..5f982d4d 100644
--- a/tests/i915/gem_vm_create.c
+++ b/tests/i915/gem_vm_create.c
@@ -22,6 +22,7 @@
  */
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_vm.h"
 #include "igt.h"
 #include "igt_rand.h"
diff --git a/tests/i915/gem_wait.c b/tests/i915/gem_wait.c
index 7b2b1c2b..81ac25b5 100644
--- a/tests/i915/gem_wait.c
+++ b/tests/i915/gem_wait.c
@@ -28,6 +28,7 @@
 #include <sys/poll.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_vgem.h"
 
diff --git a/tests/i915/gem_watchdog.c b/tests/i915/gem_watchdog.c
index 8f9fb177..286002bd 100644
--- a/tests/i915/gem_watchdog.c
+++ b/tests/i915/gem_watchdog.c
@@ -30,6 +30,7 @@
 #include <sched.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_params.h"
 #include "sw_sync.h"
diff --git a/tests/i915/gem_workarounds.c b/tests/i915/gem_workarounds.c
index 00b475c2..8312e20a 100644
--- a/tests/i915/gem_workarounds.c
+++ b/tests/i915/gem_workarounds.c
@@ -28,6 +28,7 @@
 #include <fcntl.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_device.h"
 
diff --git a/tests/i915/gen3_mixed_blits.c b/tests/i915/gen3_mixed_blits.c
index 10a8cd3e..184effec 100644
--- a/tests/i915/gen3_mixed_blits.c
+++ b/tests/i915/gen3_mixed_blits.c
@@ -45,6 +45,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915_reg.h"
 #include "igt.h"
 
diff --git a/tests/i915/gen3_render_linear_blits.c b/tests/i915/gen3_render_linear_blits.c
index d88a2c93..f01df69e 100644
--- a/tests/i915/gen3_render_linear_blits.c
+++ b/tests/i915/gen3_render_linear_blits.c
@@ -44,6 +44,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915_reg.h"
 #include "igt.h"
 
diff --git a/tests/i915/gen3_render_mixed_blits.c b/tests/i915/gen3_render_mixed_blits.c
index cda175bd..9ebb93be 100644
--- a/tests/i915/gen3_render_mixed_blits.c
+++ b/tests/i915/gen3_render_mixed_blits.c
@@ -45,6 +45,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915_reg.h"
 #include "igt.h"
 
diff --git a/tests/i915/gen3_render_tiledx_blits.c b/tests/i915/gen3_render_tiledx_blits.c
index 579205f3..b8aa0edc 100644
--- a/tests/i915/gen3_render_tiledx_blits.c
+++ b/tests/i915/gen3_render_tiledx_blits.c
@@ -45,6 +45,7 @@
 
 #include "drm.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915_reg.h"
 #include "igt.h"
 
diff --git a/tests/i915/gen3_render_tiledy_blits.c b/tests/i915/gen3_render_tiledy_blits.c
index 931e91a3..2d1b2d8e 100644
--- a/tests/i915/gen3_render_tiledy_blits.c
+++ b/tests/i915/gen3_render_tiledy_blits.c
@@ -45,6 +45,7 @@
 #include "drm.h"
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915_reg.h"
 #include "igt.h"
 
diff --git a/tests/i915/gen7_exec_parse.c b/tests/i915/gen7_exec_parse.c
index f7201bb9..8326fd5c 100644
--- a/tests/i915/gen7_exec_parse.c
+++ b/tests/i915/gen7_exec_parse.c
@@ -32,6 +32,7 @@
 #include "igt.h"
 #include "igt_device.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "sw_sync.h"
 
 #define DERRMR 0x44050
diff --git a/tests/i915/gen9_exec_parse.c b/tests/i915/gen9_exec_parse.c
index f9de90d2..e10c6ce9 100644
--- a/tests/i915/gen9_exec_parse.c
+++ b/tests/i915/gen9_exec_parse.c
@@ -29,6 +29,7 @@
 #include <stdlib.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_submission.h"
 #include "igt.h"
 #include "sw_sync.h"
diff --git a/tests/i915/i915_hangman.c b/tests/i915/i915_hangman.c
index 72e4d8b8..f6fac283 100644
--- a/tests/i915/i915_hangman.c
+++ b/tests/i915/i915_hangman.c
@@ -33,6 +33,7 @@
 #include <fcntl.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_sysfs.h"
 #include "igt_debugfs.h"
diff --git a/tests/i915/i915_module_load.c b/tests/i915/i915_module_load.c
index 03dec60d..281454a5 100644
--- a/tests/i915/i915_module_load.c
+++ b/tests/i915/i915_module_load.c
@@ -30,7 +30,7 @@
 #include <sys/ioctl.h>
 #include <fcntl.h>
 
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt_debugfs.h"
 #include "igt_aux.h"
 #include "igt_kmod.h"
diff --git a/tests/i915/i915_pm_rc6_residency.c b/tests/i915/i915_pm_rc6_residency.c
index d484121e..bfbe4ab0 100644
--- a/tests/i915/i915_pm_rc6_residency.c
+++ b/tests/i915/i915_pm_rc6_residency.c
@@ -34,6 +34,7 @@
 #include <time.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_perf.h"
 #include "igt_rapl.h"
diff --git a/tests/i915/i915_pm_rpm.c b/tests/i915/i915_pm_rpm.c
index d9ec0388..da498ad6 100644
--- a/tests/i915/i915_pm_rpm.c
+++ b/tests/i915/i915_pm_rpm.c
@@ -46,6 +46,7 @@
 #include <drm.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_kmod.h"
 #include "igt_sysfs.h"
diff --git a/tests/i915/i915_suspend.c b/tests/i915/i915_suspend.c
index 15340edc..da27ce09 100644
--- a/tests/i915/i915_suspend.c
+++ b/tests/i915/i915_suspend.c
@@ -39,6 +39,7 @@
 #include <drm.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_device.h"
 
diff --git a/tests/i915/perf_pmu.c b/tests/i915/perf_pmu.c
index 50b5c82b..172dd161 100644
--- a/tests/i915/perf_pmu.c
+++ b/tests/i915/perf_pmu.c
@@ -39,6 +39,7 @@
 #include <sched.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_core.h"
 #include "igt_device.h"
diff --git a/tests/i915/sysfs_clients.c b/tests/i915/sysfs_clients.c
index 0b7066c0..04636777 100644
--- a/tests/i915/sysfs_clients.c
+++ b/tests/i915/sysfs_clients.c
@@ -19,6 +19,7 @@
 #include "drmtest.h"
 #include "i915/gem.h"
 #include "i915/gem_context.h"
+#include "i915/gem_create.h"
 #include "i915/gem_engine_topology.h"
 #include "i915/gem_mman.h"
 #include "igt_aux.h"
diff --git a/tests/i915/sysfs_timeslice_duration.c b/tests/i915/sysfs_timeslice_duration.c
index 754b7ca6..05ab7966 100644
--- a/tests/i915/sysfs_timeslice_duration.c
+++ b/tests/i915/sysfs_timeslice_duration.c
@@ -32,6 +32,7 @@
 #include "igt_params.h"
 #include "drmtest.h"
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_engine_topology.h"
 #include "i915/gem_mman.h"
 #include "igt_dummyload.h"
diff --git a/tests/kms_big_fb.c b/tests/kms_big_fb.c
index b2027b6b..b35727a0 100644
--- a/tests/kms_big_fb.c
+++ b/tests/kms_big_fb.c
@@ -27,7 +27,7 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION("Test big framebuffers");
 
diff --git a/tests/kms_ccs.c b/tests/kms_ccs.c
index bba49fd8..01e3b979 100644
--- a/tests/kms_ccs.c
+++ b/tests/kms_ccs.c
@@ -24,7 +24,7 @@
 
 #include "igt.h"
 
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 #define SDR_PLANE_BASE	3
 
diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 64907c2c..8f736652 100755
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -42,7 +42,7 @@
 #include <time.h>
 #include <pthread.h>
 
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt_stats.h"
 
 #define TEST_DPMS		(1 << 0)
diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index 65c2ddb5..906caa4c 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -31,6 +31,7 @@
 #include <pthread.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_sysfs.h"
 #include "igt_psr.h"
diff --git a/tests/kms_getfb.c b/tests/kms_getfb.c
index 5f4758c6..917b57bb 100644
--- a/tests/kms_getfb.c
+++ b/tests/kms_getfb.c
@@ -40,7 +40,7 @@
 
 #include "drm.h"
 #include "drm_fourcc.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt_device.h"
 
 IGT_TEST_DESCRIPTION("Tests GETFB and GETFB2 ioctls.");
diff --git a/tests/prime_busy.c b/tests/prime_busy.c
index aec76393..8bf50eaf 100644
--- a/tests/prime_busy.c
+++ b/tests/prime_busy.c
@@ -24,6 +24,7 @@
 #include <sys/poll.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 
 IGT_TEST_DESCRIPTION("Basic check of polling for prime fences.");
diff --git a/tests/prime_mmap.c b/tests/prime_mmap.c
index cdf2d514..a4e4b4b6 100644
--- a/tests/prime_mmap.c
+++ b/tests/prime_mmap.c
@@ -43,7 +43,7 @@
 #include "drm.h"
 #include "drmtest.h"
 #include "i915_drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "i915/gem_mman.h"
 #include "igt_debugfs.h"
 #include "ioctl_wrappers.h"
diff --git a/tests/prime_mmap_kms.c b/tests/prime_mmap_kms.c
index 6cc1db87..1575eeb1 100644
--- a/tests/prime_mmap_kms.c
+++ b/tests/prime_mmap_kms.c
@@ -32,7 +32,7 @@
 
 #include "igt.h"
 
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION(
    "Efficiently sharing CPU and GPU buffers");
diff --git a/tests/prime_self_import.c b/tests/prime_self_import.c
index 4a0a9803..38a55439 100644
--- a/tests/prime_self_import.c
+++ b/tests/prime_self_import.c
@@ -44,7 +44,7 @@
 #include <pthread.h>
 
 #include "drm.h"
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION("Check whether prime import/export works on the same"
 		     " device... but with different fds.");
diff --git a/tests/prime_vgem.c b/tests/prime_vgem.c
index 07ff69a2..aeff282b 100644
--- a/tests/prime_vgem.c
+++ b/tests/prime_vgem.c
@@ -26,6 +26,7 @@
 #include <time.h>
 
 #include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_vgem.h"
 #include "intel_batchbuffer.h"	/* igt_blitter_src_copy() */
diff --git a/tools/intel_reg.c b/tools/intel_reg.c
index da1832be..584a2ccd 100644
--- a/tools/intel_reg.c
+++ b/tools/intel_reg.c
@@ -32,7 +32,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-#include "i915/gem.h"
+#include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_gt.h"
 #include "intel_io.h"
-- 
2.26.3

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [Intel-gfx] [PATCH i-g-t v3 3/9] lib/i915/intel_memory_region: Add new memory region lib
  2021-05-26 13:00 ` [igt-dev] " Matthew Auld
@ 2021-05-26 13:00   ` Matthew Auld
  -1 siblings, 0 replies; 20+ messages in thread
From: Matthew Auld @ 2021-05-26 13:00 UTC (permalink / raw)
  To: igt-dev; +Cc: Dominik Grzegorzek, intel-gfx, Lukasz Kalamarz, Andrzej Turko

From: Andrzej Turko <andrzej.turko@linux.intel.com>

With an introduction of Local Memory concept we should be able to
allocate object in specific memory region. This patch implements
helper functions that allow this, both for querying what the device
supports and hooking into gem_create_ext to select the placements.

Co-authored-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com>
Co-authored-by: Zbigniew Kempczynski <zbigniew.kempczynski@intel.com>
Signed-off-by: Andrzej Turko <andrzej.turko@linux.intel.com>
Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com>
Signed-off-by: Zbigniew Kempczynski <zbigniew.kempczynski@intel.com>
Cc: Zbigniew Kempczynski <zbigniew.kempczynski@intel.com>
Cc: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Acked-by: Petri Latvala <petri.latvala@intel.com>
---
 lib/i915/intel_memory_region.c | 441 +++++++++++++++++++++++++++++++++
 lib/i915/intel_memory_region.h | 130 ++++++++++
 lib/ioctl_wrappers.h           |   1 +
 lib/meson.build                |   1 +
 4 files changed, 573 insertions(+)
 create mode 100644 lib/i915/intel_memory_region.c
 create mode 100644 lib/i915/intel_memory_region.h

diff --git a/lib/i915/intel_memory_region.c b/lib/i915/intel_memory_region.c
new file mode 100644
index 00000000..983ac4df
--- /dev/null
+++ b/lib/i915/intel_memory_region.c
@@ -0,0 +1,441 @@
+/*
+ * Copyright © 2020 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <linux/limits.h>
+#include <signal.h>
+#include <sys/ioctl.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include "i915/gem_create.h"
+#include "intel_reg.h"
+#include "drmtest.h"
+#include "ioctl_wrappers.h"
+#include "igt_dummyload.h"
+#include "igt_gt.h"
+#include "igt_params.h"
+#include "igt_sysfs.h"
+#include "intel_chipset.h"
+#include "igt_collection.h"
+#include "igt_device.h"
+
+#include "i915/intel_memory_region.h"
+
+#define i915_query_items(fd, items, n_items) do { \
+		igt_assert_eq(__i915_query_items(fd, items, n_items), 0); \
+		errno = 0; \
+	} while (0)
+#define i915_query_items_err(fd, items, n_items, err) do { \
+		igt_assert_eq(__i915_query_items(fd, items, n_items), -err); \
+	} while (0)
+
+static int
+__i915_query(int fd, struct drm_i915_query *q)
+{
+	if (igt_ioctl(fd, DRM_IOCTL_I915_QUERY, q))
+		return -errno;
+	return 0;
+}
+
+static int
+__i915_query_items(int fd, struct drm_i915_query_item *items, uint32_t n_items)
+{
+	struct drm_i915_query q = {
+		.num_items = n_items,
+		.items_ptr = to_user_pointer(items),
+	};
+	return __i915_query(fd, &q);
+}
+
+bool gem_has_query_support(int fd)
+{
+	struct drm_i915_query query = {};
+
+	return __i915_query(fd, &query) == 0;
+}
+
+const char *get_memory_region_name(uint32_t region)
+{
+	uint16_t class = MEMORY_TYPE_FROM_REGION(region);
+
+	switch (class) {
+	case I915_MEMORY_CLASS_SYSTEM:
+		return "smem";
+	case I915_MEMORY_CLASS_DEVICE:
+		return "lmem";
+	}
+	igt_assert_f(false, "Unknown memory region");
+}
+
+/**
+ *  gem_get_batch_size:
+ *  @fd: open i915 drm file descriptor
+ *  @mem_region_type: used memory_region type
+ *
+ *  With introduction of LMEM we observe different page sizes for those two
+ *  memory regions. Without this helper funtion we may be prone to forget
+ *  about setting proper page size.
+ */
+uint32_t gem_get_batch_size(int fd, uint8_t mem_region_type)
+{
+	return (mem_region_type == I915_MEMORY_CLASS_DEVICE) ? 65536 : 4096;
+}
+
+/**
+ * gem_get_query_memory_regions:
+ * @fd: open i915 drm file descriptor
+ *
+ * This function wraps query mechanism for memory regions.
+ *
+ * Returns: Filled struct with available memory regions.
+ */
+struct drm_i915_query_memory_regions *gem_get_query_memory_regions(int fd)
+{
+	struct drm_i915_query_item item;
+	struct drm_i915_query_memory_regions *query_info;
+
+	memset(&item, 0, sizeof(item));
+	item.query_id = DRM_I915_QUERY_MEMORY_REGIONS;
+	i915_query_items(fd, &item, 1);
+
+	query_info = calloc(1, item.length);
+
+	item.data_ptr = to_user_pointer(query_info);
+	i915_query_items(fd, &item, 1);
+
+	return query_info;
+}
+
+/**
+ * gem_get_lmem_region_count:
+ * @fd: open i915 drm file descriptor
+ *
+ * Helper function to check how many lmem regions are available on device.
+ *
+ * Returns: Number of found lmem regions.
+ */
+uint8_t gem_get_lmem_region_count(int fd)
+{
+	struct drm_i915_query_memory_regions *query_info;
+	uint8_t num_regions;
+	uint8_t lmem_regions = 0;
+
+	query_info = gem_get_query_memory_regions(fd);
+	num_regions = query_info->num_regions;
+
+	for (int i = 0; i < num_regions; i++) {
+		if (query_info->regions[i].region.memory_class == I915_MEMORY_CLASS_DEVICE)
+			lmem_regions += 1;
+	}
+
+	return lmem_regions;
+}
+
+/**
+ * gem_has_lmem:
+ * @fd: open i915 drm file descriptor
+ *
+ * Helper function to check if lmem is available on device.
+ *
+ * Returns: True if at least one lmem region was found.
+ */
+bool gem_has_lmem(int fd)
+{
+	return gem_get_lmem_region_count(fd) > 0;
+}
+
+/* A version of gem_create_in_memory_region_list which can be allowed to
+   fail so that the object creation can be retried */
+int __gem_create_in_memory_region_list(int fd, uint32_t *handle, uint64_t size,
+				       struct drm_i915_gem_memory_class_instance *mem_regions,
+				       int num_regions)
+{
+	struct drm_i915_gem_create_ext_memory_regions ext_regions = {
+		.base = { .name = I915_GEM_CREATE_EXT_MEMORY_REGIONS },
+		.num_regions = num_regions,
+		.regions = to_user_pointer(mem_regions),
+	};
+
+	return __gem_create_ext(fd, &size, handle, &ext_regions.base);
+}
+
+/* gem_create_in_memory_region_list:
+ * @fd: opened i915 drm file descriptor
+ * @size: requested size of the buffer
+ * @mem_regions: memory regions array (priority list)
+ * @num_regions: @mem_regions length
+ */
+uint32_t gem_create_in_memory_region_list(int fd, uint64_t size,
+					  struct drm_i915_gem_memory_class_instance *mem_regions,
+					  int num_regions)
+{
+	uint32_t handle;
+	int ret = __gem_create_in_memory_region_list(fd, &handle, size,
+						     mem_regions, num_regions);
+	igt_assert_eq(ret, 0);
+	return handle;
+}
+
+static bool __region_belongs_to_regions_type(struct drm_i915_gem_memory_class_instance region,
+					     uint32_t *mem_regions_type,
+					     int num_regions)
+{
+	for (int i = 0; i < num_regions; i++)
+		if (mem_regions_type[i] == region.memory_class)
+			return true;
+	return false;
+}
+
+struct igt_collection *
+__get_memory_region_set(struct drm_i915_query_memory_regions *regions,
+			uint32_t *mem_regions_type,
+			int num_regions)
+{
+	struct drm_i915_gem_memory_class_instance region;
+	struct igt_collection *set;
+	int count = 0, pos = 0;
+
+	for (int i = 0; i < regions->num_regions; i++) {
+		region = regions->regions[i].region;
+		if (__region_belongs_to_regions_type(region,
+						     mem_regions_type,
+						     num_regions))
+			count++;
+	}
+
+	set = igt_collection_create(count);
+
+	for (int i = 0; i < regions->num_regions; i++) {
+		region = regions->regions[i].region;
+		if (__region_belongs_to_regions_type(region,
+						     mem_regions_type,
+						     num_regions))
+			igt_collection_set_value(set, pos++,
+						 INTEL_MEMORY_REGION_ID(region.memory_class,
+									region.memory_instance));
+	}
+
+	igt_assert(count == pos);
+
+	return set;
+}
+
+/**
+  * memregion_dynamic_subtest_name:
+  * @igt_collection: memory region collection
+  *
+  * Function iterates over all memory regions inside the collection (keeped
+  * in the value field) and generates the name which can be used during dynamic
+  * subtest creation.
+  *
+  * Returns: newly allocated string, has to be freed by caller. Asserts if
+  * caller tries to create a name using empty collection.
+  */
+char *memregion_dynamic_subtest_name(struct igt_collection *set)
+{
+	struct igt_collection_data *data;
+	char *name, *p;
+	uint32_t region, len;
+
+	igt_assert(set && set->size);
+	/* enough for "name%d-" * n */
+	len = set->size * 8;
+	p = name = malloc(len);
+	igt_assert(name);
+
+	for_each_collection_data(data, set) {
+		int r;
+
+		region = data->value;
+		if (IS_DEVICE_MEMORY_REGION(region))
+			r = snprintf(p, len, "%s%d-",
+				     get_memory_region_name(region),
+				     MEMORY_INSTANCE_FROM_REGION(region));
+		else
+			r = snprintf(p, len, "%s-",
+				     get_memory_region_name(region));
+
+		igt_assert(r > 0);
+		p += r;
+		len -= r;
+	}
+
+	/* remove last '-' */
+	*(p - 1) = 0;
+
+	return name;
+}
+
+/**
+ * intel_dump_gpu_meminfo:
+ * @info: pointer to drm_i915_query_memory_regions structure
+ *
+ * Outputs memory regions and their sizes.
+ */
+void intel_dump_gpu_meminfo(struct drm_i915_query_memory_regions *info)
+{
+	int i;
+
+	igt_assert(info);
+
+	igt_info("GPU meminfo:\n");
+
+	for (i = 0; i < info->num_regions; i++) {
+		uint32_t region = INTEL_MEMORY_REGION_ID(info->regions[i].region.memory_class,
+							 info->regions[i].region.memory_instance);
+		const char *name = get_memory_region_name(region);
+
+		igt_info("- %s [%d] memory [size: 0x%llx, available: 0x%llx]\n",
+			 name, info->regions[i].region.memory_instance,
+			 info->regions[i].probed_size,
+			 info->regions[i].unallocated_size);
+	}
+}
+
+/**
+ * gpu_meminfo_region_count:
+ * @info: pointer to drm_i915_query_memory_regions structure
+ * @memory_class: memory region class
+ *
+ * Returns: number of regions for type @memory_class
+ */
+uint32_t gpu_meminfo_region_count(struct drm_i915_query_memory_regions *info,
+				  uint16_t memory_class)
+{
+	uint32_t num = 0;
+	int i;
+
+	igt_assert(info);
+
+	for (i = 0; i < info->num_regions; i++)
+		if (info->regions[i].region.memory_class == memory_class)
+			num++;
+
+	return num;
+}
+
+/**
+ * gpu_meminfo_region_total_size:
+ * @info: pointer to drm_i915_query_memory_regions structure
+ * @memory_class: memory region class
+ *
+ * Returns: total size of all regions which are type @memory_class, -1 when the
+ * size of at least one region is unknown
+ */
+uint64_t gpu_meminfo_region_total_size(struct drm_i915_query_memory_regions *info,
+				       uint16_t memory_class)
+{
+	uint64_t total = 0;
+	int i;
+
+	igt_assert(info);
+
+	for (i = 0; i < info->num_regions; i++)
+		if (info->regions[i].region.memory_class == memory_class) {
+			if (info->regions[i].probed_size == -1)
+				return -1;
+
+			total += info->regions[i].probed_size;
+		}
+
+	return total;
+}
+
+/**
+ * gpu_meminfo_region_total_available:
+ * @info: pointer to drm_i915_query_memory_regions structure
+ * @memory_class: memory region class
+ *
+ * Returns: available size of all regions which are type @memory_class, -1 when
+ * the size of at least one region cannot be estimated
+ */
+uint64_t gpu_meminfo_region_total_available(struct drm_i915_query_memory_regions *info,
+					    uint16_t memory_class)
+{
+	uint64_t avail = 0;
+	int i;
+
+	igt_assert(info);
+
+	for (i = 0; i < info->num_regions; i++)
+		if (info->regions[i].region.memory_class == memory_class) {
+			if (info->regions[i].unallocated_size == -1)
+				return -1;
+
+			avail += info->regions[i].unallocated_size;
+		}
+
+	return avail;
+}
+
+/**
+ * gpu_meminfo_region_size:
+ * @info: pointer to drm_i915_query_memory_regions structure
+ * @memory_class: memory region class
+ * @memory_instance: memory region instance
+ *
+ * Returns: available size of @memory_instance which type is @memory_class, -1
+ * when the size is unknown
+ */
+uint64_t gpu_meminfo_region_size(struct drm_i915_query_memory_regions *info,
+				 uint16_t memory_class,
+				 uint16_t memory_instance)
+{
+	int i;
+
+	igt_assert(info);
+
+	for (i = 0; i < info->num_regions; i++)
+		if (info->regions[i].region.memory_class == memory_class &&
+		     info->regions[i].region.memory_instance == memory_instance)
+			return info->regions[i].probed_size;
+
+	return 0;
+}
+
+/**
+ * gpu_meminfo_region_available:
+ * @info: pointer to drm_i915_query_memory_regions structure
+ * @memory_class: memory region class
+ * @memory_instance: memory region instance
+ *
+ * Returns: available size of @memory_instance region which type is
+ * @memory_class, -1 when the size cannot be estimated
+ */
+uint64_t gpu_meminfo_region_available(struct drm_i915_query_memory_regions *info,
+				      uint16_t memory_class,
+				      uint16_t memory_instance)
+{
+	int i;
+
+	igt_assert(info);
+
+	for (i = 0; i < info->num_regions; i++)
+		if (info->regions[i].region.memory_class == memory_class &&
+		     info->regions[i].region.memory_instance == memory_instance)
+			return info->regions[i].unallocated_size;
+
+	return 0;
+}
diff --git a/lib/i915/intel_memory_region.h b/lib/i915/intel_memory_region.h
new file mode 100644
index 00000000..e9d1d66d
--- /dev/null
+++ b/lib/i915/intel_memory_region.h
@@ -0,0 +1,130 @@
+/*
+ * Copyright © 2020 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+#include "igt_collection.h"
+
+#ifndef INTEL_MEMORY_REGION_H
+#define INTEL_MEMORY_REGION_H
+
+#define I915_SYSTEM_MEMORY I915_MEMORY_CLASS_SYSTEM
+#define I915_DEVICE_MEMORY I915_MEMORY_CLASS_DEVICE
+#define I915_STOLEN_SYSTEM_MEMORY I915_MEMORY_CLASS_STOLEN_SYSTEM
+#define I915_STOLEN_DEVICE_MEMORY I915_MEMORY_CLASS_STOLEN_DEVICE
+
+#define INTEL_MEMORY_REGION_ID(type, instance) ((type) << 16u | (instance))
+#define MEMORY_TYPE_FROM_REGION(r) ((r) >> 16u)
+#define MEMORY_INSTANCE_FROM_REGION(r) ((r) & 0xffff)
+
+#define IS_MEMORY_REGION_TYPE(region, type) \
+	(MEMORY_TYPE_FROM_REGION(region) == type)
+
+#define IS_DEVICE_MEMORY_REGION(region) \
+	IS_MEMORY_REGION_TYPE(region, I915_MEMORY_CLASS_DEVICE)
+#define IS_SYSTEM_MEMORY_REGION(region) \
+	IS_MEMORY_REGION_TYPE(region, I915_MEMORY_CLASS_SYSTEM)
+
+#define IS_STOLEN_MEMORY_REGION(region) \
+	(IS_MEMORY_REGION_TYPE(region, I915_MEMORY_CLASS_STOLEN_SYSTEM) || \
+	 IS_MEMORY_REGION_TYPE(region, I915_MEMORY_CLASS_STOLEN_DEVICE))
+
+#define REGION_SMEM    INTEL_MEMORY_REGION_ID(I915_MEMORY_CLASS_SYSTEM, 0)
+#define REGION_LMEM(n) INTEL_MEMORY_REGION_ID(I915_MEMORY_CLASS_DEVICE, (n))
+#define REGION_STLN_SMEM(n) INTEL_MEMORY_REGION_ID(I915_MEMORY_CLASS_STOLEN_SYSTEM, (n))
+#define REGION_STLN_LMEM(n) INTEL_MEMORY_REGION_ID(I915_MEMORY_CLASS_STOLEN_DEVICE, (n))
+
+bool gem_has_query_support(int fd);
+
+const char *get_memory_region_name(uint32_t region);
+uint32_t gem_get_batch_size(int fd, uint8_t mem_region_type);
+
+struct drm_i915_query_memory_regions *gem_get_query_memory_regions(int fd);
+
+uint8_t gem_get_lmem_region_count(int fd);
+
+bool gem_has_lmem(int fd);
+
+int __gem_create_in_memory_region_list(int fd, uint32_t *handle, uint64_t size,
+				       struct drm_i915_gem_memory_class_instance *mem_regions,
+				       int num_regions);
+
+uint32_t gem_create_in_memory_region_list(int fd, uint64_t size,
+					  struct drm_i915_gem_memory_class_instance *mem_regions,
+					  int num_regions);
+
+/*
+ * XXX: the whole converting to class_instance thing is meant as a temporary
+ * stop gap which should keep everything working, such that we don't have to
+ * rewrite the world in one go to fit the new uAPI.
+ */
+#define __gem_create_in_memory_regions(fd, handle, size, regions...) ({ \
+	unsigned int arr__[] = { regions }; \
+	struct drm_i915_gem_memory_class_instance arr_query__[ARRAY_SIZE(arr__)]; \
+	for (int i__  = 0; i__ < ARRAY_SIZE(arr_query__); ++i__) { \
+		arr_query__[i__].memory_class = MEMORY_TYPE_FROM_REGION(arr__[i__]);  \
+		arr_query__[i__].memory_instance = MEMORY_INSTANCE_FROM_REGION(arr__[i__]);  \
+	} \
+	__gem_create_in_memory_region_list(fd, handle, size, arr_query__, ARRAY_SIZE(arr_query__)); \
+})
+#define gem_create_in_memory_regions(fd, size, regions...) ({ \
+	unsigned int arr__[] = { regions }; \
+	struct drm_i915_gem_memory_class_instance arr_query__[ARRAY_SIZE(arr__)]; \
+	for (int i__  = 0; i__ < ARRAY_SIZE(arr_query__); ++i__) { \
+		arr_query__[i__].memory_class = MEMORY_TYPE_FROM_REGION(arr__[i__]);  \
+		arr_query__[i__].memory_instance = MEMORY_INSTANCE_FROM_REGION(arr__[i__]);  \
+	} \
+	gem_create_in_memory_region_list(fd, size, arr_query__, ARRAY_SIZE(arr_query__)); \
+})
+
+struct igt_collection *
+__get_memory_region_set(struct drm_i915_query_memory_regions *regions,
+			uint32_t *mem_regions_type,
+			int num_regions);
+
+/*
+ * Helper macro to create igt_collection which contains all memory regions
+ * which matches mem_region_types array. Useful to filter out stolen memory
+ * from accessible memory regions.
+ */
+#define get_memory_region_set(regions, mem_region_types...) ({ \
+	unsigned int arr__[] = { mem_region_types }; \
+	__get_memory_region_set(regions, arr__, ARRAY_SIZE(arr__)); \
+})
+
+char *memregion_dynamic_subtest_name(struct igt_collection *set);
+
+void intel_dump_gpu_meminfo(struct drm_i915_query_memory_regions *info);
+
+uint32_t gpu_meminfo_region_count(struct drm_i915_query_memory_regions *info,
+				  uint16_t region_class);
+uint64_t gpu_meminfo_region_total_size(struct drm_i915_query_memory_regions *info,
+				       uint16_t region_class);
+uint64_t gpu_meminfo_region_total_available(struct drm_i915_query_memory_regions *info,
+					    uint16_t region_type);
+
+uint64_t gpu_meminfo_region_size(struct drm_i915_query_memory_regions *info,
+				 uint16_t memory_class,
+				 uint16_t memory_instance);
+uint64_t gpu_meminfo_region_available(struct drm_i915_query_memory_regions *info,
+				      uint16_t memory_class,
+				      uint16_t memory_instance);
+
+#endif /* INTEL_MEMORY_REGION_H */
diff --git a/lib/ioctl_wrappers.h b/lib/ioctl_wrappers.h
index 9ea67365..36640e30 100644
--- a/lib/ioctl_wrappers.h
+++ b/lib/ioctl_wrappers.h
@@ -38,6 +38,7 @@
 
 #include "i915/gem_context.h"
 #include "i915/gem_scheduler.h"
+#include "i915/intel_memory_region.h"
 
 /**
  * igt_ioctl:
diff --git a/lib/meson.build b/lib/meson.build
index d5a1c970..078a357b 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -10,6 +10,7 @@ lib_sources = [
 	'i915/gem_ring.c',
 	'i915/gem_mman.c',
 	'i915/gem_vm.c',
+	'i915/intel_memory_region.c',
 	'igt_collection.c',
 	'igt_color_encoding.c',
 	'igt_debugfs.c',
-- 
2.26.3

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

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

* [igt-dev] [PATCH i-g-t v3 3/9] lib/i915/intel_memory_region: Add new memory region lib
@ 2021-05-26 13:00   ` Matthew Auld
  0 siblings, 0 replies; 20+ messages in thread
From: Matthew Auld @ 2021-05-26 13:00 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala, intel-gfx, Lukasz Kalamarz

From: Andrzej Turko <andrzej.turko@linux.intel.com>

With an introduction of Local Memory concept we should be able to
allocate object in specific memory region. This patch implements
helper functions that allow this, both for querying what the device
supports and hooking into gem_create_ext to select the placements.

Co-authored-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com>
Co-authored-by: Zbigniew Kempczynski <zbigniew.kempczynski@intel.com>
Signed-off-by: Andrzej Turko <andrzej.turko@linux.intel.com>
Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com>
Signed-off-by: Zbigniew Kempczynski <zbigniew.kempczynski@intel.com>
Cc: Zbigniew Kempczynski <zbigniew.kempczynski@intel.com>
Cc: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Acked-by: Petri Latvala <petri.latvala@intel.com>
---
 lib/i915/intel_memory_region.c | 441 +++++++++++++++++++++++++++++++++
 lib/i915/intel_memory_region.h | 130 ++++++++++
 lib/ioctl_wrappers.h           |   1 +
 lib/meson.build                |   1 +
 4 files changed, 573 insertions(+)
 create mode 100644 lib/i915/intel_memory_region.c
 create mode 100644 lib/i915/intel_memory_region.h

diff --git a/lib/i915/intel_memory_region.c b/lib/i915/intel_memory_region.c
new file mode 100644
index 00000000..983ac4df
--- /dev/null
+++ b/lib/i915/intel_memory_region.c
@@ -0,0 +1,441 @@
+/*
+ * Copyright © 2020 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <linux/limits.h>
+#include <signal.h>
+#include <sys/ioctl.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include "i915/gem_create.h"
+#include "intel_reg.h"
+#include "drmtest.h"
+#include "ioctl_wrappers.h"
+#include "igt_dummyload.h"
+#include "igt_gt.h"
+#include "igt_params.h"
+#include "igt_sysfs.h"
+#include "intel_chipset.h"
+#include "igt_collection.h"
+#include "igt_device.h"
+
+#include "i915/intel_memory_region.h"
+
+#define i915_query_items(fd, items, n_items) do { \
+		igt_assert_eq(__i915_query_items(fd, items, n_items), 0); \
+		errno = 0; \
+	} while (0)
+#define i915_query_items_err(fd, items, n_items, err) do { \
+		igt_assert_eq(__i915_query_items(fd, items, n_items), -err); \
+	} while (0)
+
+static int
+__i915_query(int fd, struct drm_i915_query *q)
+{
+	if (igt_ioctl(fd, DRM_IOCTL_I915_QUERY, q))
+		return -errno;
+	return 0;
+}
+
+static int
+__i915_query_items(int fd, struct drm_i915_query_item *items, uint32_t n_items)
+{
+	struct drm_i915_query q = {
+		.num_items = n_items,
+		.items_ptr = to_user_pointer(items),
+	};
+	return __i915_query(fd, &q);
+}
+
+bool gem_has_query_support(int fd)
+{
+	struct drm_i915_query query = {};
+
+	return __i915_query(fd, &query) == 0;
+}
+
+const char *get_memory_region_name(uint32_t region)
+{
+	uint16_t class = MEMORY_TYPE_FROM_REGION(region);
+
+	switch (class) {
+	case I915_MEMORY_CLASS_SYSTEM:
+		return "smem";
+	case I915_MEMORY_CLASS_DEVICE:
+		return "lmem";
+	}
+	igt_assert_f(false, "Unknown memory region");
+}
+
+/**
+ *  gem_get_batch_size:
+ *  @fd: open i915 drm file descriptor
+ *  @mem_region_type: used memory_region type
+ *
+ *  With introduction of LMEM we observe different page sizes for those two
+ *  memory regions. Without this helper funtion we may be prone to forget
+ *  about setting proper page size.
+ */
+uint32_t gem_get_batch_size(int fd, uint8_t mem_region_type)
+{
+	return (mem_region_type == I915_MEMORY_CLASS_DEVICE) ? 65536 : 4096;
+}
+
+/**
+ * gem_get_query_memory_regions:
+ * @fd: open i915 drm file descriptor
+ *
+ * This function wraps query mechanism for memory regions.
+ *
+ * Returns: Filled struct with available memory regions.
+ */
+struct drm_i915_query_memory_regions *gem_get_query_memory_regions(int fd)
+{
+	struct drm_i915_query_item item;
+	struct drm_i915_query_memory_regions *query_info;
+
+	memset(&item, 0, sizeof(item));
+	item.query_id = DRM_I915_QUERY_MEMORY_REGIONS;
+	i915_query_items(fd, &item, 1);
+
+	query_info = calloc(1, item.length);
+
+	item.data_ptr = to_user_pointer(query_info);
+	i915_query_items(fd, &item, 1);
+
+	return query_info;
+}
+
+/**
+ * gem_get_lmem_region_count:
+ * @fd: open i915 drm file descriptor
+ *
+ * Helper function to check how many lmem regions are available on device.
+ *
+ * Returns: Number of found lmem regions.
+ */
+uint8_t gem_get_lmem_region_count(int fd)
+{
+	struct drm_i915_query_memory_regions *query_info;
+	uint8_t num_regions;
+	uint8_t lmem_regions = 0;
+
+	query_info = gem_get_query_memory_regions(fd);
+	num_regions = query_info->num_regions;
+
+	for (int i = 0; i < num_regions; i++) {
+		if (query_info->regions[i].region.memory_class == I915_MEMORY_CLASS_DEVICE)
+			lmem_regions += 1;
+	}
+
+	return lmem_regions;
+}
+
+/**
+ * gem_has_lmem:
+ * @fd: open i915 drm file descriptor
+ *
+ * Helper function to check if lmem is available on device.
+ *
+ * Returns: True if at least one lmem region was found.
+ */
+bool gem_has_lmem(int fd)
+{
+	return gem_get_lmem_region_count(fd) > 0;
+}
+
+/* A version of gem_create_in_memory_region_list which can be allowed to
+   fail so that the object creation can be retried */
+int __gem_create_in_memory_region_list(int fd, uint32_t *handle, uint64_t size,
+				       struct drm_i915_gem_memory_class_instance *mem_regions,
+				       int num_regions)
+{
+	struct drm_i915_gem_create_ext_memory_regions ext_regions = {
+		.base = { .name = I915_GEM_CREATE_EXT_MEMORY_REGIONS },
+		.num_regions = num_regions,
+		.regions = to_user_pointer(mem_regions),
+	};
+
+	return __gem_create_ext(fd, &size, handle, &ext_regions.base);
+}
+
+/* gem_create_in_memory_region_list:
+ * @fd: opened i915 drm file descriptor
+ * @size: requested size of the buffer
+ * @mem_regions: memory regions array (priority list)
+ * @num_regions: @mem_regions length
+ */
+uint32_t gem_create_in_memory_region_list(int fd, uint64_t size,
+					  struct drm_i915_gem_memory_class_instance *mem_regions,
+					  int num_regions)
+{
+	uint32_t handle;
+	int ret = __gem_create_in_memory_region_list(fd, &handle, size,
+						     mem_regions, num_regions);
+	igt_assert_eq(ret, 0);
+	return handle;
+}
+
+static bool __region_belongs_to_regions_type(struct drm_i915_gem_memory_class_instance region,
+					     uint32_t *mem_regions_type,
+					     int num_regions)
+{
+	for (int i = 0; i < num_regions; i++)
+		if (mem_regions_type[i] == region.memory_class)
+			return true;
+	return false;
+}
+
+struct igt_collection *
+__get_memory_region_set(struct drm_i915_query_memory_regions *regions,
+			uint32_t *mem_regions_type,
+			int num_regions)
+{
+	struct drm_i915_gem_memory_class_instance region;
+	struct igt_collection *set;
+	int count = 0, pos = 0;
+
+	for (int i = 0; i < regions->num_regions; i++) {
+		region = regions->regions[i].region;
+		if (__region_belongs_to_regions_type(region,
+						     mem_regions_type,
+						     num_regions))
+			count++;
+	}
+
+	set = igt_collection_create(count);
+
+	for (int i = 0; i < regions->num_regions; i++) {
+		region = regions->regions[i].region;
+		if (__region_belongs_to_regions_type(region,
+						     mem_regions_type,
+						     num_regions))
+			igt_collection_set_value(set, pos++,
+						 INTEL_MEMORY_REGION_ID(region.memory_class,
+									region.memory_instance));
+	}
+
+	igt_assert(count == pos);
+
+	return set;
+}
+
+/**
+  * memregion_dynamic_subtest_name:
+  * @igt_collection: memory region collection
+  *
+  * Function iterates over all memory regions inside the collection (keeped
+  * in the value field) and generates the name which can be used during dynamic
+  * subtest creation.
+  *
+  * Returns: newly allocated string, has to be freed by caller. Asserts if
+  * caller tries to create a name using empty collection.
+  */
+char *memregion_dynamic_subtest_name(struct igt_collection *set)
+{
+	struct igt_collection_data *data;
+	char *name, *p;
+	uint32_t region, len;
+
+	igt_assert(set && set->size);
+	/* enough for "name%d-" * n */
+	len = set->size * 8;
+	p = name = malloc(len);
+	igt_assert(name);
+
+	for_each_collection_data(data, set) {
+		int r;
+
+		region = data->value;
+		if (IS_DEVICE_MEMORY_REGION(region))
+			r = snprintf(p, len, "%s%d-",
+				     get_memory_region_name(region),
+				     MEMORY_INSTANCE_FROM_REGION(region));
+		else
+			r = snprintf(p, len, "%s-",
+				     get_memory_region_name(region));
+
+		igt_assert(r > 0);
+		p += r;
+		len -= r;
+	}
+
+	/* remove last '-' */
+	*(p - 1) = 0;
+
+	return name;
+}
+
+/**
+ * intel_dump_gpu_meminfo:
+ * @info: pointer to drm_i915_query_memory_regions structure
+ *
+ * Outputs memory regions and their sizes.
+ */
+void intel_dump_gpu_meminfo(struct drm_i915_query_memory_regions *info)
+{
+	int i;
+
+	igt_assert(info);
+
+	igt_info("GPU meminfo:\n");
+
+	for (i = 0; i < info->num_regions; i++) {
+		uint32_t region = INTEL_MEMORY_REGION_ID(info->regions[i].region.memory_class,
+							 info->regions[i].region.memory_instance);
+		const char *name = get_memory_region_name(region);
+
+		igt_info("- %s [%d] memory [size: 0x%llx, available: 0x%llx]\n",
+			 name, info->regions[i].region.memory_instance,
+			 info->regions[i].probed_size,
+			 info->regions[i].unallocated_size);
+	}
+}
+
+/**
+ * gpu_meminfo_region_count:
+ * @info: pointer to drm_i915_query_memory_regions structure
+ * @memory_class: memory region class
+ *
+ * Returns: number of regions for type @memory_class
+ */
+uint32_t gpu_meminfo_region_count(struct drm_i915_query_memory_regions *info,
+				  uint16_t memory_class)
+{
+	uint32_t num = 0;
+	int i;
+
+	igt_assert(info);
+
+	for (i = 0; i < info->num_regions; i++)
+		if (info->regions[i].region.memory_class == memory_class)
+			num++;
+
+	return num;
+}
+
+/**
+ * gpu_meminfo_region_total_size:
+ * @info: pointer to drm_i915_query_memory_regions structure
+ * @memory_class: memory region class
+ *
+ * Returns: total size of all regions which are type @memory_class, -1 when the
+ * size of at least one region is unknown
+ */
+uint64_t gpu_meminfo_region_total_size(struct drm_i915_query_memory_regions *info,
+				       uint16_t memory_class)
+{
+	uint64_t total = 0;
+	int i;
+
+	igt_assert(info);
+
+	for (i = 0; i < info->num_regions; i++)
+		if (info->regions[i].region.memory_class == memory_class) {
+			if (info->regions[i].probed_size == -1)
+				return -1;
+
+			total += info->regions[i].probed_size;
+		}
+
+	return total;
+}
+
+/**
+ * gpu_meminfo_region_total_available:
+ * @info: pointer to drm_i915_query_memory_regions structure
+ * @memory_class: memory region class
+ *
+ * Returns: available size of all regions which are type @memory_class, -1 when
+ * the size of at least one region cannot be estimated
+ */
+uint64_t gpu_meminfo_region_total_available(struct drm_i915_query_memory_regions *info,
+					    uint16_t memory_class)
+{
+	uint64_t avail = 0;
+	int i;
+
+	igt_assert(info);
+
+	for (i = 0; i < info->num_regions; i++)
+		if (info->regions[i].region.memory_class == memory_class) {
+			if (info->regions[i].unallocated_size == -1)
+				return -1;
+
+			avail += info->regions[i].unallocated_size;
+		}
+
+	return avail;
+}
+
+/**
+ * gpu_meminfo_region_size:
+ * @info: pointer to drm_i915_query_memory_regions structure
+ * @memory_class: memory region class
+ * @memory_instance: memory region instance
+ *
+ * Returns: available size of @memory_instance which type is @memory_class, -1
+ * when the size is unknown
+ */
+uint64_t gpu_meminfo_region_size(struct drm_i915_query_memory_regions *info,
+				 uint16_t memory_class,
+				 uint16_t memory_instance)
+{
+	int i;
+
+	igt_assert(info);
+
+	for (i = 0; i < info->num_regions; i++)
+		if (info->regions[i].region.memory_class == memory_class &&
+		     info->regions[i].region.memory_instance == memory_instance)
+			return info->regions[i].probed_size;
+
+	return 0;
+}
+
+/**
+ * gpu_meminfo_region_available:
+ * @info: pointer to drm_i915_query_memory_regions structure
+ * @memory_class: memory region class
+ * @memory_instance: memory region instance
+ *
+ * Returns: available size of @memory_instance region which type is
+ * @memory_class, -1 when the size cannot be estimated
+ */
+uint64_t gpu_meminfo_region_available(struct drm_i915_query_memory_regions *info,
+				      uint16_t memory_class,
+				      uint16_t memory_instance)
+{
+	int i;
+
+	igt_assert(info);
+
+	for (i = 0; i < info->num_regions; i++)
+		if (info->regions[i].region.memory_class == memory_class &&
+		     info->regions[i].region.memory_instance == memory_instance)
+			return info->regions[i].unallocated_size;
+
+	return 0;
+}
diff --git a/lib/i915/intel_memory_region.h b/lib/i915/intel_memory_region.h
new file mode 100644
index 00000000..e9d1d66d
--- /dev/null
+++ b/lib/i915/intel_memory_region.h
@@ -0,0 +1,130 @@
+/*
+ * Copyright © 2020 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+#include "igt_collection.h"
+
+#ifndef INTEL_MEMORY_REGION_H
+#define INTEL_MEMORY_REGION_H
+
+#define I915_SYSTEM_MEMORY I915_MEMORY_CLASS_SYSTEM
+#define I915_DEVICE_MEMORY I915_MEMORY_CLASS_DEVICE
+#define I915_STOLEN_SYSTEM_MEMORY I915_MEMORY_CLASS_STOLEN_SYSTEM
+#define I915_STOLEN_DEVICE_MEMORY I915_MEMORY_CLASS_STOLEN_DEVICE
+
+#define INTEL_MEMORY_REGION_ID(type, instance) ((type) << 16u | (instance))
+#define MEMORY_TYPE_FROM_REGION(r) ((r) >> 16u)
+#define MEMORY_INSTANCE_FROM_REGION(r) ((r) & 0xffff)
+
+#define IS_MEMORY_REGION_TYPE(region, type) \
+	(MEMORY_TYPE_FROM_REGION(region) == type)
+
+#define IS_DEVICE_MEMORY_REGION(region) \
+	IS_MEMORY_REGION_TYPE(region, I915_MEMORY_CLASS_DEVICE)
+#define IS_SYSTEM_MEMORY_REGION(region) \
+	IS_MEMORY_REGION_TYPE(region, I915_MEMORY_CLASS_SYSTEM)
+
+#define IS_STOLEN_MEMORY_REGION(region) \
+	(IS_MEMORY_REGION_TYPE(region, I915_MEMORY_CLASS_STOLEN_SYSTEM) || \
+	 IS_MEMORY_REGION_TYPE(region, I915_MEMORY_CLASS_STOLEN_DEVICE))
+
+#define REGION_SMEM    INTEL_MEMORY_REGION_ID(I915_MEMORY_CLASS_SYSTEM, 0)
+#define REGION_LMEM(n) INTEL_MEMORY_REGION_ID(I915_MEMORY_CLASS_DEVICE, (n))
+#define REGION_STLN_SMEM(n) INTEL_MEMORY_REGION_ID(I915_MEMORY_CLASS_STOLEN_SYSTEM, (n))
+#define REGION_STLN_LMEM(n) INTEL_MEMORY_REGION_ID(I915_MEMORY_CLASS_STOLEN_DEVICE, (n))
+
+bool gem_has_query_support(int fd);
+
+const char *get_memory_region_name(uint32_t region);
+uint32_t gem_get_batch_size(int fd, uint8_t mem_region_type);
+
+struct drm_i915_query_memory_regions *gem_get_query_memory_regions(int fd);
+
+uint8_t gem_get_lmem_region_count(int fd);
+
+bool gem_has_lmem(int fd);
+
+int __gem_create_in_memory_region_list(int fd, uint32_t *handle, uint64_t size,
+				       struct drm_i915_gem_memory_class_instance *mem_regions,
+				       int num_regions);
+
+uint32_t gem_create_in_memory_region_list(int fd, uint64_t size,
+					  struct drm_i915_gem_memory_class_instance *mem_regions,
+					  int num_regions);
+
+/*
+ * XXX: the whole converting to class_instance thing is meant as a temporary
+ * stop gap which should keep everything working, such that we don't have to
+ * rewrite the world in one go to fit the new uAPI.
+ */
+#define __gem_create_in_memory_regions(fd, handle, size, regions...) ({ \
+	unsigned int arr__[] = { regions }; \
+	struct drm_i915_gem_memory_class_instance arr_query__[ARRAY_SIZE(arr__)]; \
+	for (int i__  = 0; i__ < ARRAY_SIZE(arr_query__); ++i__) { \
+		arr_query__[i__].memory_class = MEMORY_TYPE_FROM_REGION(arr__[i__]);  \
+		arr_query__[i__].memory_instance = MEMORY_INSTANCE_FROM_REGION(arr__[i__]);  \
+	} \
+	__gem_create_in_memory_region_list(fd, handle, size, arr_query__, ARRAY_SIZE(arr_query__)); \
+})
+#define gem_create_in_memory_regions(fd, size, regions...) ({ \
+	unsigned int arr__[] = { regions }; \
+	struct drm_i915_gem_memory_class_instance arr_query__[ARRAY_SIZE(arr__)]; \
+	for (int i__  = 0; i__ < ARRAY_SIZE(arr_query__); ++i__) { \
+		arr_query__[i__].memory_class = MEMORY_TYPE_FROM_REGION(arr__[i__]);  \
+		arr_query__[i__].memory_instance = MEMORY_INSTANCE_FROM_REGION(arr__[i__]);  \
+	} \
+	gem_create_in_memory_region_list(fd, size, arr_query__, ARRAY_SIZE(arr_query__)); \
+})
+
+struct igt_collection *
+__get_memory_region_set(struct drm_i915_query_memory_regions *regions,
+			uint32_t *mem_regions_type,
+			int num_regions);
+
+/*
+ * Helper macro to create igt_collection which contains all memory regions
+ * which matches mem_region_types array. Useful to filter out stolen memory
+ * from accessible memory regions.
+ */
+#define get_memory_region_set(regions, mem_region_types...) ({ \
+	unsigned int arr__[] = { mem_region_types }; \
+	__get_memory_region_set(regions, arr__, ARRAY_SIZE(arr__)); \
+})
+
+char *memregion_dynamic_subtest_name(struct igt_collection *set);
+
+void intel_dump_gpu_meminfo(struct drm_i915_query_memory_regions *info);
+
+uint32_t gpu_meminfo_region_count(struct drm_i915_query_memory_regions *info,
+				  uint16_t region_class);
+uint64_t gpu_meminfo_region_total_size(struct drm_i915_query_memory_regions *info,
+				       uint16_t region_class);
+uint64_t gpu_meminfo_region_total_available(struct drm_i915_query_memory_regions *info,
+					    uint16_t region_type);
+
+uint64_t gpu_meminfo_region_size(struct drm_i915_query_memory_regions *info,
+				 uint16_t memory_class,
+				 uint16_t memory_instance);
+uint64_t gpu_meminfo_region_available(struct drm_i915_query_memory_regions *info,
+				      uint16_t memory_class,
+				      uint16_t memory_instance);
+
+#endif /* INTEL_MEMORY_REGION_H */
diff --git a/lib/ioctl_wrappers.h b/lib/ioctl_wrappers.h
index 9ea67365..36640e30 100644
--- a/lib/ioctl_wrappers.h
+++ b/lib/ioctl_wrappers.h
@@ -38,6 +38,7 @@
 
 #include "i915/gem_context.h"
 #include "i915/gem_scheduler.h"
+#include "i915/intel_memory_region.h"
 
 /**
  * igt_ioctl:
diff --git a/lib/meson.build b/lib/meson.build
index d5a1c970..078a357b 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -10,6 +10,7 @@ lib_sources = [
 	'i915/gem_ring.c',
 	'i915/gem_mman.c',
 	'i915/gem_vm.c',
+	'i915/intel_memory_region.c',
 	'igt_collection.c',
 	'igt_color_encoding.c',
 	'igt_debugfs.c',
-- 
2.26.3

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [Intel-gfx] [PATCH i-g-t v3 4/9] tests/gem_gpgpu_fill: Convert from simple to standard igt_main
  2021-05-26 13:00 ` [igt-dev] " Matthew Auld
@ 2021-05-26 13:00   ` Matthew Auld
  -1 siblings, 0 replies; 20+ messages in thread
From: Matthew Auld @ 2021-05-26 13:00 UTC (permalink / raw)
  To: igt-dev; +Cc: intel-gfx, Dominik Grzegorzek

From: Dominik Grzegorzek <dominik.grzegorzek@intel.com>

As we need to add new test variants, convert the code to standard
igt_main format so those variants can be easily accommodated.

Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Acked-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/i915/gem_gpgpu_fill.c | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/tests/i915/gem_gpgpu_fill.c b/tests/i915/gem_gpgpu_fill.c
index c605629f..5b11fb35 100644
--- a/tests/i915/gem_gpgpu_fill.c
+++ b/tests/i915/gem_gpgpu_fill.c
@@ -123,20 +123,27 @@ static void gpgpu_fill(data_t *data, igt_fillfunc_t fill)
 
 	munmap(ptr, buf->surface[0].size);
 }
-
-igt_simple_main
+igt_main
 {
 	data_t data = {0, };
 	igt_fillfunc_t fill_fn = NULL;
 
-	data.drm_fd = drm_open_driver_render(DRIVER_INTEL);
-	data.devid = intel_get_drm_devid(data.drm_fd);
-	igt_require_gem(data.drm_fd);
-	data.bops = buf_ops_create(data.drm_fd);
+	igt_fixture {
+		data.drm_fd = drm_open_driver_render(DRIVER_INTEL);
+		data.devid = intel_get_drm_devid(data.drm_fd);
+		igt_require_gem(data.drm_fd);
+		data.bops = buf_ops_create(data.drm_fd);
+
+		fill_fn = igt_get_gpgpu_fillfunc(data.devid);
+
+		igt_require_f(fill_fn, "no gpgpu-fill function\n");
 
-	fill_fn = igt_get_gpgpu_fillfunc(data.devid);
+	}
 
-	igt_require_f(fill_fn, "no gpgpu-fill function\n");
+	igt_subtest("basic")
+		gpgpu_fill(&data, fill_fn);
 
-	gpgpu_fill(&data, fill_fn);
+	igt_fixture {
+		buf_ops_destroy(data.bops);
+	}
 }
-- 
2.26.3

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

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

* [igt-dev] [PATCH i-g-t v3 4/9] tests/gem_gpgpu_fill: Convert from simple to standard igt_main
@ 2021-05-26 13:00   ` Matthew Auld
  0 siblings, 0 replies; 20+ messages in thread
From: Matthew Auld @ 2021-05-26 13:00 UTC (permalink / raw)
  To: igt-dev; +Cc: intel-gfx, Petri Latvala

From: Dominik Grzegorzek <dominik.grzegorzek@intel.com>

As we need to add new test variants, convert the code to standard
igt_main format so those variants can be easily accommodated.

Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Acked-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/i915/gem_gpgpu_fill.c | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/tests/i915/gem_gpgpu_fill.c b/tests/i915/gem_gpgpu_fill.c
index c605629f..5b11fb35 100644
--- a/tests/i915/gem_gpgpu_fill.c
+++ b/tests/i915/gem_gpgpu_fill.c
@@ -123,20 +123,27 @@ static void gpgpu_fill(data_t *data, igt_fillfunc_t fill)
 
 	munmap(ptr, buf->surface[0].size);
 }
-
-igt_simple_main
+igt_main
 {
 	data_t data = {0, };
 	igt_fillfunc_t fill_fn = NULL;
 
-	data.drm_fd = drm_open_driver_render(DRIVER_INTEL);
-	data.devid = intel_get_drm_devid(data.drm_fd);
-	igt_require_gem(data.drm_fd);
-	data.bops = buf_ops_create(data.drm_fd);
+	igt_fixture {
+		data.drm_fd = drm_open_driver_render(DRIVER_INTEL);
+		data.devid = intel_get_drm_devid(data.drm_fd);
+		igt_require_gem(data.drm_fd);
+		data.bops = buf_ops_create(data.drm_fd);
+
+		fill_fn = igt_get_gpgpu_fillfunc(data.devid);
+
+		igt_require_f(fill_fn, "no gpgpu-fill function\n");
 
-	fill_fn = igt_get_gpgpu_fillfunc(data.devid);
+	}
 
-	igt_require_f(fill_fn, "no gpgpu-fill function\n");
+	igt_subtest("basic")
+		gpgpu_fill(&data, fill_fn);
 
-	gpgpu_fill(&data, fill_fn);
+	igt_fixture {
+		buf_ops_destroy(data.bops);
+	}
 }
-- 
2.26.3

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [Intel-gfx] [PATCH i-g-t v3 5/9] tests/i915/gem_exec_basic: Use memory region interface
  2021-05-26 13:00 ` [igt-dev] " Matthew Auld
@ 2021-05-26 13:00   ` Matthew Auld
  -1 siblings, 0 replies; 20+ messages in thread
From: Matthew Auld @ 2021-05-26 13:00 UTC (permalink / raw)
  To: igt-dev; +Cc: intel-gfx, Dominik Grzegorzek, Andrzej Turko

From: Andrzej Turko <andrzej.turko@linux.intel.com>

Converted the test gem_exec_basic to use the memory region uapi.

Signed-off-by: Andrzej Turko <andrzej.turko@linux.intel.com>
Cc: Zbigniew Kempczynski <zbigniew.kempczynski@intel.com>
Cc: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Acked-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/i915/gem_exec_basic.c | 50 +++++++++++++++++++++++++------------
 1 file changed, 34 insertions(+), 16 deletions(-)

diff --git a/tests/i915/gem_exec_basic.c b/tests/i915/gem_exec_basic.c
index 5021852f..8bc4dc52 100644
--- a/tests/i915/gem_exec_basic.c
+++ b/tests/i915/gem_exec_basic.c
@@ -22,17 +22,18 @@
  */
 
 #include "igt.h"
+#include "igt_collection.h"
 
 #include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION("Basic sanity check of execbuf-ioctl rings.");
 
-static uint32_t batch_create(int fd)
+static uint32_t batch_create(int fd, uint32_t batch_size, uint32_t region)
 {
 	const uint32_t bbe = MI_BATCH_BUFFER_END;
 	uint32_t handle;
 
-	handle = gem_create(fd, 4096);
+	handle = gem_create_in_memory_regions(fd, batch_size, region);
 	gem_write(fd, handle, 0, &bbe, sizeof(bbe));
 
 	return handle;
@@ -41,36 +42,53 @@ static uint32_t batch_create(int fd)
 igt_main
 {
 	const struct intel_execution_engine2 *e;
+	struct drm_i915_query_memory_regions *query_info;
+	struct igt_collection *regions, *set;
+	uint32_t batch_size;
 	int fd = -1;
 
 	igt_fixture {
 		fd = drm_open_driver(DRIVER_INTEL);
 		/* igt_require_gem(fd); // test is mandatory */
 		igt_fork_hang_detector(fd);
+
+		query_info = gem_get_query_memory_regions(fd);
+		igt_assert(query_info);
+
+		set = get_memory_region_set(query_info,
+					    I915_SYSTEM_MEMORY);
 	}
 
 	igt_subtest_with_dynamic("basic") {
-		struct drm_i915_gem_exec_object2 exec = {
-			.handle = batch_create(fd),
-		};
+		for_each_combination(regions, 1, set) {
+			char *sub_name = memregion_dynamic_subtest_name(regions);
+			struct drm_i915_gem_exec_object2 exec;
+			uint32_t region = igt_collection_get_value(regions, 0);
 
-		__for_each_physical_engine(fd, e) {
-			igt_dynamic_f("%s", e->name) {
-				struct drm_i915_gem_execbuffer2 execbuf = {
-					.buffers_ptr = to_user_pointer(&exec),
-					.buffer_count = 1,
-					.flags = e->flags,
-				};
+			batch_size = gem_get_batch_size(fd, MEMORY_TYPE_FROM_REGION(region));
+			memset(&exec, 0, sizeof(exec));
+			exec.handle = batch_create(fd, batch_size, region);
 
-				gem_execbuf(fd, &execbuf);
+			__for_each_physical_engine(fd, e) {
+				igt_dynamic_f("%s-%s", e->name, sub_name) {
+					struct drm_i915_gem_execbuffer2 execbuf = {
+						.buffers_ptr = to_user_pointer(&exec),
+						.buffer_count = 1,
+						.flags = e->flags,
+					};
+
+					gem_execbuf(fd, &execbuf);
+				}
 			}
+			gem_sync(fd, exec.handle); /* catch any GPU hang */
+			gem_close(fd, exec.handle);
+			free(sub_name);
 		}
-
-		gem_sync(fd, exec.handle); /* catch any GPU hang */
-		gem_close(fd, exec.handle);
 	}
 
 	igt_fixture {
+		free(query_info);
+		igt_collection_destroy(set);
 		igt_stop_hang_detector();
 		close(fd);
 	}
-- 
2.26.3

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

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

* [igt-dev] [PATCH i-g-t v3 5/9] tests/i915/gem_exec_basic: Use memory region interface
@ 2021-05-26 13:00   ` Matthew Auld
  0 siblings, 0 replies; 20+ messages in thread
From: Matthew Auld @ 2021-05-26 13:00 UTC (permalink / raw)
  To: igt-dev; +Cc: intel-gfx, Petri Latvala

From: Andrzej Turko <andrzej.turko@linux.intel.com>

Converted the test gem_exec_basic to use the memory region uapi.

Signed-off-by: Andrzej Turko <andrzej.turko@linux.intel.com>
Cc: Zbigniew Kempczynski <zbigniew.kempczynski@intel.com>
Cc: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Acked-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/i915/gem_exec_basic.c | 50 +++++++++++++++++++++++++------------
 1 file changed, 34 insertions(+), 16 deletions(-)

diff --git a/tests/i915/gem_exec_basic.c b/tests/i915/gem_exec_basic.c
index 5021852f..8bc4dc52 100644
--- a/tests/i915/gem_exec_basic.c
+++ b/tests/i915/gem_exec_basic.c
@@ -22,17 +22,18 @@
  */
 
 #include "igt.h"
+#include "igt_collection.h"
 
 #include "i915/gem_create.h"
 
 IGT_TEST_DESCRIPTION("Basic sanity check of execbuf-ioctl rings.");
 
-static uint32_t batch_create(int fd)
+static uint32_t batch_create(int fd, uint32_t batch_size, uint32_t region)
 {
 	const uint32_t bbe = MI_BATCH_BUFFER_END;
 	uint32_t handle;
 
-	handle = gem_create(fd, 4096);
+	handle = gem_create_in_memory_regions(fd, batch_size, region);
 	gem_write(fd, handle, 0, &bbe, sizeof(bbe));
 
 	return handle;
@@ -41,36 +42,53 @@ static uint32_t batch_create(int fd)
 igt_main
 {
 	const struct intel_execution_engine2 *e;
+	struct drm_i915_query_memory_regions *query_info;
+	struct igt_collection *regions, *set;
+	uint32_t batch_size;
 	int fd = -1;
 
 	igt_fixture {
 		fd = drm_open_driver(DRIVER_INTEL);
 		/* igt_require_gem(fd); // test is mandatory */
 		igt_fork_hang_detector(fd);
+
+		query_info = gem_get_query_memory_regions(fd);
+		igt_assert(query_info);
+
+		set = get_memory_region_set(query_info,
+					    I915_SYSTEM_MEMORY);
 	}
 
 	igt_subtest_with_dynamic("basic") {
-		struct drm_i915_gem_exec_object2 exec = {
-			.handle = batch_create(fd),
-		};
+		for_each_combination(regions, 1, set) {
+			char *sub_name = memregion_dynamic_subtest_name(regions);
+			struct drm_i915_gem_exec_object2 exec;
+			uint32_t region = igt_collection_get_value(regions, 0);
 
-		__for_each_physical_engine(fd, e) {
-			igt_dynamic_f("%s", e->name) {
-				struct drm_i915_gem_execbuffer2 execbuf = {
-					.buffers_ptr = to_user_pointer(&exec),
-					.buffer_count = 1,
-					.flags = e->flags,
-				};
+			batch_size = gem_get_batch_size(fd, MEMORY_TYPE_FROM_REGION(region));
+			memset(&exec, 0, sizeof(exec));
+			exec.handle = batch_create(fd, batch_size, region);
 
-				gem_execbuf(fd, &execbuf);
+			__for_each_physical_engine(fd, e) {
+				igt_dynamic_f("%s-%s", e->name, sub_name) {
+					struct drm_i915_gem_execbuffer2 execbuf = {
+						.buffers_ptr = to_user_pointer(&exec),
+						.buffer_count = 1,
+						.flags = e->flags,
+					};
+
+					gem_execbuf(fd, &execbuf);
+				}
 			}
+			gem_sync(fd, exec.handle); /* catch any GPU hang */
+			gem_close(fd, exec.handle);
+			free(sub_name);
 		}
-
-		gem_sync(fd, exec.handle); /* catch any GPU hang */
-		gem_close(fd, exec.handle);
 	}
 
 	igt_fixture {
+		free(query_info);
+		igt_collection_destroy(set);
 		igt_stop_hang_detector();
 		close(fd);
 	}
-- 
2.26.3

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [Intel-gfx] [PATCH i-g-t v3 6/9] tests/i915/gem_gpgpu_fill: Use memory region interface
  2021-05-26 13:00 ` [igt-dev] " Matthew Auld
@ 2021-05-26 13:00   ` Matthew Auld
  -1 siblings, 0 replies; 20+ messages in thread
From: Matthew Auld @ 2021-05-26 13:00 UTC (permalink / raw)
  To: igt-dev; +Cc: intel-gfx, Dominik Grzegorzek, Andrzej Turko

From: Andrzej Turko <andrzej.turko@linux.intel.com>

Converted the test gem_gpgpu_fill to use memory region uapi.

Signed-off-by: Andrzej Turko <andrzej.turko@linux.intel.com>
Cc: Zbigniew Kempczynski <zbigniew.kempczynski@intel.com>
Cc: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Acked-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
---
 tests/i915/gem_gpgpu_fill.c | 42 ++++++++++++++++++++++++++++++-------
 1 file changed, 34 insertions(+), 8 deletions(-)

diff --git a/tests/i915/gem_gpgpu_fill.c b/tests/i915/gem_gpgpu_fill.c
index 5b11fb35..1fcd42e2 100644
--- a/tests/i915/gem_gpgpu_fill.c
+++ b/tests/i915/gem_gpgpu_fill.c
@@ -45,13 +45,14 @@
 #include "drm.h"
 #include "i915/gem.h"
 #include "igt.h"
+#include "igt_collection.h"
 #include "intel_bufops.h"
+#include "i915/intel_memory_region.h"
 
 #define WIDTH 64
 #define HEIGHT 64
 #define STRIDE (WIDTH)
 #define SIZE (HEIGHT*STRIDE)
-
 #define COLOR_C4	0xc4
 #define COLOR_4C	0x4c
 
@@ -62,10 +63,11 @@ typedef struct {
 } data_t;
 
 static struct intel_buf *
-create_buf(data_t *data, int width, int height, uint8_t color)
+create_buf(data_t *data, int width, int height, uint8_t color, uint32_t region)
 {
 	struct intel_buf *buf;
 	uint8_t *ptr;
+	uint32_t handle;
 	int i;
 
 	buf = calloc(1, sizeof(*buf));
@@ -75,8 +77,10 @@ create_buf(data_t *data, int width, int height, uint8_t color)
 	 * Legacy code uses 32 bpp after buffer creation.
 	 * Let's do the same due to keep shader intact.
 	 */
-	intel_buf_init(data->bops, buf, width/4, height, 32, 0,
-		       I915_TILING_NONE, 0);
+	handle = gem_create_in_memory_regions(data->drm_fd, SIZE, region);
+	intel_buf_init_using_handle(data->bops, handle, buf,
+				    width/4, height, 32, 0,
+				    I915_TILING_NONE, 0);
 
 	ptr = gem_mmap__cpu_coherent(data->drm_fd, buf->handle, 0,
 				     buf->surface[0].size, PROT_WRITE);
@@ -99,15 +103,16 @@ static void buf_check(uint8_t *ptr, int x, int y, uint8_t color)
 		     color, val, x, y);
 }
 
-static void gpgpu_fill(data_t *data, igt_fillfunc_t fill)
+static void gpgpu_fill(data_t *data, igt_fillfunc_t fill, uint32_t region)
 {
 	struct intel_buf *buf;
 	uint8_t *ptr;
 	int i, j;
 
-	buf = create_buf(data, WIDTH, HEIGHT, COLOR_C4);
+	buf = create_buf(data, WIDTH, HEIGHT, COLOR_C4, region);
 	ptr = gem_mmap__device_coherent(data->drm_fd, buf->handle, 0,
 					buf->surface[0].size, PROT_READ);
+
 	for (i = 0; i < WIDTH; i++)
 		for (j = 0; j < HEIGHT; j++)
 			buf_check(ptr, i, j, COLOR_C4);
@@ -123,10 +128,13 @@ static void gpgpu_fill(data_t *data, igt_fillfunc_t fill)
 
 	munmap(ptr, buf->surface[0].size);
 }
+
 igt_main
 {
 	data_t data = {0, };
 	igt_fillfunc_t fill_fn = NULL;
+	struct drm_i915_query_memory_regions *region_info;
+	struct igt_collection *region_set;
 
 	igt_fixture {
 		data.drm_fd = drm_open_driver_render(DRIVER_INTEL);
@@ -138,12 +146,30 @@ igt_main
 
 		igt_require_f(fill_fn, "no gpgpu-fill function\n");
 
+		region_info = gem_get_query_memory_regions(data.drm_fd);
+		igt_assert(region_info);
+
+		region_set = get_memory_region_set(region_info,
+						   I915_SYSTEM_MEMORY);
 	}
 
-	igt_subtest("basic")
-		gpgpu_fill(&data, fill_fn);
+	igt_subtest_with_dynamic("basic") {
+		struct igt_collection *region;
+
+		for_each_combination(region, 1, region_set) {
+			char *name = memregion_dynamic_subtest_name(region);
+			uint32_t id = igt_collection_get_value(region, 0);
+
+			igt_dynamic(name)
+				gpgpu_fill(&data, fill_fn, id);
+
+			free(name);
+		}
+	}
 
 	igt_fixture {
+		igt_collection_destroy(region_set);
+		free(region_info);
 		buf_ops_destroy(data.bops);
 	}
 }
-- 
2.26.3

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

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

* [igt-dev] [PATCH i-g-t v3 6/9] tests/i915/gem_gpgpu_fill: Use memory region interface
@ 2021-05-26 13:00   ` Matthew Auld
  0 siblings, 0 replies; 20+ messages in thread
From: Matthew Auld @ 2021-05-26 13:00 UTC (permalink / raw)
  To: igt-dev; +Cc: intel-gfx, Petri Latvala

From: Andrzej Turko <andrzej.turko@linux.intel.com>

Converted the test gem_gpgpu_fill to use memory region uapi.

Signed-off-by: Andrzej Turko <andrzej.turko@linux.intel.com>
Cc: Zbigniew Kempczynski <zbigniew.kempczynski@intel.com>
Cc: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Acked-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
---
 tests/i915/gem_gpgpu_fill.c | 42 ++++++++++++++++++++++++++++++-------
 1 file changed, 34 insertions(+), 8 deletions(-)

diff --git a/tests/i915/gem_gpgpu_fill.c b/tests/i915/gem_gpgpu_fill.c
index 5b11fb35..1fcd42e2 100644
--- a/tests/i915/gem_gpgpu_fill.c
+++ b/tests/i915/gem_gpgpu_fill.c
@@ -45,13 +45,14 @@
 #include "drm.h"
 #include "i915/gem.h"
 #include "igt.h"
+#include "igt_collection.h"
 #include "intel_bufops.h"
+#include "i915/intel_memory_region.h"
 
 #define WIDTH 64
 #define HEIGHT 64
 #define STRIDE (WIDTH)
 #define SIZE (HEIGHT*STRIDE)
-
 #define COLOR_C4	0xc4
 #define COLOR_4C	0x4c
 
@@ -62,10 +63,11 @@ typedef struct {
 } data_t;
 
 static struct intel_buf *
-create_buf(data_t *data, int width, int height, uint8_t color)
+create_buf(data_t *data, int width, int height, uint8_t color, uint32_t region)
 {
 	struct intel_buf *buf;
 	uint8_t *ptr;
+	uint32_t handle;
 	int i;
 
 	buf = calloc(1, sizeof(*buf));
@@ -75,8 +77,10 @@ create_buf(data_t *data, int width, int height, uint8_t color)
 	 * Legacy code uses 32 bpp after buffer creation.
 	 * Let's do the same due to keep shader intact.
 	 */
-	intel_buf_init(data->bops, buf, width/4, height, 32, 0,
-		       I915_TILING_NONE, 0);
+	handle = gem_create_in_memory_regions(data->drm_fd, SIZE, region);
+	intel_buf_init_using_handle(data->bops, handle, buf,
+				    width/4, height, 32, 0,
+				    I915_TILING_NONE, 0);
 
 	ptr = gem_mmap__cpu_coherent(data->drm_fd, buf->handle, 0,
 				     buf->surface[0].size, PROT_WRITE);
@@ -99,15 +103,16 @@ static void buf_check(uint8_t *ptr, int x, int y, uint8_t color)
 		     color, val, x, y);
 }
 
-static void gpgpu_fill(data_t *data, igt_fillfunc_t fill)
+static void gpgpu_fill(data_t *data, igt_fillfunc_t fill, uint32_t region)
 {
 	struct intel_buf *buf;
 	uint8_t *ptr;
 	int i, j;
 
-	buf = create_buf(data, WIDTH, HEIGHT, COLOR_C4);
+	buf = create_buf(data, WIDTH, HEIGHT, COLOR_C4, region);
 	ptr = gem_mmap__device_coherent(data->drm_fd, buf->handle, 0,
 					buf->surface[0].size, PROT_READ);
+
 	for (i = 0; i < WIDTH; i++)
 		for (j = 0; j < HEIGHT; j++)
 			buf_check(ptr, i, j, COLOR_C4);
@@ -123,10 +128,13 @@ static void gpgpu_fill(data_t *data, igt_fillfunc_t fill)
 
 	munmap(ptr, buf->surface[0].size);
 }
+
 igt_main
 {
 	data_t data = {0, };
 	igt_fillfunc_t fill_fn = NULL;
+	struct drm_i915_query_memory_regions *region_info;
+	struct igt_collection *region_set;
 
 	igt_fixture {
 		data.drm_fd = drm_open_driver_render(DRIVER_INTEL);
@@ -138,12 +146,30 @@ igt_main
 
 		igt_require_f(fill_fn, "no gpgpu-fill function\n");
 
+		region_info = gem_get_query_memory_regions(data.drm_fd);
+		igt_assert(region_info);
+
+		region_set = get_memory_region_set(region_info,
+						   I915_SYSTEM_MEMORY);
 	}
 
-	igt_subtest("basic")
-		gpgpu_fill(&data, fill_fn);
+	igt_subtest_with_dynamic("basic") {
+		struct igt_collection *region;
+
+		for_each_combination(region, 1, region_set) {
+			char *name = memregion_dynamic_subtest_name(region);
+			uint32_t id = igt_collection_get_value(region, 0);
+
+			igt_dynamic(name)
+				gpgpu_fill(&data, fill_fn, id);
+
+			free(name);
+		}
+	}
 
 	igt_fixture {
+		igt_collection_destroy(region_set);
+		free(region_info);
 		buf_ops_destroy(data.bops);
 	}
 }
-- 
2.26.3

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [Intel-gfx] [PATCH i-g-t v3 7/9] tests/i915/gem_media_fill: Use memory region interface
  2021-05-26 13:00 ` [igt-dev] " Matthew Auld
@ 2021-05-26 13:00   ` Matthew Auld
  -1 siblings, 0 replies; 20+ messages in thread
From: Matthew Auld @ 2021-05-26 13:00 UTC (permalink / raw)
  To: igt-dev; +Cc: intel-gfx, Dominik Grzegorzek, Andrzej Turko

From: Andrzej Turko <andrzej.turko@linux.intel.com>

Converted the test gem_media_fill to use memory region uapi.

Signed-off-by: Andrzej Turko <andrzej.turko@linux.intel.com>
Cc: Zbigniew Kempczynski <zbigniew.kempczynski@intel.com>
Cc: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Acked-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
---
 tests/i915/gem_media_fill.c | 57 ++++++++++++++++++++++++++++---------
 1 file changed, 44 insertions(+), 13 deletions(-)

diff --git a/tests/i915/gem_media_fill.c b/tests/i915/gem_media_fill.c
index 24d17fab..28c18e79 100644
--- a/tests/i915/gem_media_fill.c
+++ b/tests/i915/gem_media_fill.c
@@ -64,21 +64,24 @@ typedef struct {
 } data_t;
 
 static struct intel_buf *
-create_buf(data_t *data, int width, int height, uint8_t color)
+create_buf(data_t *data, int width, int height, uint8_t color, uint32_t region)
 {
 	struct intel_buf *buf;
+	uint32_t handle;
 	uint8_t *ptr;
 	int i;
 
 	buf = calloc(1, sizeof(*buf));
 	igt_assert(buf);
 
+	handle = gem_create_in_memory_regions(data->drm_fd, SIZE, region);
+
 	/*
 	 * Legacy code uses 32 bpp after buffer creation.
 	 * Let's do the same due to keep shader intact.
 	 */
-	intel_buf_init(data->bops, buf, width/4, height, 32, 0,
-		       I915_TILING_NONE, 0);
+	intel_buf_init_using_handle(data->bops, handle, buf, width/4,
+				    height, 32, 0, I915_TILING_NONE, 0);
 
 	ptr = gem_mmap__cpu_coherent(data->drm_fd, buf->handle, 0,
 				     buf->surface[0].size, PROT_WRITE);
@@ -101,13 +104,16 @@ static void buf_check(uint8_t *ptr, int x, int y, uint8_t color)
 		     color, val, x, y);
 }
 
-static void media_fill(data_t *data, igt_fillfunc_t fill)
+static void media_fill(data_t *data, igt_fillfunc_t fill,
+		       struct igt_collection *memregion_set)
 {
 	struct intel_buf *buf;
+	uint32_t region;
 	uint8_t *ptr;
 	int i, j;
 
-	buf = create_buf(data, WIDTH, HEIGHT, COLOR_C4);
+	region = igt_collection_get_value(memregion_set, 0);
+	buf = create_buf(data, WIDTH, HEIGHT, COLOR_C4, region);
 	ptr = gem_mmap__device_coherent(data->drm_fd, buf->handle,
 					0, buf->surface[0].size, PROT_READ);
 	for (i = 0; i < WIDTH; i++)
@@ -126,20 +132,45 @@ static void media_fill(data_t *data, igt_fillfunc_t fill)
 	munmap(ptr, buf->surface[0].size);
 }
 
-igt_simple_main
+igt_main
 {
 	data_t data = {0, };
 	igt_fillfunc_t fill_fn = NULL;
+	struct drm_i915_query_memory_regions *query_info;
+	struct igt_collection *set, *region_set;
+
+	igt_fixture {
+		data.drm_fd = drm_open_driver_render(DRIVER_INTEL);
+		igt_require_gem(data.drm_fd);
+
+		data.devid = intel_get_drm_devid(data.drm_fd);
+		data.bops = buf_ops_create(data.drm_fd);
+
+		fill_fn = igt_get_media_fillfunc(data.devid);
+
+		igt_require_f(fill_fn, "no media-fill function\n");
+
+		query_info = gem_get_query_memory_regions(data.drm_fd);
+		igt_assert(query_info);
+
+		set = get_memory_region_set(query_info,
+					    I915_SYSTEM_MEMORY);
 
-	data.drm_fd = drm_open_driver_render(DRIVER_INTEL);
-	igt_require_gem(data.drm_fd);
+		igt_fork_hang_detector(data.drm_fd);
+	}
 
-	data.devid = intel_get_drm_devid(data.drm_fd);
-	data.bops = buf_ops_create(data.drm_fd);
+	igt_subtest_with_dynamic("media-fill")
+		for_each_combination(region_set, 1, set) {
+			char *sub_name = memregion_dynamic_subtest_name(region_set);
 
-	fill_fn = igt_get_media_fillfunc(data.devid);
+			igt_dynamic_f("%s", sub_name)
+				media_fill(&data, fill_fn, region_set);
 
-	igt_require_f(fill_fn, "no media-fill function\n");
+			free(sub_name);
+	}
 
-	media_fill(&data, fill_fn);
+	igt_fixture {
+		igt_collection_destroy(set);
+		igt_stop_hang_detector();
+	}
 }
-- 
2.26.3

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

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

* [igt-dev] [PATCH i-g-t v3 7/9] tests/i915/gem_media_fill: Use memory region interface
@ 2021-05-26 13:00   ` Matthew Auld
  0 siblings, 0 replies; 20+ messages in thread
From: Matthew Auld @ 2021-05-26 13:00 UTC (permalink / raw)
  To: igt-dev; +Cc: intel-gfx, Petri Latvala

From: Andrzej Turko <andrzej.turko@linux.intel.com>

Converted the test gem_media_fill to use memory region uapi.

Signed-off-by: Andrzej Turko <andrzej.turko@linux.intel.com>
Cc: Zbigniew Kempczynski <zbigniew.kempczynski@intel.com>
Cc: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Acked-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
---
 tests/i915/gem_media_fill.c | 57 ++++++++++++++++++++++++++++---------
 1 file changed, 44 insertions(+), 13 deletions(-)

diff --git a/tests/i915/gem_media_fill.c b/tests/i915/gem_media_fill.c
index 24d17fab..28c18e79 100644
--- a/tests/i915/gem_media_fill.c
+++ b/tests/i915/gem_media_fill.c
@@ -64,21 +64,24 @@ typedef struct {
 } data_t;
 
 static struct intel_buf *
-create_buf(data_t *data, int width, int height, uint8_t color)
+create_buf(data_t *data, int width, int height, uint8_t color, uint32_t region)
 {
 	struct intel_buf *buf;
+	uint32_t handle;
 	uint8_t *ptr;
 	int i;
 
 	buf = calloc(1, sizeof(*buf));
 	igt_assert(buf);
 
+	handle = gem_create_in_memory_regions(data->drm_fd, SIZE, region);
+
 	/*
 	 * Legacy code uses 32 bpp after buffer creation.
 	 * Let's do the same due to keep shader intact.
 	 */
-	intel_buf_init(data->bops, buf, width/4, height, 32, 0,
-		       I915_TILING_NONE, 0);
+	intel_buf_init_using_handle(data->bops, handle, buf, width/4,
+				    height, 32, 0, I915_TILING_NONE, 0);
 
 	ptr = gem_mmap__cpu_coherent(data->drm_fd, buf->handle, 0,
 				     buf->surface[0].size, PROT_WRITE);
@@ -101,13 +104,16 @@ static void buf_check(uint8_t *ptr, int x, int y, uint8_t color)
 		     color, val, x, y);
 }
 
-static void media_fill(data_t *data, igt_fillfunc_t fill)
+static void media_fill(data_t *data, igt_fillfunc_t fill,
+		       struct igt_collection *memregion_set)
 {
 	struct intel_buf *buf;
+	uint32_t region;
 	uint8_t *ptr;
 	int i, j;
 
-	buf = create_buf(data, WIDTH, HEIGHT, COLOR_C4);
+	region = igt_collection_get_value(memregion_set, 0);
+	buf = create_buf(data, WIDTH, HEIGHT, COLOR_C4, region);
 	ptr = gem_mmap__device_coherent(data->drm_fd, buf->handle,
 					0, buf->surface[0].size, PROT_READ);
 	for (i = 0; i < WIDTH; i++)
@@ -126,20 +132,45 @@ static void media_fill(data_t *data, igt_fillfunc_t fill)
 	munmap(ptr, buf->surface[0].size);
 }
 
-igt_simple_main
+igt_main
 {
 	data_t data = {0, };
 	igt_fillfunc_t fill_fn = NULL;
+	struct drm_i915_query_memory_regions *query_info;
+	struct igt_collection *set, *region_set;
+
+	igt_fixture {
+		data.drm_fd = drm_open_driver_render(DRIVER_INTEL);
+		igt_require_gem(data.drm_fd);
+
+		data.devid = intel_get_drm_devid(data.drm_fd);
+		data.bops = buf_ops_create(data.drm_fd);
+
+		fill_fn = igt_get_media_fillfunc(data.devid);
+
+		igt_require_f(fill_fn, "no media-fill function\n");
+
+		query_info = gem_get_query_memory_regions(data.drm_fd);
+		igt_assert(query_info);
+
+		set = get_memory_region_set(query_info,
+					    I915_SYSTEM_MEMORY);
 
-	data.drm_fd = drm_open_driver_render(DRIVER_INTEL);
-	igt_require_gem(data.drm_fd);
+		igt_fork_hang_detector(data.drm_fd);
+	}
 
-	data.devid = intel_get_drm_devid(data.drm_fd);
-	data.bops = buf_ops_create(data.drm_fd);
+	igt_subtest_with_dynamic("media-fill")
+		for_each_combination(region_set, 1, set) {
+			char *sub_name = memregion_dynamic_subtest_name(region_set);
 
-	fill_fn = igt_get_media_fillfunc(data.devid);
+			igt_dynamic_f("%s", sub_name)
+				media_fill(&data, fill_fn, region_set);
 
-	igt_require_f(fill_fn, "no media-fill function\n");
+			free(sub_name);
+	}
 
-	media_fill(&data, fill_fn);
+	igt_fixture {
+		igt_collection_destroy(set);
+		igt_stop_hang_detector();
+	}
 }
-- 
2.26.3

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [Intel-gfx] [PATCH i-g-t v3 8/9] tests/i915/gem_create: exercise placements extension
  2021-05-26 13:00 ` [igt-dev] " Matthew Auld
@ 2021-05-26 13:00   ` Matthew Auld
  -1 siblings, 0 replies; 20+ messages in thread
From: Matthew Auld @ 2021-05-26 13:00 UTC (permalink / raw)
  To: igt-dev; +Cc: intel-gfx, Dominik Grzegorzek

Add some explicit testcases for the create_ext placements extension.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Acked-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/i915/gem_create.c | 188 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 188 insertions(+)

diff --git a/tests/i915/gem_create.c b/tests/i915/gem_create.c
index 8acc2f52..167d7d28 100644
--- a/tests/i915/gem_create.c
+++ b/tests/i915/gem_create.c
@@ -290,6 +290,184 @@ static void size_update(int fd)
 	igt_assert_neq(create.size, size_initial_nonaligned);
 }
 
+static void create_ext_placement_sanity_check(int fd)
+{
+	struct drm_i915_query_memory_regions *regions;
+	struct drm_i915_gem_create_ext_memory_regions setparam_region = {
+		.base = { .name = I915_GEM_CREATE_EXT_MEMORY_REGIONS },
+	};
+	struct drm_i915_gem_memory_class_instance *uregions;
+	struct drm_i915_gem_memory_class_instance region_smem = {
+		.memory_class = I915_MEMORY_CLASS_SYSTEM,
+		.memory_instance = 0,
+	};
+	struct drm_i915_gem_memory_class_instance region_invalid = {
+		.memory_class = -1,
+		.memory_instance = -1,
+	};
+	uint64_t size;
+	uint32_t handle;
+	int i;
+
+	regions = gem_get_query_memory_regions(fd);
+	igt_assert(regions);
+	igt_assert(regions->num_regions);
+
+	/*
+	 * extensions should be optional, giving us the normal gem_create
+	 * behaviour.
+	 */
+	size = PAGE_SIZE;
+	igt_assert_eq(__gem_create_ext(fd, &size, &handle, 0), 0);
+	gem_close(fd, handle);
+
+	/* Try some uncreative invalid combinations */
+	setparam_region.regions = to_user_pointer(&region_smem);
+	setparam_region.num_regions = 0;
+	size = PAGE_SIZE;
+	igt_assert_neq(__gem_create_ext(fd, &size, &handle,
+					&setparam_region.base), 0);
+
+	setparam_region.regions = to_user_pointer(&region_smem);
+	setparam_region.num_regions = regions->num_regions + 1;
+	size = PAGE_SIZE;
+	igt_assert_neq(__gem_create_ext(fd, &size, &handle,
+					&setparam_region.base), 0);
+
+	setparam_region.regions = to_user_pointer(&region_smem);
+	setparam_region.num_regions = -1;
+	size = PAGE_SIZE;
+	igt_assert_neq(__gem_create_ext(fd, &size, &handle,
+					&setparam_region.base), 0);
+
+	setparam_region.regions = to_user_pointer(&region_invalid);
+	setparam_region.num_regions = 1;
+	size = PAGE_SIZE;
+	igt_assert_neq(__gem_create_ext(fd, &size, &handle,
+					&setparam_region.base), 0);
+
+	setparam_region.regions = to_user_pointer(&region_invalid);
+	setparam_region.num_regions = 0;
+	size = PAGE_SIZE;
+	igt_assert_neq(__gem_create_ext(fd, &size, &handle,
+					&setparam_region.base), 0);
+
+	uregions = calloc(regions->num_regions + 1, sizeof(uint32_t));
+
+	for (i = 0; i < regions->num_regions; i++)
+		uregions[i] = regions->regions[i].region;
+
+	setparam_region.regions = to_user_pointer(uregions);
+	setparam_region.num_regions = regions->num_regions + 1;
+	size = PAGE_SIZE;
+	igt_assert_neq(__gem_create_ext(fd, &size, &handle,
+					&setparam_region.base), 0);
+
+	if (regions->num_regions > 1)  {
+		for (i = 0; i < regions->num_regions; i++) {
+			struct drm_i915_gem_memory_class_instance dups[] = {
+				regions->regions[i].region,
+				regions->regions[i].region,
+			};
+
+			setparam_region.regions = to_user_pointer(dups);
+			setparam_region.num_regions = 2;
+			size = PAGE_SIZE;
+			igt_assert_neq(__gem_create_ext(fd, &size, &handle,
+							&setparam_region.base), 0);
+		}
+	}
+
+	uregions[rand() % regions->num_regions].memory_class = -1;
+	uregions[rand() % regions->num_regions].memory_instance = -1;
+	setparam_region.regions = to_user_pointer(uregions);
+	setparam_region.num_regions = regions->num_regions;
+	size = PAGE_SIZE;
+	igt_assert_neq(__gem_create_ext(fd, &size, &handle,
+					&setparam_region.base), 0);
+
+	free(uregions);
+
+	{
+		struct drm_i915_gem_create_ext_memory_regions setparam_region_next;
+
+		setparam_region.regions = to_user_pointer(&region_smem);
+		setparam_region.num_regions = 1;
+
+		setparam_region_next = setparam_region;
+		setparam_region.base.next_extension =
+				to_user_pointer(&setparam_region_next);
+
+		size = PAGE_SIZE;
+		igt_assert_neq(__gem_create_ext(fd, &size, &handle,
+						&setparam_region.base), 0);
+		setparam_region.base.next_extension = 0;
+	}
+
+	free(regions);
+}
+
+static void create_ext_placement_all(int fd)
+{
+	struct drm_i915_query_memory_regions *regions;
+	struct drm_i915_gem_create_ext_memory_regions setparam_region = {
+		.base = { .name = I915_GEM_CREATE_EXT_MEMORY_REGIONS },
+	};
+	struct drm_i915_gem_memory_class_instance *uregions;
+	uint64_t size;
+	uint32_t handle;
+	int i;
+
+	regions = gem_get_query_memory_regions(fd);
+	igt_assert(regions);
+	igt_assert(regions->num_regions);
+
+	uregions = calloc(regions->num_regions, sizeof(*uregions));
+
+	for (i = 0; i < regions->num_regions; i++)
+		uregions[i] = regions->regions[i].region;
+
+	setparam_region.regions = to_user_pointer(uregions);
+	setparam_region.num_regions = regions->num_regions;
+
+	size = PAGE_SIZE;
+	igt_assert_eq(__gem_create_ext(fd, &size, &handle,
+				       &setparam_region.base), 0);
+	gem_close(fd, handle);
+	free(uregions);
+	free(regions);
+}
+
+static void create_ext_placement_each(int fd)
+{
+	struct drm_i915_query_memory_regions *regions;
+	struct drm_i915_gem_create_ext_memory_regions setparam_region = {
+		.base = { .name = I915_GEM_CREATE_EXT_MEMORY_REGIONS },
+	};
+	int i;
+
+	regions = gem_get_query_memory_regions(fd);
+	igt_assert(regions);
+	igt_assert(regions->num_regions);
+
+	for (i = 0; i < regions->num_regions; i++) {
+		struct drm_i915_gem_memory_class_instance region =
+			regions->regions[i].region;
+		uint64_t size;
+		uint32_t handle;
+
+		setparam_region.regions = to_user_pointer(&region);
+		setparam_region.num_regions = 1;
+
+		size = PAGE_SIZE;
+		igt_assert_eq(__gem_create_ext(fd, &size, &handle,
+					       &setparam_region.base), 0);
+		gem_close(fd, handle);
+	}
+
+	free(regions);
+}
+
 igt_main
 {
 	int fd = -1;
@@ -315,4 +493,14 @@ igt_main
 
 	igt_subtest("busy-create")
 		busy_create(fd, 30);
+
+	igt_subtest("create-ext-placement-sanity-check")
+		create_ext_placement_sanity_check(fd);
+
+	igt_subtest("create-ext-placement-each")
+		create_ext_placement_each(fd);
+
+	igt_subtest("create-ext-placement-all")
+		create_ext_placement_all(fd);
+
 }
-- 
2.26.3

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

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

* [igt-dev] [PATCH i-g-t v3 8/9] tests/i915/gem_create: exercise placements extension
@ 2021-05-26 13:00   ` Matthew Auld
  0 siblings, 0 replies; 20+ messages in thread
From: Matthew Auld @ 2021-05-26 13:00 UTC (permalink / raw)
  To: igt-dev; +Cc: intel-gfx, Petri Latvala

Add some explicit testcases for the create_ext placements extension.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Acked-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/i915/gem_create.c | 188 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 188 insertions(+)

diff --git a/tests/i915/gem_create.c b/tests/i915/gem_create.c
index 8acc2f52..167d7d28 100644
--- a/tests/i915/gem_create.c
+++ b/tests/i915/gem_create.c
@@ -290,6 +290,184 @@ static void size_update(int fd)
 	igt_assert_neq(create.size, size_initial_nonaligned);
 }
 
+static void create_ext_placement_sanity_check(int fd)
+{
+	struct drm_i915_query_memory_regions *regions;
+	struct drm_i915_gem_create_ext_memory_regions setparam_region = {
+		.base = { .name = I915_GEM_CREATE_EXT_MEMORY_REGIONS },
+	};
+	struct drm_i915_gem_memory_class_instance *uregions;
+	struct drm_i915_gem_memory_class_instance region_smem = {
+		.memory_class = I915_MEMORY_CLASS_SYSTEM,
+		.memory_instance = 0,
+	};
+	struct drm_i915_gem_memory_class_instance region_invalid = {
+		.memory_class = -1,
+		.memory_instance = -1,
+	};
+	uint64_t size;
+	uint32_t handle;
+	int i;
+
+	regions = gem_get_query_memory_regions(fd);
+	igt_assert(regions);
+	igt_assert(regions->num_regions);
+
+	/*
+	 * extensions should be optional, giving us the normal gem_create
+	 * behaviour.
+	 */
+	size = PAGE_SIZE;
+	igt_assert_eq(__gem_create_ext(fd, &size, &handle, 0), 0);
+	gem_close(fd, handle);
+
+	/* Try some uncreative invalid combinations */
+	setparam_region.regions = to_user_pointer(&region_smem);
+	setparam_region.num_regions = 0;
+	size = PAGE_SIZE;
+	igt_assert_neq(__gem_create_ext(fd, &size, &handle,
+					&setparam_region.base), 0);
+
+	setparam_region.regions = to_user_pointer(&region_smem);
+	setparam_region.num_regions = regions->num_regions + 1;
+	size = PAGE_SIZE;
+	igt_assert_neq(__gem_create_ext(fd, &size, &handle,
+					&setparam_region.base), 0);
+
+	setparam_region.regions = to_user_pointer(&region_smem);
+	setparam_region.num_regions = -1;
+	size = PAGE_SIZE;
+	igt_assert_neq(__gem_create_ext(fd, &size, &handle,
+					&setparam_region.base), 0);
+
+	setparam_region.regions = to_user_pointer(&region_invalid);
+	setparam_region.num_regions = 1;
+	size = PAGE_SIZE;
+	igt_assert_neq(__gem_create_ext(fd, &size, &handle,
+					&setparam_region.base), 0);
+
+	setparam_region.regions = to_user_pointer(&region_invalid);
+	setparam_region.num_regions = 0;
+	size = PAGE_SIZE;
+	igt_assert_neq(__gem_create_ext(fd, &size, &handle,
+					&setparam_region.base), 0);
+
+	uregions = calloc(regions->num_regions + 1, sizeof(uint32_t));
+
+	for (i = 0; i < regions->num_regions; i++)
+		uregions[i] = regions->regions[i].region;
+
+	setparam_region.regions = to_user_pointer(uregions);
+	setparam_region.num_regions = regions->num_regions + 1;
+	size = PAGE_SIZE;
+	igt_assert_neq(__gem_create_ext(fd, &size, &handle,
+					&setparam_region.base), 0);
+
+	if (regions->num_regions > 1)  {
+		for (i = 0; i < regions->num_regions; i++) {
+			struct drm_i915_gem_memory_class_instance dups[] = {
+				regions->regions[i].region,
+				regions->regions[i].region,
+			};
+
+			setparam_region.regions = to_user_pointer(dups);
+			setparam_region.num_regions = 2;
+			size = PAGE_SIZE;
+			igt_assert_neq(__gem_create_ext(fd, &size, &handle,
+							&setparam_region.base), 0);
+		}
+	}
+
+	uregions[rand() % regions->num_regions].memory_class = -1;
+	uregions[rand() % regions->num_regions].memory_instance = -1;
+	setparam_region.regions = to_user_pointer(uregions);
+	setparam_region.num_regions = regions->num_regions;
+	size = PAGE_SIZE;
+	igt_assert_neq(__gem_create_ext(fd, &size, &handle,
+					&setparam_region.base), 0);
+
+	free(uregions);
+
+	{
+		struct drm_i915_gem_create_ext_memory_regions setparam_region_next;
+
+		setparam_region.regions = to_user_pointer(&region_smem);
+		setparam_region.num_regions = 1;
+
+		setparam_region_next = setparam_region;
+		setparam_region.base.next_extension =
+				to_user_pointer(&setparam_region_next);
+
+		size = PAGE_SIZE;
+		igt_assert_neq(__gem_create_ext(fd, &size, &handle,
+						&setparam_region.base), 0);
+		setparam_region.base.next_extension = 0;
+	}
+
+	free(regions);
+}
+
+static void create_ext_placement_all(int fd)
+{
+	struct drm_i915_query_memory_regions *regions;
+	struct drm_i915_gem_create_ext_memory_regions setparam_region = {
+		.base = { .name = I915_GEM_CREATE_EXT_MEMORY_REGIONS },
+	};
+	struct drm_i915_gem_memory_class_instance *uregions;
+	uint64_t size;
+	uint32_t handle;
+	int i;
+
+	regions = gem_get_query_memory_regions(fd);
+	igt_assert(regions);
+	igt_assert(regions->num_regions);
+
+	uregions = calloc(regions->num_regions, sizeof(*uregions));
+
+	for (i = 0; i < regions->num_regions; i++)
+		uregions[i] = regions->regions[i].region;
+
+	setparam_region.regions = to_user_pointer(uregions);
+	setparam_region.num_regions = regions->num_regions;
+
+	size = PAGE_SIZE;
+	igt_assert_eq(__gem_create_ext(fd, &size, &handle,
+				       &setparam_region.base), 0);
+	gem_close(fd, handle);
+	free(uregions);
+	free(regions);
+}
+
+static void create_ext_placement_each(int fd)
+{
+	struct drm_i915_query_memory_regions *regions;
+	struct drm_i915_gem_create_ext_memory_regions setparam_region = {
+		.base = { .name = I915_GEM_CREATE_EXT_MEMORY_REGIONS },
+	};
+	int i;
+
+	regions = gem_get_query_memory_regions(fd);
+	igt_assert(regions);
+	igt_assert(regions->num_regions);
+
+	for (i = 0; i < regions->num_regions; i++) {
+		struct drm_i915_gem_memory_class_instance region =
+			regions->regions[i].region;
+		uint64_t size;
+		uint32_t handle;
+
+		setparam_region.regions = to_user_pointer(&region);
+		setparam_region.num_regions = 1;
+
+		size = PAGE_SIZE;
+		igt_assert_eq(__gem_create_ext(fd, &size, &handle,
+					       &setparam_region.base), 0);
+		gem_close(fd, handle);
+	}
+
+	free(regions);
+}
+
 igt_main
 {
 	int fd = -1;
@@ -315,4 +493,14 @@ igt_main
 
 	igt_subtest("busy-create")
 		busy_create(fd, 30);
+
+	igt_subtest("create-ext-placement-sanity-check")
+		create_ext_placement_sanity_check(fd);
+
+	igt_subtest("create-ext-placement-each")
+		create_ext_placement_each(fd);
+
+	igt_subtest("create-ext-placement-all")
+		create_ext_placement_all(fd);
+
 }
-- 
2.26.3

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [Intel-gfx] [PATCH i-g-t v3 9/9] tests/i915/gem_exec_basic: Iterate over all memory regions
  2021-05-26 13:00 ` [igt-dev] " Matthew Auld
@ 2021-05-26 13:00   ` Matthew Auld
  -1 siblings, 0 replies; 20+ messages in thread
From: Matthew Auld @ 2021-05-26 13:00 UTC (permalink / raw)
  To: igt-dev
  Cc: Vanshidhar Konda, Dominik Grzegorzek, Janulgue Abdiel, intel-gfx,
	Kalamarz, Lukasz

From: "Kalamarz, Lukasz" <lukasz.kalamarz@intel.com>

As a part of local memory effort we need to make sure, that
every available memory region is covered. This patch is an attempt
for this problem. If it will be accepted it will be replicated on
each test that can actually benefit from it.

Signed-off-by: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com>
Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Cc: Janulgue Abdiel <abdiel.janulgue@intel.com>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Katarzyna Dec <katarzyna.dec@intel.com>
Cc: Vanshidhar Konda <vanshidhar.r.konda@intel.com>
Cc: Stuart Summers <stuart.summers@intel.com>
Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Acked-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/i915/gem_exec_basic.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/i915/gem_exec_basic.c b/tests/i915/gem_exec_basic.c
index 8bc4dc52..872b1d3b 100644
--- a/tests/i915/gem_exec_basic.c
+++ b/tests/i915/gem_exec_basic.c
@@ -56,7 +56,8 @@ igt_main
 		igt_assert(query_info);
 
 		set = get_memory_region_set(query_info,
-					    I915_SYSTEM_MEMORY);
+					    I915_SYSTEM_MEMORY,
+					    I915_DEVICE_MEMORY);
 	}
 
 	igt_subtest_with_dynamic("basic") {
-- 
2.26.3

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

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

* [igt-dev] [PATCH i-g-t v3 9/9] tests/i915/gem_exec_basic: Iterate over all memory regions
@ 2021-05-26 13:00   ` Matthew Auld
  0 siblings, 0 replies; 20+ messages in thread
From: Matthew Auld @ 2021-05-26 13:00 UTC (permalink / raw)
  To: igt-dev
  Cc: Vanshidhar Konda, Petri Latvala, Janulgue Abdiel, intel-gfx,
	Kalamarz, Lukasz

From: "Kalamarz, Lukasz" <lukasz.kalamarz@intel.com>

As a part of local memory effort we need to make sure, that
every available memory region is covered. This patch is an attempt
for this problem. If it will be accepted it will be replicated on
each test that can actually benefit from it.

Signed-off-by: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com>
Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Cc: Janulgue Abdiel <abdiel.janulgue@intel.com>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Katarzyna Dec <katarzyna.dec@intel.com>
Cc: Vanshidhar Konda <vanshidhar.r.konda@intel.com>
Cc: Stuart Summers <stuart.summers@intel.com>
Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Acked-by: Petri Latvala <petri.latvala@intel.com>
---
 tests/i915/gem_exec_basic.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/i915/gem_exec_basic.c b/tests/i915/gem_exec_basic.c
index 8bc4dc52..872b1d3b 100644
--- a/tests/i915/gem_exec_basic.c
+++ b/tests/i915/gem_exec_basic.c
@@ -56,7 +56,8 @@ igt_main
 		igt_assert(query_info);
 
 		set = get_memory_region_set(query_info,
-					    I915_SYSTEM_MEMORY);
+					    I915_SYSTEM_MEMORY,
+					    I915_DEVICE_MEMORY);
 	}
 
 	igt_subtest_with_dynamic("basic") {
-- 
2.26.3

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v3,1/9] i915_drm.h sync
  2021-05-26 13:00 ` [igt-dev] " Matthew Auld
                   ` (8 preceding siblings ...)
  (?)
@ 2021-05-26 15:45 ` Patchwork
  -1 siblings, 0 replies; 20+ messages in thread
From: Patchwork @ 2021-05-26 15:45 UTC (permalink / raw)
  To: Matthew Auld; +Cc: igt-dev


[-- Attachment #1.1: Type: text/plain, Size: 8033 bytes --]

== Series Details ==

Series: series starting with [i-g-t,v3,1/9] i915_drm.h sync
URL   : https://patchwork.freedesktop.org/series/90605/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_10135 -> IGTPW_5852
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/index.html

New tests
---------

  New tests have been introduced between CI_DRM_10135 and IGTPW_5852:

### New IGT tests (5) ###

  * igt@gem_exec_basic@basic@bcs0-smem:
    - Statuses : 34 pass(s)
    - Exec time: [0.0, 0.01] s

  * igt@gem_exec_basic@basic@rcs0-smem:
    - Statuses : 38 pass(s)
    - Exec time: [0.0, 0.02] s

  * igt@gem_exec_basic@basic@vcs0-smem:
    - Statuses : 36 pass(s)
    - Exec time: [0.0, 0.01] s

  * igt@gem_exec_basic@basic@vcs1-smem:
    - Statuses : 9 pass(s)
    - Exec time: [0.0, 0.00] s

  * igt@gem_exec_basic@basic@vecs0-smem:
    - Statuses : 31 pass(s)
    - Exec time: [0.0, 0.01] s

  

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

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

### IGT changes ###

#### Issues hit ####

  * igt@i915_module_load@reload:
    - fi-tgl-y:           [PASS][1] -> [DMESG-WARN][2] ([i915#1982] / [k.org#205379])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10135/fi-tgl-y/igt@i915_module_load@reload.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/fi-tgl-y/igt@i915_module_load@reload.html

  * igt@i915_selftest@live@execlists:
    - fi-bsw-kefka:       NOTRUN -> [INCOMPLETE][3] ([i915#2782] / [i915#2940] / [i915#3462])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/fi-bsw-kefka/igt@i915_selftest@live@execlists.html

  * igt@kms_chamelium@hdmi-edid-read:
    - fi-bsw-kefka:       NOTRUN -> [SKIP][4] ([fdo#109271] / [fdo#111827]) +8 similar issues
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/fi-bsw-kefka/igt@kms_chamelium@hdmi-edid-read.html

  * igt@kms_frontbuffer_tracking@basic:
    - fi-tgl-u2:          [PASS][5] -> [FAIL][6] ([i915#2416])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10135/fi-tgl-u2/igt@kms_frontbuffer_tracking@basic.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/fi-tgl-u2/igt@kms_frontbuffer_tracking@basic.html

  * igt@kms_psr@cursor_plane_move:
    - fi-bsw-kefka:       NOTRUN -> [SKIP][7] ([fdo#109271]) +14 similar issues
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/fi-bsw-kefka/igt@kms_psr@cursor_plane_move.html

  * igt@runner@aborted:
    - fi-bsw-kefka:       NOTRUN -> [FAIL][8] ([fdo#109271] / [i915#1436])
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/fi-bsw-kefka/igt@runner@aborted.html

  
#### Warnings ####

  * igt@i915_pm_rpm@basic-rte:
    - fi-kbl-guc:         [SKIP][9] ([fdo#109271]) -> [FAIL][10] ([i915#579])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10135/fi-kbl-guc/igt@i915_pm_rpm@basic-rte.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/fi-kbl-guc/igt@i915_pm_rpm@basic-rte.html

  * igt@i915_selftest@live@execlists:
    - fi-bsw-nick:        [INCOMPLETE][11] ([i915#2782] / [i915#2940] / [i915#3462]) -> [DMESG-FAIL][12] ([i915#3462])
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10135/fi-bsw-nick/igt@i915_selftest@live@execlists.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/fi-bsw-nick/igt@i915_selftest@live@execlists.html

  * igt@runner@aborted:
    - fi-cfl-8700k:       [FAIL][13] ([i915#2426] / [i915#3363]) -> [FAIL][14] ([i915#3363])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10135/fi-cfl-8700k/igt@runner@aborted.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/fi-cfl-8700k/igt@runner@aborted.html
    - fi-skl-6600u:       [FAIL][15] ([i915#1436] / [i915#2426] / [i915#3363]) -> [FAIL][16] ([i915#1436] / [i915#3363])
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10135/fi-skl-6600u/igt@runner@aborted.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/fi-skl-6600u/igt@runner@aborted.html
    - fi-glk-dsi:         [FAIL][17] ([i915#3363] / [k.org#202321]) -> [FAIL][18] ([i915#2426] / [i915#3363] / [k.org#202321])
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10135/fi-glk-dsi/igt@runner@aborted.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/fi-glk-dsi/igt@runner@aborted.html
    - fi-bdw-5557u:       [FAIL][19] ([i915#3462]) -> [FAIL][20] ([i915#1602] / [i915#2029])
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10135/fi-bdw-5557u/igt@runner@aborted.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/fi-bdw-5557u/igt@runner@aborted.html
    - fi-kbl-7567u:       [FAIL][21] ([i915#1436] / [i915#2426] / [i915#3363]) -> [FAIL][22] ([i915#1436] / [i915#3363])
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10135/fi-kbl-7567u/igt@runner@aborted.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/fi-kbl-7567u/igt@runner@aborted.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
  [fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
  [i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
  [i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
  [i915#1602]: https://gitlab.freedesktop.org/drm/intel/issues/1602
  [i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
  [i915#2029]: https://gitlab.freedesktop.org/drm/intel/issues/2029
  [i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
  [i915#2416]: https://gitlab.freedesktop.org/drm/intel/issues/2416
  [i915#2426]: https://gitlab.freedesktop.org/drm/intel/issues/2426
  [i915#2782]: https://gitlab.freedesktop.org/drm/intel/issues/2782
  [i915#2932]: https://gitlab.freedesktop.org/drm/intel/issues/2932
  [i915#2940]: https://gitlab.freedesktop.org/drm/intel/issues/2940
  [i915#2966]: https://gitlab.freedesktop.org/drm/intel/issues/2966
  [i915#3012]: https://gitlab.freedesktop.org/drm/intel/issues/3012
  [i915#3276]: https://gitlab.freedesktop.org/drm/intel/issues/3276
  [i915#3277]: https://gitlab.freedesktop.org/drm/intel/issues/3277
  [i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
  [i915#3283]: https://gitlab.freedesktop.org/drm/intel/issues/3283
  [i915#3291]: https://gitlab.freedesktop.org/drm/intel/issues/3291
  [i915#3301]: https://gitlab.freedesktop.org/drm/intel/issues/3301
  [i915#3363]: https://gitlab.freedesktop.org/drm/intel/issues/3363
  [i915#3462]: https://gitlab.freedesktop.org/drm/intel/issues/3462
  [i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533
  [i915#579]: https://gitlab.freedesktop.org/drm/intel/issues/579
  [k.org#202321]: https://bugzilla.kernel.org/show_bug.cgi?id=202321
  [k.org#205379]: https://bugzilla.kernel.org/show_bug.cgi?id=205379


Participating hosts (43 -> 40)
------------------------------

  Additional (2): fi-bsw-kefka fi-rkl-11500t 
  Missing    (5): fi-ilk-m540 fi-hsw-4200u fi-bsw-cyan fi-dg1-1 fi-bdw-samus 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_6094 -> IGTPW_5852

  CI-20190529: 20190529
  CI_DRM_10135: 3471adc5883339a844d766db0f8d859009387094 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_5852: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/index.html
  IGT_6094: f62d8953c0bc5ed68ea978662e62f9dbb46cf101 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools



== Testlist changes ==

+igt@gem_create@create-ext-placement-all
+igt@gem_create@create-ext-placement-each
+igt@gem_create@create-ext-placement-sanity-check
+igt@gem_gpgpu_fill@basic
+igt@gem_media_fill@media-fill
-igt@gem_gpgpu_fill
-igt@gem_media_fill

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/index.html

[-- Attachment #1.2: Type: text/html, Size: 9715 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t,v3,1/9] i915_drm.h sync
  2021-05-26 13:00 ` [igt-dev] " Matthew Auld
                   ` (9 preceding siblings ...)
  (?)
@ 2021-05-27  1:01 ` Patchwork
  -1 siblings, 0 replies; 20+ messages in thread
From: Patchwork @ 2021-05-27  1:01 UTC (permalink / raw)
  To: Matthew Auld; +Cc: igt-dev


[-- Attachment #1.1: Type: text/plain, Size: 30269 bytes --]

== Series Details ==

Series: series starting with [i-g-t,v3,1/9] i915_drm.h sync
URL   : https://patchwork.freedesktop.org/series/90605/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_10135_full -> IGTPW_5852_full
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_5852_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_5852_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/index.html

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in IGTPW_5852_full:

### IGT changes ###

#### Possible regressions ####

  * igt@kms_frontbuffer_tracking@fbc-1p-shrfb-fliptrack-mmap-gtt:
    - shard-glk:          [PASS][1] -> [FAIL][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10135/shard-glk9/igt@kms_frontbuffer_tracking@fbc-1p-shrfb-fliptrack-mmap-gtt.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-glk7/igt@kms_frontbuffer_tracking@fbc-1p-shrfb-fliptrack-mmap-gtt.html

  
New tests
---------

  New tests have been introduced between CI_DRM_10135_full and IGTPW_5852_full:

### New IGT tests (6) ###

  * igt@gem_create@create-ext-placement-all:
    - Statuses :
    - Exec time: [None] s

  * igt@gem_create@create-ext-placement-each:
    - Statuses : 4 pass(s)
    - Exec time: [0.0] s

  * igt@gem_create@create-ext-placement-sanity-check:
    - Statuses : 6 pass(s)
    - Exec time: [0.00, 0.01] s

  * igt@gem_gpgpu_fill@basic:
    - Statuses :
    - Exec time: [None] s

  * igt@gem_media_fill@media-fill:
    - Statuses :
    - Exec time: [None] s

  * igt@gem_media_fill@media-fill@smem:
    - Statuses : 5 pass(s)
    - Exec time: [0.00, 0.01] s

  

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

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

### IGT changes ###

#### Issues hit ####

  * igt@feature_discovery@display-3x:
    - shard-glk:          NOTRUN -> [SKIP][3] ([fdo#109271]) +110 similar issues
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-glk5/igt@feature_discovery@display-3x.html
    - shard-iclb:         NOTRUN -> [SKIP][4] ([i915#1839]) +1 similar issue
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb4/igt@feature_discovery@display-3x.html

  * igt@gem_create@create-massive:
    - shard-iclb:         NOTRUN -> [DMESG-WARN][5] ([i915#3002])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb7/igt@gem_create@create-massive.html
    - shard-snb:          NOTRUN -> [DMESG-WARN][6] ([i915#3002])
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-snb7/igt@gem_create@create-massive.html
    - shard-kbl:          NOTRUN -> [DMESG-WARN][7] ([i915#3002])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-kbl2/igt@gem_create@create-massive.html
    - shard-tglb:         NOTRUN -> [DMESG-WARN][8] ([i915#3002])
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-tglb7/igt@gem_create@create-massive.html
    - shard-glk:          NOTRUN -> [DMESG-WARN][9] ([i915#3002])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-glk2/igt@gem_create@create-massive.html
    - shard-apl:          NOTRUN -> [DMESG-WARN][10] ([i915#3002])
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-apl3/igt@gem_create@create-massive.html

  * igt@gem_ctx_isolation@preservation-s3@vecs0:
    - shard-kbl:          [PASS][11] -> [DMESG-WARN][12] ([i915#180]) +4 similar issues
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10135/shard-kbl4/igt@gem_ctx_isolation@preservation-s3@vecs0.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-kbl1/igt@gem_ctx_isolation@preservation-s3@vecs0.html

  * igt@gem_ctx_param@set-priority-not-supported:
    - shard-tglb:         NOTRUN -> [SKIP][13] ([fdo#109314])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-tglb8/igt@gem_ctx_param@set-priority-not-supported.html
    - shard-iclb:         NOTRUN -> [SKIP][14] ([fdo#109314])
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb5/igt@gem_ctx_param@set-priority-not-supported.html

  * igt@gem_ctx_persistence@legacy-engines-mixed:
    - shard-snb:          NOTRUN -> [SKIP][15] ([fdo#109271] / [i915#1099]) +4 similar issues
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-snb5/igt@gem_ctx_persistence@legacy-engines-mixed.html

  * igt@gem_exec_fair@basic-deadline:
    - shard-kbl:          [PASS][16] -> [FAIL][17] ([i915#2846])
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10135/shard-kbl3/igt@gem_exec_fair@basic-deadline.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-kbl7/igt@gem_exec_fair@basic-deadline.html

  * igt@gem_exec_fair@basic-none-share@rcs0:
    - shard-tglb:         [PASS][18] -> [FAIL][19] ([i915#2842]) +1 similar issue
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10135/shard-tglb7/igt@gem_exec_fair@basic-none-share@rcs0.html
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-tglb7/igt@gem_exec_fair@basic-none-share@rcs0.html

  * igt@gem_exec_fair@basic-none-solo@rcs0:
    - shard-kbl:          NOTRUN -> [FAIL][20] ([i915#2842])
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-kbl7/igt@gem_exec_fair@basic-none-solo@rcs0.html

  * igt@gem_exec_fair@basic-pace@vcs1:
    - shard-iclb:         NOTRUN -> [FAIL][21] ([i915#2842]) +1 similar issue
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb4/igt@gem_exec_fair@basic-pace@vcs1.html

  * igt@gem_exec_fair@basic-throttle@rcs0:
    - shard-glk:          NOTRUN -> [FAIL][22] ([i915#2842])
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-glk2/igt@gem_exec_fair@basic-throttle@rcs0.html
    - shard-tglb:         NOTRUN -> [FAIL][23] ([i915#2842]) +1 similar issue
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-tglb8/igt@gem_exec_fair@basic-throttle@rcs0.html

  * igt@gem_exec_reloc@basic-wide-active@rcs0:
    - shard-snb:          NOTRUN -> [FAIL][24] ([i915#2389]) +2 similar issues
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-snb2/igt@gem_exec_reloc@basic-wide-active@rcs0.html

  * igt@gem_mmap_gtt@cpuset-basic-small-copy-odd:
    - shard-snb:          NOTRUN -> [INCOMPLETE][25] ([i915#2055] / [i915#3468])
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-snb5/igt@gem_mmap_gtt@cpuset-basic-small-copy-odd.html

  * igt@gem_mmap_gtt@cpuset-basic-small-copy-xy:
    - shard-glk:          NOTRUN -> [INCOMPLETE][26] ([i915#2055] / [i915#3468])
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-glk2/igt@gem_mmap_gtt@cpuset-basic-small-copy-xy.html

  * igt@gem_mmap_gtt@cpuset-big-copy-odd:
    - shard-iclb:         [PASS][27] -> [FAIL][28] ([i915#307])
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10135/shard-iclb5/igt@gem_mmap_gtt@cpuset-big-copy-odd.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb4/igt@gem_mmap_gtt@cpuset-big-copy-odd.html

  * igt@gem_mmap_gtt@cpuset-medium-copy-xy:
    - shard-glk:          [PASS][29] -> [INCOMPLETE][30] ([i915#3468])
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10135/shard-glk4/igt@gem_mmap_gtt@cpuset-medium-copy-xy.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-glk4/igt@gem_mmap_gtt@cpuset-medium-copy-xy.html

  * igt@gem_mmap_gtt@fault-concurrent-x:
    - shard-apl:          NOTRUN -> [INCOMPLETE][31] ([i915#3468])
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-apl1/igt@gem_mmap_gtt@fault-concurrent-x.html

  * igt@gem_pwrite@basic-exhaustion:
    - shard-snb:          NOTRUN -> [WARN][32] ([i915#2658])
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-snb6/igt@gem_pwrite@basic-exhaustion.html

  * igt@gem_render_copy@x-tiled-to-vebox-yf-tiled:
    - shard-kbl:          NOTRUN -> [SKIP][33] ([fdo#109271]) +187 similar issues
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-kbl3/igt@gem_render_copy@x-tiled-to-vebox-yf-tiled.html
    - shard-iclb:         NOTRUN -> [SKIP][34] ([i915#768]) +2 similar issues
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb7/igt@gem_render_copy@x-tiled-to-vebox-yf-tiled.html

  * igt@gem_userptr_blits@coherency-sync:
    - shard-tglb:         NOTRUN -> [SKIP][35] ([fdo#110542])
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-tglb8/igt@gem_userptr_blits@coherency-sync.html
    - shard-iclb:         NOTRUN -> [SKIP][36] ([fdo#109290])
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb5/igt@gem_userptr_blits@coherency-sync.html

  * igt@gem_userptr_blits@vma-merge:
    - shard-glk:          NOTRUN -> [FAIL][37] ([i915#3318])
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-glk2/igt@gem_userptr_blits@vma-merge.html

  * igt@gen7_exec_parse@batch-without-end:
    - shard-iclb:         NOTRUN -> [SKIP][38] ([fdo#109289]) +1 similar issue
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb5/igt@gen7_exec_parse@batch-without-end.html
    - shard-tglb:         NOTRUN -> [SKIP][39] ([fdo#109289]) +1 similar issue
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-tglb8/igt@gen7_exec_parse@batch-without-end.html

  * igt@gen9_exec_parse@bb-start-cmd:
    - shard-tglb:         NOTRUN -> [SKIP][40] ([fdo#112306]) +1 similar issue
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-tglb8/igt@gen9_exec_parse@bb-start-cmd.html
    - shard-iclb:         NOTRUN -> [SKIP][41] ([fdo#112306]) +2 similar issues
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb4/igt@gen9_exec_parse@bb-start-cmd.html

  * igt@i915_pm_dc@dc6-dpms:
    - shard-kbl:          NOTRUN -> [FAIL][42] ([i915#454])
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-kbl3/igt@i915_pm_dc@dc6-dpms.html

  * igt@i915_pm_dc@dc6-psr:
    - shard-tglb:         NOTRUN -> [FAIL][43] ([i915#454]) +1 similar issue
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-tglb5/igt@i915_pm_dc@dc6-psr.html

  * igt@i915_pm_lpsp@kms-lpsp@kms-lpsp-dp:
    - shard-apl:          NOTRUN -> [SKIP][44] ([fdo#109271] / [i915#1937])
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-apl8/igt@i915_pm_lpsp@kms-lpsp@kms-lpsp-dp.html

  * igt@i915_pm_rc6_residency@rc6-fence:
    - shard-tglb:         NOTRUN -> [WARN][45] ([i915#2681])
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-tglb8/igt@i915_pm_rc6_residency@rc6-fence.html
    - shard-iclb:         NOTRUN -> [WARN][46] ([i915#2684])
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb5/igt@i915_pm_rc6_residency@rc6-fence.html

  * igt@i915_pm_rpm@gem-execbuf-stress-pc8:
    - shard-iclb:         NOTRUN -> [SKIP][47] ([fdo#109293] / [fdo#109506])
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb1/igt@i915_pm_rpm@gem-execbuf-stress-pc8.html
    - shard-tglb:         NOTRUN -> [SKIP][48] ([fdo#109506] / [i915#2411])
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-tglb5/igt@i915_pm_rpm@gem-execbuf-stress-pc8.html

  * igt@i915_selftest@live@execlists:
    - shard-tglb:         NOTRUN -> [INCOMPLETE][49] ([i915#3462])
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-tglb3/igt@i915_selftest@live@execlists.html
    - shard-glk:          NOTRUN -> [DMESG-FAIL][50] ([i915#3462])
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-glk8/igt@i915_selftest@live@execlists.html
    - shard-apl:          NOTRUN -> [DMESG-FAIL][51] ([i915#3462])
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-apl3/igt@i915_selftest@live@execlists.html
    - shard-iclb:         NOTRUN -> [INCOMPLETE][52] ([i915#2782] / [i915#3462])
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb1/igt@i915_selftest@live@execlists.html
    - shard-kbl:          NOTRUN -> [INCOMPLETE][53] ([i915#2782] / [i915#3462] / [i915#794])
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-kbl1/igt@i915_selftest@live@execlists.html

  * igt@i915_selftest@live@gt_lrc:
    - shard-tglb:         NOTRUN -> [DMESG-FAIL][54] ([i915#2373])
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-tglb3/igt@i915_selftest@live@gt_lrc.html

  * igt@i915_selftest@live@gt_pm:
    - shard-tglb:         NOTRUN -> [DMESG-FAIL][55] ([i915#1759] / [i915#2291])
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-tglb3/igt@i915_selftest@live@gt_pm.html

  * igt@kms_big_fb@linear-16bpp-rotate-90:
    - shard-iclb:         NOTRUN -> [SKIP][56] ([fdo#110725] / [fdo#111614]) +3 similar issues
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb7/igt@kms_big_fb@linear-16bpp-rotate-90.html

  * igt@kms_big_fb@x-tiled-16bpp-rotate-90:
    - shard-tglb:         NOTRUN -> [SKIP][57] ([fdo#111614]) +3 similar issues
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-tglb1/igt@kms_big_fb@x-tiled-16bpp-rotate-90.html

  * igt@kms_big_fb@yf-tiled-64bpp-rotate-270:
    - shard-tglb:         NOTRUN -> [SKIP][58] ([fdo#111615]) +2 similar issues
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-tglb5/igt@kms_big_fb@yf-tiled-64bpp-rotate-270.html
    - shard-iclb:         NOTRUN -> [SKIP][59] ([fdo#110723])
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb1/igt@kms_big_fb@yf-tiled-64bpp-rotate-270.html

  * igt@kms_big_joiner@basic:
    - shard-kbl:          NOTRUN -> [SKIP][60] ([fdo#109271] / [i915#2705])
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-kbl1/igt@kms_big_joiner@basic.html
    - shard-apl:          NOTRUN -> [SKIP][61] ([fdo#109271] / [i915#2705])
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-apl7/igt@kms_big_joiner@basic.html

  * igt@kms_color_chamelium@pipe-a-ctm-0-5:
    - shard-apl:          NOTRUN -> [SKIP][62] ([fdo#109271] / [fdo#111827]) +23 similar issues
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-apl8/igt@kms_color_chamelium@pipe-a-ctm-0-5.html

  * igt@kms_color_chamelium@pipe-b-ctm-0-75:
    - shard-tglb:         NOTRUN -> [SKIP][63] ([fdo#109284] / [fdo#111827]) +12 similar issues
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-tglb3/igt@kms_color_chamelium@pipe-b-ctm-0-75.html

  * igt@kms_color_chamelium@pipe-b-degamma:
    - shard-kbl:          NOTRUN -> [SKIP][64] ([fdo#109271] / [fdo#111827]) +19 similar issues
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-kbl3/igt@kms_color_chamelium@pipe-b-degamma.html

  * igt@kms_color_chamelium@pipe-c-ctm-0-5:
    - shard-iclb:         NOTRUN -> [SKIP][65] ([fdo#109284] / [fdo#111827]) +11 similar issues
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb8/igt@kms_color_chamelium@pipe-c-ctm-0-5.html

  * igt@kms_color_chamelium@pipe-d-ctm-0-25:
    - shard-glk:          NOTRUN -> [SKIP][66] ([fdo#109271] / [fdo#111827]) +11 similar issues
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-glk4/igt@kms_color_chamelium@pipe-d-ctm-0-25.html

  * igt@kms_color_chamelium@pipe-d-gamma:
    - shard-iclb:         NOTRUN -> [SKIP][67] ([fdo#109278] / [fdo#109284] / [fdo#111827]) +2 similar issues
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb8/igt@kms_color_chamelium@pipe-d-gamma.html

  * igt@kms_color_chamelium@pipe-invalid-ctm-matrix-sizes:
    - shard-snb:          NOTRUN -> [SKIP][68] ([fdo#109271] / [fdo#111827]) +15 similar issues
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-snb2/igt@kms_color_chamelium@pipe-invalid-ctm-matrix-sizes.html

  * igt@kms_content_protection@atomic:
    - shard-kbl:          NOTRUN -> [TIMEOUT][69] ([i915#1319]) +1 similar issue
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-kbl7/igt@kms_content_protection@atomic.html
    - shard-apl:          NOTRUN -> [TIMEOUT][70] ([i915#1319])
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-apl1/igt@kms_content_protection@atomic.html

  * igt@kms_content_protection@dp-mst-lic-type-0:
    - shard-iclb:         NOTRUN -> [SKIP][71] ([i915#3116])
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb7/igt@kms_content_protection@dp-mst-lic-type-0.html
    - shard-tglb:         NOTRUN -> [SKIP][72] ([i915#3116])
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-tglb8/igt@kms_content_protection@dp-mst-lic-type-0.html

  * igt@kms_cursor_crc@pipe-a-cursor-32x32-sliding:
    - shard-tglb:         NOTRUN -> [SKIP][73] ([i915#3319]) +3 similar issues
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-tglb6/igt@kms_cursor_crc@pipe-a-cursor-32x32-sliding.html

  * igt@kms_cursor_crc@pipe-b-cursor-512x512-rapid-movement:
    - shard-iclb:         NOTRUN -> [SKIP][74] ([fdo#109278] / [fdo#109279]) +1 similar issue
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb3/igt@kms_cursor_crc@pipe-b-cursor-512x512-rapid-movement.html

  * igt@kms_cursor_crc@pipe-d-cursor-32x10-offscreen:
    - shard-iclb:         NOTRUN -> [SKIP][75] ([fdo#109278]) +39 similar issues
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb8/igt@kms_cursor_crc@pipe-d-cursor-32x10-offscreen.html

  * igt@kms_cursor_crc@pipe-d-cursor-512x170-offscreen:
    - shard-tglb:         NOTRUN -> [SKIP][76] ([fdo#109279] / [i915#3359]) +2 similar issues
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-tglb3/igt@kms_cursor_crc@pipe-d-cursor-512x170-offscreen.html

  * igt@kms_cursor_crc@pipe-d-cursor-512x170-rapid-movement:
    - shard-tglb:         NOTRUN -> [SKIP][77] ([i915#3359]) +6 similar issues
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-tglb5/igt@kms_cursor_crc@pipe-d-cursor-512x170-rapid-movement.html

  * igt@kms_cursor_legacy@cursora-vs-flipb-atomic:
    - shard-tglb:         NOTRUN -> [SKIP][78] ([fdo#111825]) +40 similar issues
   [78]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-tglb3/igt@kms_cursor_legacy@cursora-vs-flipb-atomic.html
    - shard-iclb:         NOTRUN -> [SKIP][79] ([fdo#109274] / [fdo#109278])
   [79]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb4/igt@kms_cursor_legacy@cursora-vs-flipb-atomic.html

  * igt@kms_cursor_legacy@pipe-d-single-bo:
    - shard-glk:          NOTRUN -> [SKIP][80] ([fdo#109271] / [i915#533]) +1 similar issue
   [80]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-glk4/igt@kms_cursor_legacy@pipe-d-single-bo.html

  * igt@kms_dp_dsc@basic-dsc-enable-edp:
    - shard-iclb:         NOTRUN -> [SKIP][81] ([fdo#109349])
   [81]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb7/igt@kms_dp_dsc@basic-dsc-enable-edp.html
    - shard-tglb:         NOTRUN -> [CRASH][82] ([i915#3494])
   [82]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-tglb8/igt@kms_dp_dsc@basic-dsc-enable-edp.html

  * igt@kms_dp_tiled_display@basic-test-pattern-with-chamelium:
    - shard-tglb:         NOTRUN -> [SKIP][83] ([i915#2065])
   [83]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-tglb2/igt@kms_dp_tiled_display@basic-test-pattern-with-chamelium.html
    - shard-iclb:         NOTRUN -> [SKIP][84] ([i915#2065])
   [84]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb3/igt@kms_dp_tiled_display@basic-test-pattern-with-chamelium.html

  * igt@kms_flip@2x-flip-vs-wf_vblank-interruptible:
    - shard-iclb:         NOTRUN -> [SKIP][85] ([fdo#109274]) +6 similar issues
   [85]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb5/igt@kms_flip@2x-flip-vs-wf_vblank-interruptible.html

  * igt@kms_flip@2x-plain-flip-fb-recreate@ac-hdmi-a1-hdmi-a2:
    - shard-glk:          NOTRUN -> [FAIL][86] ([i915#2122])
   [86]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-glk7/igt@kms_flip@2x-plain-flip-fb-recreate@ac-hdmi-a1-hdmi-a2.html

  * igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-32bpp-ytilegen12rcccs:
    - shard-apl:          NOTRUN -> [SKIP][87] ([fdo#109271] / [i915#2672]) +1 similar issue
   [87]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-apl7/igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-32bpp-ytilegen12rcccs.html

  * igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-64bpp-ytile:
    - shard-apl:          NOTRUN -> [SKIP][88] ([fdo#109271] / [i915#2642]) +1 similar issue
   [88]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-apl1/igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-64bpp-ytile.html

  * igt@kms_flip_scaled_crc@flip-32bpp-ytileccs-to-64bpp-ytile:
    - shard-kbl:          NOTRUN -> [SKIP][89] ([fdo#109271] / [i915#2642])
   [89]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-kbl7/igt@kms_flip_scaled_crc@flip-32bpp-ytileccs-to-64bpp-ytile.html

  * igt@kms_frontbuffer_tracking@fbc-suspend:
    - shard-apl:          [PASS][90] -> [DMESG-WARN][91] ([i915#180])
   [90]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10135/shard-apl3/igt@kms_frontbuffer_tracking@fbc-suspend.html
   [91]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-apl1/igt@kms_frontbuffer_tracking@fbc-suspend.html

  * igt@kms_frontbuffer_tracking@fbcpsr-2p-scndscrn-shrfb-pgflip-blt:
    - shard-iclb:         NOTRUN -> [SKIP][92] ([fdo#109280]) +37 similar issues
   [92]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb3/igt@kms_frontbuffer_tracking@fbcpsr-2p-scndscrn-shrfb-pgflip-blt.html

  * igt@kms_frontbuffer_tracking@fbcpsr-rgb101010-draw-blt:
    - shard-snb:          NOTRUN -> [SKIP][93] ([fdo#109271]) +335 similar issues
   [93]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-snb5/igt@kms_frontbuffer_tracking@fbcpsr-rgb101010-draw-blt.html

  * igt@kms_multipipe_modeset@basic-max-pipe-crc-check:
    - shard-tglb:         NOTRUN -> [SKIP][94] ([i915#1839]) +1 similar issue
   [94]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-tglb7/igt@kms_multipipe_modeset@basic-max-pipe-crc-check.html

  * igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb:
    - shard-apl:          NOTRUN -> [FAIL][95] ([fdo#108145] / [i915#265]) +2 similar issues
   [95]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-apl3/igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb.html
    - shard-glk:          NOTRUN -> [FAIL][96] ([fdo#108145] / [i915#265])
   [96]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-glk8/igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb.html

  * igt@kms_plane_alpha_blend@pipe-c-constant-alpha-max:
    - shard-kbl:          NOTRUN -> [FAIL][97] ([fdo#108145] / [i915#265]) +2 similar issues
   [97]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-kbl3/igt@kms_plane_alpha_blend@pipe-c-constant-alpha-max.html

  * igt@kms_plane_scaling@scaler-with-clipping-clamping@pipe-c-scaler-with-clipping-clamping:
    - shard-apl:          NOTRUN -> [SKIP][98] ([fdo#109271] / [i915#2733])
   [98]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-apl1/igt@kms_plane_scaling@scaler-with-clipping-clamping@pipe-c-scaler-with-clipping-clamping.html

  * igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area-4:
    - shard-apl:          NOTRUN -> [SKIP][99] ([fdo#109271] / [i915#658]) +5 similar issues
   [99]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-apl2/igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area-4.html
    - shard-tglb:         NOTRUN -> [SKIP][100] ([i915#2920]) +2 similar issues
   [100]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-tglb8/igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area-4.html
    - shard-iclb:         NOTRUN -> [SKIP][101] ([i915#658]) +1 similar issue
   [101]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb5/igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area-4.html

  * igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area-5:
    - shard-glk:          NOTRUN -> [SKIP][102] ([fdo#109271] / [i915#658]) +3 similar issues
   [102]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-glk7/igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area-5.html

  * igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-5:
    - shard-kbl:          NOTRUN -> [SKIP][103] ([fdo#109271] / [i915#658]) +7 similar issues
   [103]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-kbl2/igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-5.html
    - shard-iclb:         NOTRUN -> [SKIP][104] ([i915#2920])
   [104]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb2/igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-5.html

  * igt@kms_psr@psr2_primary_mmap_cpu:
    - shard-iclb:         [PASS][105] -> [SKIP][106] ([fdo#109441]) +1 similar issue
   [105]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10135/shard-iclb2/igt@kms_psr@psr2_primary_mmap_cpu.html
   [106]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb8/igt@kms_psr@psr2_primary_mmap_cpu.html

  * igt@kms_psr@psr2_sprite_mmap_gtt:
    - shard-iclb:         NOTRUN -> [SKIP][107] ([fdo#109441])
   [107]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb4/igt@kms_psr@psr2_sprite_mmap_gtt.html

  * igt@kms_psr@psr2_sprite_plane_onoff:
    - shard-tglb:         NOTRUN -> [FAIL][108] ([i915#132] / [i915#3467]) +1 similar issue
   [108]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-tglb2/igt@kms_psr@psr2_sprite_plane_onoff.html

  * igt@kms_vblank@pipe-d-ts-continuation-idle:
    - shard-apl:          NOTRUN -> [SKIP][109] ([fdo#109271]) +296 similar issues
   [109]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-apl1/igt@kms_vblank@pipe-d-ts-continuation-idle.html

  * igt@kms_vblank@pipe-d-wait-idle:
    - shard-kbl:          NOTRUN -> [SKIP][110] ([fdo#109271] / [i915#533]) +1 similar issue
   [110]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-kbl3/igt@kms_vblank@pipe-d-wait-idle.html

  * igt@kms_writeback@writeback-pixel-formats:
    - shard-kbl:          NOTRUN -> [SKIP][111] ([fdo#109271] / [i915#2437])
   [111]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-kbl3/igt@kms_writeback@writeback-pixel-formats.html
    - shard-iclb:         NOTRUN -> [SKIP][112] ([i915#2437])
   [112]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb7/igt@kms_writeback@writeback-pixel-formats.html

  * igt@nouveau_crc@pipe-b-source-outp-complete:
    - shard-iclb:         NOTRUN -> [SKIP][113] ([i915#2530]) +2 similar issues
   [113]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb7/igt@nouveau_crc@pipe-b-source-outp-complete.html

  * igt@nouveau_crc@pipe-c-ctx-flip-skip-current-frame:
    - shard-tglb:         NOTRUN -> [SKIP][114] ([i915#2530]) +2 similar issues
   [114]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-tglb8/igt@nouveau_crc@pipe-c-ctx-flip-skip-current-frame.html

  * igt@perf_pmu@rc6-suspend:
    - shard-kbl:          NOTRUN -> [DMESG-WARN][115] ([i915#180]) +1 similar issue
   [115]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-kbl3/igt@perf_pmu@rc6-suspend.html

  * igt@prime_nv_pcopy@test1_macro:
    - shard-tglb:         NOTRUN -> [SKIP][116] ([fdo#109291]) +3 similar issues
   [116]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-tglb2/igt@prime_nv_pcopy@test1_macro.html

  * igt@prime_nv_pcopy@test3_3:
    - shard-iclb:         NOTRUN -> [SKIP][117] ([fdo#109291]) +3 similar issues
   [117]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb4/igt@prime_nv_pcopy@test3_3.html

  * igt@sysfs_clients@fair-1:
    - shard-glk:          NOTRUN -> [SKIP][118] ([fdo#109271] / [i915#2994]) +2 similar issues
   [118]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-glk7/igt@sysfs_clients@fair-1.html
    - shard-iclb:         NOTRUN -> [SKIP][119] ([i915#2994]) +2 similar issues
   [119]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb2/igt@sysfs_clients@fair-1.html
    - shard-apl:          NOTRUN -> [SKIP][120] ([fdo#109271] / [i915#2994]) +2 similar issues
   [120]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-apl8/igt@sysfs_clients@fair-1.html
    - shard-tglb:         NOTRUN -> [SKIP][121] ([i915#2994]) +2 similar issues
   [121]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-tglb2/igt@sysfs_clients@fair-1.html

  * igt@sysfs_clients@fair-3:
    - shard-kbl:          NOTRUN -> [SKIP][122] ([fdo#109271] / [i915#2994]) +2 similar issues
   [122]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-kbl3/igt@sysfs_clients@fair-3.html

  * igt@tools_test@sysfs_l3_parity:
    - shard-iclb:         NOTRUN -> [SKIP][123] ([fdo#109307])
   [123]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-iclb1/igt@tools_test@sysfs_l3_parity.html
    - shard-tglb:         NOTRUN -> [SKIP][124] ([fdo#109307])
   [124]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-tglb5/igt@tools_test@sysfs_l3_parity.html

  
#### Possible fixes ####

  * igt@gem_exec_fair@basic-deadline:
    - shard-glk:          [FAIL][125] ([i915#2846]) -> [PASS][126]
   [125]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10135/shard-glk5/igt@gem_exec_fair@basic-deadline.html
   [126]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-glk4/igt@gem_exec_fair@basic-deadline.html

  * igt@gem_mmap_gtt@cpuset-basic-small-copy:
    - shard-tglb:         [INCOMPLETE][127] ([i915#3468]) -> [PASS][128]
   [127]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10135/shard-tglb5/igt@gem_mmap_gtt@cpuset-basic-small-copy.html
   [128]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/shard-tglb8/igt@gem_mmap_gtt@cpuset-basic-small-copy.html

  * igt@gem_mmap_gtt@cpuset-big-copy:
    - shard-iclb:         [FAIL][129] ([i915#2428]) -> [PASS][130]
   [129]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10135/shard-

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5852/index.html

[-- Attachment #1.2: Type: text/html, Size: 34122 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2021-05-27  1:01 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-26 13:00 [Intel-gfx] [PATCH i-g-t v3 1/9] i915_drm.h sync Matthew Auld
2021-05-26 13:00 ` [igt-dev] " Matthew Auld
2021-05-26 13:00 ` [Intel-gfx] [PATCH i-g-t v3 2/9] lib/i915/gem_create: Add gem_create_ext Matthew Auld
2021-05-26 13:00   ` [igt-dev] " Matthew Auld
2021-05-26 13:00 ` [Intel-gfx] [PATCH i-g-t v3 3/9] lib/i915/intel_memory_region: Add new memory region lib Matthew Auld
2021-05-26 13:00   ` [igt-dev] " Matthew Auld
2021-05-26 13:00 ` [Intel-gfx] [PATCH i-g-t v3 4/9] tests/gem_gpgpu_fill: Convert from simple to standard igt_main Matthew Auld
2021-05-26 13:00   ` [igt-dev] " Matthew Auld
2021-05-26 13:00 ` [Intel-gfx] [PATCH i-g-t v3 5/9] tests/i915/gem_exec_basic: Use memory region interface Matthew Auld
2021-05-26 13:00   ` [igt-dev] " Matthew Auld
2021-05-26 13:00 ` [Intel-gfx] [PATCH i-g-t v3 6/9] tests/i915/gem_gpgpu_fill: " Matthew Auld
2021-05-26 13:00   ` [igt-dev] " Matthew Auld
2021-05-26 13:00 ` [Intel-gfx] [PATCH i-g-t v3 7/9] tests/i915/gem_media_fill: " Matthew Auld
2021-05-26 13:00   ` [igt-dev] " Matthew Auld
2021-05-26 13:00 ` [Intel-gfx] [PATCH i-g-t v3 8/9] tests/i915/gem_create: exercise placements extension Matthew Auld
2021-05-26 13:00   ` [igt-dev] " Matthew Auld
2021-05-26 13:00 ` [Intel-gfx] [PATCH i-g-t v3 9/9] tests/i915/gem_exec_basic: Iterate over all memory regions Matthew Auld
2021-05-26 13:00   ` [igt-dev] " Matthew Auld
2021-05-26 15:45 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v3,1/9] i915_drm.h sync Patchwork
2021-05-27  1:01 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

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.