All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Auld <matthew.auld@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: thomas.hellstrom@linux.intel.com,
	Dominik Grzegorzek <dominik.grzegorzek@intel.com>,
	intel-gfx@lists.freedesktop.org,
	Andrzej Turko <andrzej.turko@linux.intel.com>
Subject: [Intel-gfx] [PATCH i-g-t 08/12] Synchronize memory region uapi and tests with i915_drm.h
Date: Tue, 11 May 2021 17:51:13 +0100	[thread overview]
Message-ID: <20210511165117.428062-9-matthew.auld@intel.com> (raw)
In-Reply-To: <20210511165117.428062-1-matthew.auld@intel.com>

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

Erase definitions from intel_memory_region.h and change the procedures
to operate on objects defined in i915_drm.h instead. Those objects
were defined in intel_memory_region.h in order to upstream memory region
stubs before the original definitions from i915_drm.h.

Modify tests using the memory region uapi in order to adapt them to the
changes in lib/i915/intel_memory_region.* files.

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>
---
 lib/i915/gem_create.c          |   4 +-
 lib/i915/gem_create.h          | 106 -------------------------
 lib/i915/intel_memory_region.c |  34 ++++----
 lib/i915/intel_memory_region.h | 138 ++++-----------------------------
 tests/i915/gem_exec_basic.c    |   2 +-
 tests/i915/gem_gpgpu_fill.c    |   2 +-
 tests/i915/gem_media_fill.c    |   2 +-
 7 files changed, 37 insertions(+), 251 deletions(-)

diff --git a/lib/i915/gem_create.c b/lib/i915/gem_create.c
index 530877cc..b2e8d559 100644
--- a/lib/i915/gem_create.c
+++ b/lib/i915/gem_create.c
@@ -51,13 +51,13 @@ 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)
 {
-	struct local_drm_i915_gem_create_ext create = {
+	struct drm_i915_gem_create_ext create = {
 		.size = *size,
 		.extensions = to_user_pointer(ext),
 	};
 	int err = 0;
 
-	if (igt_ioctl(fd, LOCAL_DRM_IOCTL_I915_GEM_CREATE_EXT, &create) == 0) {
+	if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_CREATE_EXT, &create) == 0) {
 		*handle = create.handle;
 		*size = create.size;
 	} else {
diff --git a/lib/i915/gem_create.h b/lib/i915/gem_create.h
index 5a07c1c8..c2b531b4 100644
--- a/lib/i915/gem_create.h
+++ b/lib/i915/gem_create.h
@@ -10,112 +10,6 @@
 
 #include "i915_drm.h"
 
-/**
- * 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 local_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 LOCAL_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 local_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;
-};
-
-#define LOCAL_DRM_I915_GEM_CREATE_EXT 0x3c
-#define LOCAL_DRM_IOCTL_I915_GEM_CREATE_EXT	DRM_IOWR(DRM_COMMAND_BASE + LOCAL_DRM_I915_GEM_CREATE_EXT, \
-						struct local_drm_i915_gem_create_ext)
-
 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,
diff --git a/lib/i915/intel_memory_region.c b/lib/i915/intel_memory_region.c
index 5452dd8e..412367e4 100644
--- a/lib/i915/intel_memory_region.c
+++ b/lib/i915/intel_memory_region.c
@@ -49,7 +49,7 @@ const char *get_memory_region_name(uint32_t region)
 {
 	uint16_t class = MEMORY_TYPE_FROM_REGION(region);
 
-	if (class == LOCAL_I915_MEMORY_CLASS_SYSTEM)
+	if (class == I915_MEMORY_CLASS_SYSTEM)
 		return "smem";
 
 	igt_assert_f(false, "Unknown memory region");
@@ -116,15 +116,15 @@ static uint64_t __get_available_smem(int fd)
  *
  * Returns: Filled struct with available memory regions.
  */
-struct local_drm_i915_query_memory_regions *gem_get_query_memory_regions(int fd)
+struct drm_i915_query_memory_regions *gem_get_query_memory_regions(int fd)
 {
-	struct local_drm_i915_query_memory_regions *query_info;
+	struct drm_i915_query_memory_regions *query_info;
 
-	query_info = calloc(1, sizeof(struct local_drm_i915_query_memory_regions)
-			    + sizeof(struct local_drm_i915_memory_region_info));
+	query_info = calloc(1, sizeof(struct drm_i915_query_memory_regions)
+			    + sizeof(struct drm_i915_memory_region_info));
 
 	query_info->num_regions = 1;
-	query_info->regions[0].region.memory_class = LOCAL_I915_MEMORY_CLASS_SYSTEM;
+	query_info->regions[0].region.memory_class = I915_MEMORY_CLASS_SYSTEM;
 	query_info->regions[0].probed_size = intel_get_total_ram_mb() << 20;
 	query_info->regions[0].unallocated_size = __get_available_smem(fd);
 
@@ -134,7 +134,7 @@ struct local_drm_i915_query_memory_regions *gem_get_query_memory_regions(int fd)
 /* 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 local_drm_i915_gem_memory_class_instance *mem_regions,
+				       struct drm_i915_gem_memory_class_instance *mem_regions,
 				       int num_regions)
 {
 	/* a temporary solution, to be removed when these arguments will be used */
@@ -151,7 +151,7 @@ int __gem_create_in_memory_region_list(int fd, uint32_t *handle, uint64_t size,
  * @num_regions: @mem_regions length
  */
 uint32_t gem_create_in_memory_region_list(int fd, uint64_t size,
-					  struct local_drm_i915_gem_memory_class_instance *mem_regions,
+					  struct drm_i915_gem_memory_class_instance *mem_regions,
 					  int num_regions)
 {
 	uint32_t handle;
@@ -161,7 +161,7 @@ uint32_t gem_create_in_memory_region_list(int fd, uint64_t size,
 	return handle;
 }
 
-static bool __region_belongs_to_regions_type(struct local_drm_i915_gem_memory_class_instance region,
+static bool __region_belongs_to_regions_type(struct drm_i915_gem_memory_class_instance region,
 					     uint32_t *mem_regions_type,
 					     int num_regions)
 {
@@ -172,11 +172,11 @@ static bool __region_belongs_to_regions_type(struct local_drm_i915_gem_memory_cl
 }
 
 struct igt_collection *
-__get_memory_region_set(struct local_drm_i915_query_memory_regions *regions,
+__get_memory_region_set(struct drm_i915_query_memory_regions *regions,
 			uint32_t *mem_regions_type,
 			int num_regions)
 {
-	struct local_drm_i915_gem_memory_class_instance region;
+	struct drm_i915_gem_memory_class_instance region;
 	struct igt_collection *set;
 	int count = 0, pos = 0;
 
@@ -252,7 +252,7 @@ char *memregion_dynamic_subtest_name(struct igt_collection *set)
  *
  * Outputs memory regions and their sizes.
  */
-void intel_dump_gpu_meminfo(struct local_drm_i915_query_memory_regions *info)
+void intel_dump_gpu_meminfo(struct drm_i915_query_memory_regions *info)
 {
 	int i;
 
@@ -279,7 +279,7 @@ void intel_dump_gpu_meminfo(struct local_drm_i915_query_memory_regions *info)
  *
  * Returns: number of regions for type @memory_class
  */
-uint32_t gpu_meminfo_region_count(struct local_drm_i915_query_memory_regions *info,
+uint32_t gpu_meminfo_region_count(struct drm_i915_query_memory_regions *info,
 				  uint16_t memory_class)
 {
 	uint32_t num = 0;
@@ -302,7 +302,7 @@ uint32_t gpu_meminfo_region_count(struct local_drm_i915_query_memory_regions *in
  * 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 local_drm_i915_query_memory_regions *info,
+uint64_t gpu_meminfo_region_total_size(struct drm_i915_query_memory_regions *info,
 				       uint16_t memory_class)
 {
 	uint64_t total = 0;
@@ -329,7 +329,7 @@ uint64_t gpu_meminfo_region_total_size(struct local_drm_i915_query_memory_region
  * 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 local_drm_i915_query_memory_regions *info,
+uint64_t gpu_meminfo_region_total_available(struct drm_i915_query_memory_regions *info,
 					    uint16_t memory_class)
 {
 	uint64_t avail = 0;
@@ -357,7 +357,7 @@ uint64_t gpu_meminfo_region_total_available(struct local_drm_i915_query_memory_r
  * Returns: available size of @memory_instance which type is @memory_class, -1
  * when the size is unknown
  */
-uint64_t gpu_meminfo_region_size(struct local_drm_i915_query_memory_regions *info,
+uint64_t gpu_meminfo_region_size(struct drm_i915_query_memory_regions *info,
 				 uint16_t memory_class,
 				 uint16_t memory_instance)
 {
@@ -382,7 +382,7 @@ uint64_t gpu_meminfo_region_size(struct local_drm_i915_query_memory_regions *inf
  * 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 local_drm_i915_query_memory_regions *info,
+uint64_t gpu_meminfo_region_available(struct drm_i915_query_memory_regions *info,
 				      uint16_t memory_class,
 				      uint16_t memory_instance)
 {
diff --git a/lib/i915/intel_memory_region.h b/lib/i915/intel_memory_region.h
index b8ea22b5..0ddc9f98 100644
--- a/lib/i915/intel_memory_region.h
+++ b/lib/i915/intel_memory_region.h
@@ -25,7 +25,7 @@
 #ifndef INTEL_MEMORY_REGION_H
 #define INTEL_MEMORY_REGION_H
 
-#define I915_SYSTEM_MEMORY LOCAL_I915_MEMORY_CLASS_SYSTEM
+#define I915_SYSTEM_MEMORY I915_MEMORY_CLASS_SYSTEM
 
 #define INTEL_MEMORY_REGION_ID(type, instance) ((type) << 16u | (instance))
 #define MEMORY_TYPE_FROM_REGION(r) ((r) >> 16u)
@@ -35,130 +35,22 @@
 	(MEMORY_TYPE_FROM_REGION(region) == type)
 
 #define IS_SYSTEM_MEMORY_REGION(region) \
-	IS_MEMORY_REGION_TYPE(region, LOCAL_I915_MEMORY_CLASS_SYSTEM)
+	IS_MEMORY_REGION_TYPE(region, I915_MEMORY_CLASS_SYSTEM)
 
-#define REGION_SMEM    INTEL_MEMORY_REGION_ID(LOCAL_I915_MEMORY_CLASS_SYSTEM, 0)
-
-/**
- * enum drm_i915_gem_memory_class - Supported memory classes
- */
-enum local_drm_i915_gem_memory_class {
-	/** @I915_MEMORY_CLASS_SYSTEM: System memory */
-	LOCAL_I915_MEMORY_CLASS_SYSTEM = 0,
-	/** @I915_MEMORY_CLASS_DEVICE: Device local-memory */
-	LOCAL_I915_MEMORY_CLASS_DEVICE,
-};
-
-/**
- * struct drm_i915_gem_memory_class_instance - Identify particular memory region
- */
-struct local_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(see @caps) for a given region, which
- * could include things like if the region is CPU mappable/accessible, what are
- * the supported mapping types etc.
- *
- * 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 local_drm_i915_memory_region_info {
-	/** @region: The class:instance pair encoding */
-	struct local_drm_i915_gem_memory_class_instance region;
-
-	/** @pad: MBZ */
-	__u32 pad;
-
-	/** @caps: MBZ */
-	__u64 caps;
-
-	/** @probed_size: Memory probed by the driver (-1 = unknown) */
-	__u64 probed_size;
-
-	/** @unallocated_size: Estimate of memory remaining (-1 = unknown) */
-	__u64 unallocated_size;
-};
-
-/**
- * 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 local_drm_i915_query_memory_regions {
-	/** @num_regions: Number of supported regions */
-	__u32 num_regions;
-
-	/** @pad: MBZ */
-	__u32 pad;
-
-	/** @regions: Info about each supported region */
-	struct local_drm_i915_memory_region_info regions[];
-};
+#define REGION_SMEM    INTEL_MEMORY_REGION_ID(I915_MEMORY_CLASS_SYSTEM, 0)
 
 const char *get_memory_region_name(uint32_t region);
 uint32_t gem_get_batch_size(int fd, uint8_t mem_region_type);
 
-struct local_drm_i915_query_memory_regions *gem_get_query_memory_regions(int fd);
+struct drm_i915_query_memory_regions *gem_get_query_memory_regions(int fd);
 
 
 int __gem_create_in_memory_region_list(int fd, uint32_t *handle, uint64_t size,
-				       struct local_drm_i915_gem_memory_class_instance *mem_regions,
+				       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 local_drm_i915_gem_memory_class_instance *mem_regions,
+					  struct drm_i915_gem_memory_class_instance *mem_regions,
 					  int num_regions);
 
 /*
@@ -168,7 +60,7 @@ uint32_t gem_create_in_memory_region_list(int fd, uint64_t size,
  */
 #define __gem_create_in_memory_regions(fd, handle, size, regions...) ({ \
 	unsigned int arr__[] = { regions }; \
-	struct local_drm_i915_gem_memory_class_instance arr_query__[ARRAY_SIZE(arr__)]; \
+	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__]);  \
@@ -177,7 +69,7 @@ uint32_t gem_create_in_memory_region_list(int fd, uint64_t size,
 })
 #define gem_create_in_memory_regions(fd, size, regions...) ({ \
 	unsigned int arr__[] = { regions }; \
-	struct local_drm_i915_gem_memory_class_instance arr_query__[ARRAY_SIZE(arr__)]; \
+	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__]);  \
@@ -186,7 +78,7 @@ uint32_t gem_create_in_memory_region_list(int fd, uint64_t size,
 })
 
 struct igt_collection *
-__get_memory_region_set(struct local_drm_i915_query_memory_regions *regions,
+__get_memory_region_set(struct drm_i915_query_memory_regions *regions,
 			uint32_t *mem_regions_type,
 			int num_regions);
 
@@ -201,19 +93,19 @@ __get_memory_region_set(struct local_drm_i915_query_memory_regions *regions,
 
 char *memregion_dynamic_subtest_name(struct igt_collection *set);
 
-void intel_dump_gpu_meminfo(struct local_drm_i915_query_memory_regions *info);
+void intel_dump_gpu_meminfo(struct drm_i915_query_memory_regions *info);
 
-uint32_t gpu_meminfo_region_count(struct local_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 local_drm_i915_query_memory_regions *info,
+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 local_drm_i915_query_memory_regions *info,
+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 local_drm_i915_query_memory_regions *info,
+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 local_drm_i915_query_memory_regions *info,
+uint64_t gpu_meminfo_region_available(struct drm_i915_query_memory_regions *info,
 				      uint16_t memory_class,
 				      uint16_t memory_instance);
 
diff --git a/tests/i915/gem_exec_basic.c b/tests/i915/gem_exec_basic.c
index d1569781..8bc4dc52 100644
--- a/tests/i915/gem_exec_basic.c
+++ b/tests/i915/gem_exec_basic.c
@@ -42,7 +42,7 @@ static uint32_t batch_create(int fd, uint32_t batch_size, uint32_t region)
 igt_main
 {
 	const struct intel_execution_engine2 *e;
-	struct local_drm_i915_query_memory_regions *query_info;
+	struct drm_i915_query_memory_regions *query_info;
 	struct igt_collection *regions, *set;
 	uint32_t batch_size;
 	int fd = -1;
diff --git a/tests/i915/gem_gpgpu_fill.c b/tests/i915/gem_gpgpu_fill.c
index a6da3bce..1fcd42e2 100644
--- a/tests/i915/gem_gpgpu_fill.c
+++ b/tests/i915/gem_gpgpu_fill.c
@@ -133,7 +133,7 @@ igt_main
 {
 	data_t data = {0, };
 	igt_fillfunc_t fill_fn = NULL;
-	struct local_drm_i915_query_memory_regions *region_info;
+	struct drm_i915_query_memory_regions *region_info;
 	struct igt_collection *region_set;
 
 	igt_fixture {
diff --git a/tests/i915/gem_media_fill.c b/tests/i915/gem_media_fill.c
index bbd2110f..28c18e79 100644
--- a/tests/i915/gem_media_fill.c
+++ b/tests/i915/gem_media_fill.c
@@ -136,7 +136,7 @@ igt_main
 {
 	data_t data = {0, };
 	igt_fillfunc_t fill_fn = NULL;
-	struct local_drm_i915_query_memory_regions *query_info;
+	struct drm_i915_query_memory_regions *query_info;
 	struct igt_collection *set, *region_set;
 
 	igt_fixture {
-- 
2.26.3

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

WARNING: multiple messages have this Message-ID (diff)
From: Matthew Auld <matthew.auld@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: thomas.hellstrom@linux.intel.com, petri.latvala@intel.com,
	intel-gfx@lists.freedesktop.org, daniel@ffwll.ch
Subject: [igt-dev] [PATCH i-g-t 08/12] Synchronize memory region uapi and tests with i915_drm.h
Date: Tue, 11 May 2021 17:51:13 +0100	[thread overview]
Message-ID: <20210511165117.428062-9-matthew.auld@intel.com> (raw)
In-Reply-To: <20210511165117.428062-1-matthew.auld@intel.com>

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

Erase definitions from intel_memory_region.h and change the procedures
to operate on objects defined in i915_drm.h instead. Those objects
were defined in intel_memory_region.h in order to upstream memory region
stubs before the original definitions from i915_drm.h.

Modify tests using the memory region uapi in order to adapt them to the
changes in lib/i915/intel_memory_region.* files.

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>
---
 lib/i915/gem_create.c          |   4 +-
 lib/i915/gem_create.h          | 106 -------------------------
 lib/i915/intel_memory_region.c |  34 ++++----
 lib/i915/intel_memory_region.h | 138 ++++-----------------------------
 tests/i915/gem_exec_basic.c    |   2 +-
 tests/i915/gem_gpgpu_fill.c    |   2 +-
 tests/i915/gem_media_fill.c    |   2 +-
 7 files changed, 37 insertions(+), 251 deletions(-)

diff --git a/lib/i915/gem_create.c b/lib/i915/gem_create.c
index 530877cc..b2e8d559 100644
--- a/lib/i915/gem_create.c
+++ b/lib/i915/gem_create.c
@@ -51,13 +51,13 @@ 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)
 {
-	struct local_drm_i915_gem_create_ext create = {
+	struct drm_i915_gem_create_ext create = {
 		.size = *size,
 		.extensions = to_user_pointer(ext),
 	};
 	int err = 0;
 
-	if (igt_ioctl(fd, LOCAL_DRM_IOCTL_I915_GEM_CREATE_EXT, &create) == 0) {
+	if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_CREATE_EXT, &create) == 0) {
 		*handle = create.handle;
 		*size = create.size;
 	} else {
diff --git a/lib/i915/gem_create.h b/lib/i915/gem_create.h
index 5a07c1c8..c2b531b4 100644
--- a/lib/i915/gem_create.h
+++ b/lib/i915/gem_create.h
@@ -10,112 +10,6 @@
 
 #include "i915_drm.h"
 
-/**
- * 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 local_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 LOCAL_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 local_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;
-};
-
-#define LOCAL_DRM_I915_GEM_CREATE_EXT 0x3c
-#define LOCAL_DRM_IOCTL_I915_GEM_CREATE_EXT	DRM_IOWR(DRM_COMMAND_BASE + LOCAL_DRM_I915_GEM_CREATE_EXT, \
-						struct local_drm_i915_gem_create_ext)
-
 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,
diff --git a/lib/i915/intel_memory_region.c b/lib/i915/intel_memory_region.c
index 5452dd8e..412367e4 100644
--- a/lib/i915/intel_memory_region.c
+++ b/lib/i915/intel_memory_region.c
@@ -49,7 +49,7 @@ const char *get_memory_region_name(uint32_t region)
 {
 	uint16_t class = MEMORY_TYPE_FROM_REGION(region);
 
-	if (class == LOCAL_I915_MEMORY_CLASS_SYSTEM)
+	if (class == I915_MEMORY_CLASS_SYSTEM)
 		return "smem";
 
 	igt_assert_f(false, "Unknown memory region");
@@ -116,15 +116,15 @@ static uint64_t __get_available_smem(int fd)
  *
  * Returns: Filled struct with available memory regions.
  */
-struct local_drm_i915_query_memory_regions *gem_get_query_memory_regions(int fd)
+struct drm_i915_query_memory_regions *gem_get_query_memory_regions(int fd)
 {
-	struct local_drm_i915_query_memory_regions *query_info;
+	struct drm_i915_query_memory_regions *query_info;
 
-	query_info = calloc(1, sizeof(struct local_drm_i915_query_memory_regions)
-			    + sizeof(struct local_drm_i915_memory_region_info));
+	query_info = calloc(1, sizeof(struct drm_i915_query_memory_regions)
+			    + sizeof(struct drm_i915_memory_region_info));
 
 	query_info->num_regions = 1;
-	query_info->regions[0].region.memory_class = LOCAL_I915_MEMORY_CLASS_SYSTEM;
+	query_info->regions[0].region.memory_class = I915_MEMORY_CLASS_SYSTEM;
 	query_info->regions[0].probed_size = intel_get_total_ram_mb() << 20;
 	query_info->regions[0].unallocated_size = __get_available_smem(fd);
 
@@ -134,7 +134,7 @@ struct local_drm_i915_query_memory_regions *gem_get_query_memory_regions(int fd)
 /* 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 local_drm_i915_gem_memory_class_instance *mem_regions,
+				       struct drm_i915_gem_memory_class_instance *mem_regions,
 				       int num_regions)
 {
 	/* a temporary solution, to be removed when these arguments will be used */
@@ -151,7 +151,7 @@ int __gem_create_in_memory_region_list(int fd, uint32_t *handle, uint64_t size,
  * @num_regions: @mem_regions length
  */
 uint32_t gem_create_in_memory_region_list(int fd, uint64_t size,
-					  struct local_drm_i915_gem_memory_class_instance *mem_regions,
+					  struct drm_i915_gem_memory_class_instance *mem_regions,
 					  int num_regions)
 {
 	uint32_t handle;
@@ -161,7 +161,7 @@ uint32_t gem_create_in_memory_region_list(int fd, uint64_t size,
 	return handle;
 }
 
-static bool __region_belongs_to_regions_type(struct local_drm_i915_gem_memory_class_instance region,
+static bool __region_belongs_to_regions_type(struct drm_i915_gem_memory_class_instance region,
 					     uint32_t *mem_regions_type,
 					     int num_regions)
 {
@@ -172,11 +172,11 @@ static bool __region_belongs_to_regions_type(struct local_drm_i915_gem_memory_cl
 }
 
 struct igt_collection *
-__get_memory_region_set(struct local_drm_i915_query_memory_regions *regions,
+__get_memory_region_set(struct drm_i915_query_memory_regions *regions,
 			uint32_t *mem_regions_type,
 			int num_regions)
 {
-	struct local_drm_i915_gem_memory_class_instance region;
+	struct drm_i915_gem_memory_class_instance region;
 	struct igt_collection *set;
 	int count = 0, pos = 0;
 
@@ -252,7 +252,7 @@ char *memregion_dynamic_subtest_name(struct igt_collection *set)
  *
  * Outputs memory regions and their sizes.
  */
-void intel_dump_gpu_meminfo(struct local_drm_i915_query_memory_regions *info)
+void intel_dump_gpu_meminfo(struct drm_i915_query_memory_regions *info)
 {
 	int i;
 
@@ -279,7 +279,7 @@ void intel_dump_gpu_meminfo(struct local_drm_i915_query_memory_regions *info)
  *
  * Returns: number of regions for type @memory_class
  */
-uint32_t gpu_meminfo_region_count(struct local_drm_i915_query_memory_regions *info,
+uint32_t gpu_meminfo_region_count(struct drm_i915_query_memory_regions *info,
 				  uint16_t memory_class)
 {
 	uint32_t num = 0;
@@ -302,7 +302,7 @@ uint32_t gpu_meminfo_region_count(struct local_drm_i915_query_memory_regions *in
  * 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 local_drm_i915_query_memory_regions *info,
+uint64_t gpu_meminfo_region_total_size(struct drm_i915_query_memory_regions *info,
 				       uint16_t memory_class)
 {
 	uint64_t total = 0;
@@ -329,7 +329,7 @@ uint64_t gpu_meminfo_region_total_size(struct local_drm_i915_query_memory_region
  * 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 local_drm_i915_query_memory_regions *info,
+uint64_t gpu_meminfo_region_total_available(struct drm_i915_query_memory_regions *info,
 					    uint16_t memory_class)
 {
 	uint64_t avail = 0;
@@ -357,7 +357,7 @@ uint64_t gpu_meminfo_region_total_available(struct local_drm_i915_query_memory_r
  * Returns: available size of @memory_instance which type is @memory_class, -1
  * when the size is unknown
  */
-uint64_t gpu_meminfo_region_size(struct local_drm_i915_query_memory_regions *info,
+uint64_t gpu_meminfo_region_size(struct drm_i915_query_memory_regions *info,
 				 uint16_t memory_class,
 				 uint16_t memory_instance)
 {
@@ -382,7 +382,7 @@ uint64_t gpu_meminfo_region_size(struct local_drm_i915_query_memory_regions *inf
  * 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 local_drm_i915_query_memory_regions *info,
+uint64_t gpu_meminfo_region_available(struct drm_i915_query_memory_regions *info,
 				      uint16_t memory_class,
 				      uint16_t memory_instance)
 {
diff --git a/lib/i915/intel_memory_region.h b/lib/i915/intel_memory_region.h
index b8ea22b5..0ddc9f98 100644
--- a/lib/i915/intel_memory_region.h
+++ b/lib/i915/intel_memory_region.h
@@ -25,7 +25,7 @@
 #ifndef INTEL_MEMORY_REGION_H
 #define INTEL_MEMORY_REGION_H
 
-#define I915_SYSTEM_MEMORY LOCAL_I915_MEMORY_CLASS_SYSTEM
+#define I915_SYSTEM_MEMORY I915_MEMORY_CLASS_SYSTEM
 
 #define INTEL_MEMORY_REGION_ID(type, instance) ((type) << 16u | (instance))
 #define MEMORY_TYPE_FROM_REGION(r) ((r) >> 16u)
@@ -35,130 +35,22 @@
 	(MEMORY_TYPE_FROM_REGION(region) == type)
 
 #define IS_SYSTEM_MEMORY_REGION(region) \
-	IS_MEMORY_REGION_TYPE(region, LOCAL_I915_MEMORY_CLASS_SYSTEM)
+	IS_MEMORY_REGION_TYPE(region, I915_MEMORY_CLASS_SYSTEM)
 
-#define REGION_SMEM    INTEL_MEMORY_REGION_ID(LOCAL_I915_MEMORY_CLASS_SYSTEM, 0)
-
-/**
- * enum drm_i915_gem_memory_class - Supported memory classes
- */
-enum local_drm_i915_gem_memory_class {
-	/** @I915_MEMORY_CLASS_SYSTEM: System memory */
-	LOCAL_I915_MEMORY_CLASS_SYSTEM = 0,
-	/** @I915_MEMORY_CLASS_DEVICE: Device local-memory */
-	LOCAL_I915_MEMORY_CLASS_DEVICE,
-};
-
-/**
- * struct drm_i915_gem_memory_class_instance - Identify particular memory region
- */
-struct local_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(see @caps) for a given region, which
- * could include things like if the region is CPU mappable/accessible, what are
- * the supported mapping types etc.
- *
- * 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 local_drm_i915_memory_region_info {
-	/** @region: The class:instance pair encoding */
-	struct local_drm_i915_gem_memory_class_instance region;
-
-	/** @pad: MBZ */
-	__u32 pad;
-
-	/** @caps: MBZ */
-	__u64 caps;
-
-	/** @probed_size: Memory probed by the driver (-1 = unknown) */
-	__u64 probed_size;
-
-	/** @unallocated_size: Estimate of memory remaining (-1 = unknown) */
-	__u64 unallocated_size;
-};
-
-/**
- * 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 local_drm_i915_query_memory_regions {
-	/** @num_regions: Number of supported regions */
-	__u32 num_regions;
-
-	/** @pad: MBZ */
-	__u32 pad;
-
-	/** @regions: Info about each supported region */
-	struct local_drm_i915_memory_region_info regions[];
-};
+#define REGION_SMEM    INTEL_MEMORY_REGION_ID(I915_MEMORY_CLASS_SYSTEM, 0)
 
 const char *get_memory_region_name(uint32_t region);
 uint32_t gem_get_batch_size(int fd, uint8_t mem_region_type);
 
-struct local_drm_i915_query_memory_regions *gem_get_query_memory_regions(int fd);
+struct drm_i915_query_memory_regions *gem_get_query_memory_regions(int fd);
 
 
 int __gem_create_in_memory_region_list(int fd, uint32_t *handle, uint64_t size,
-				       struct local_drm_i915_gem_memory_class_instance *mem_regions,
+				       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 local_drm_i915_gem_memory_class_instance *mem_regions,
+					  struct drm_i915_gem_memory_class_instance *mem_regions,
 					  int num_regions);
 
 /*
@@ -168,7 +60,7 @@ uint32_t gem_create_in_memory_region_list(int fd, uint64_t size,
  */
 #define __gem_create_in_memory_regions(fd, handle, size, regions...) ({ \
 	unsigned int arr__[] = { regions }; \
-	struct local_drm_i915_gem_memory_class_instance arr_query__[ARRAY_SIZE(arr__)]; \
+	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__]);  \
@@ -177,7 +69,7 @@ uint32_t gem_create_in_memory_region_list(int fd, uint64_t size,
 })
 #define gem_create_in_memory_regions(fd, size, regions...) ({ \
 	unsigned int arr__[] = { regions }; \
-	struct local_drm_i915_gem_memory_class_instance arr_query__[ARRAY_SIZE(arr__)]; \
+	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__]);  \
@@ -186,7 +78,7 @@ uint32_t gem_create_in_memory_region_list(int fd, uint64_t size,
 })
 
 struct igt_collection *
-__get_memory_region_set(struct local_drm_i915_query_memory_regions *regions,
+__get_memory_region_set(struct drm_i915_query_memory_regions *regions,
 			uint32_t *mem_regions_type,
 			int num_regions);
 
@@ -201,19 +93,19 @@ __get_memory_region_set(struct local_drm_i915_query_memory_regions *regions,
 
 char *memregion_dynamic_subtest_name(struct igt_collection *set);
 
-void intel_dump_gpu_meminfo(struct local_drm_i915_query_memory_regions *info);
+void intel_dump_gpu_meminfo(struct drm_i915_query_memory_regions *info);
 
-uint32_t gpu_meminfo_region_count(struct local_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 local_drm_i915_query_memory_regions *info,
+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 local_drm_i915_query_memory_regions *info,
+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 local_drm_i915_query_memory_regions *info,
+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 local_drm_i915_query_memory_regions *info,
+uint64_t gpu_meminfo_region_available(struct drm_i915_query_memory_regions *info,
 				      uint16_t memory_class,
 				      uint16_t memory_instance);
 
diff --git a/tests/i915/gem_exec_basic.c b/tests/i915/gem_exec_basic.c
index d1569781..8bc4dc52 100644
--- a/tests/i915/gem_exec_basic.c
+++ b/tests/i915/gem_exec_basic.c
@@ -42,7 +42,7 @@ static uint32_t batch_create(int fd, uint32_t batch_size, uint32_t region)
 igt_main
 {
 	const struct intel_execution_engine2 *e;
-	struct local_drm_i915_query_memory_regions *query_info;
+	struct drm_i915_query_memory_regions *query_info;
 	struct igt_collection *regions, *set;
 	uint32_t batch_size;
 	int fd = -1;
diff --git a/tests/i915/gem_gpgpu_fill.c b/tests/i915/gem_gpgpu_fill.c
index a6da3bce..1fcd42e2 100644
--- a/tests/i915/gem_gpgpu_fill.c
+++ b/tests/i915/gem_gpgpu_fill.c
@@ -133,7 +133,7 @@ igt_main
 {
 	data_t data = {0, };
 	igt_fillfunc_t fill_fn = NULL;
-	struct local_drm_i915_query_memory_regions *region_info;
+	struct drm_i915_query_memory_regions *region_info;
 	struct igt_collection *region_set;
 
 	igt_fixture {
diff --git a/tests/i915/gem_media_fill.c b/tests/i915/gem_media_fill.c
index bbd2110f..28c18e79 100644
--- a/tests/i915/gem_media_fill.c
+++ b/tests/i915/gem_media_fill.c
@@ -136,7 +136,7 @@ igt_main
 {
 	data_t data = {0, };
 	igt_fillfunc_t fill_fn = NULL;
-	struct local_drm_i915_query_memory_regions *query_info;
+	struct drm_i915_query_memory_regions *query_info;
 	struct igt_collection *set, *region_set;
 
 	igt_fixture {
-- 
2.26.3

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

  parent reply	other threads:[~2021-05-11 16:51 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-11 16:51 [Intel-gfx] [PATCH i-g-t 00/12] DG1/LMEM uAPI basics Matthew Auld
2021-05-11 16:51 ` [igt-dev] " Matthew Auld
2021-05-11 16:51 ` [Intel-gfx] [PATCH i-g-t 01/12] lib/i915/gem_create: Add gem_create_ext Matthew Auld
2021-05-11 16:51   ` [igt-dev] " Matthew Auld
2021-05-11 16:51 ` [Intel-gfx] [PATCH i-g-t 02/12] lib/i915/intel_memory_region: Add memory regions stubs Matthew Auld
2021-05-11 16:51 ` [Intel-gfx] [PATCH i-g-t 03/12] tests/gem_gpgpu_fill: Convert from simple to standard igt_main Matthew Auld
2021-05-11 16:51   ` [igt-dev] " Matthew Auld
2021-05-11 16:51 ` [Intel-gfx] [PATCH i-g-t 04/12] tests/i915/gem_exec_basic: Use memory region interface Matthew Auld
2021-05-11 16:51 ` [Intel-gfx] [PATCH i-g-t 05/12] tests/i915/gem_gpgpu_fill: " Matthew Auld
2021-05-11 16:51   ` [igt-dev] " Matthew Auld
2021-05-11 16:51 ` [Intel-gfx] [PATCH i-g-t 06/12] tests/i915/gem_media_fill: " Matthew Auld
2021-05-11 16:51   ` [igt-dev] " Matthew Auld
2021-05-11 16:51 ` [Intel-gfx] [PATCH i-g-t 07/12] i915_drm.h sync Matthew Auld
2021-05-11 16:51   ` [igt-dev] " Matthew Auld
2021-05-19  8:19   ` [Intel-gfx] " Petri Latvala
2021-05-19  8:19     ` [igt-dev] " Petri Latvala
2021-05-19  8:25     ` [Intel-gfx] " Jani Nikula
2021-05-19  8:25       ` [igt-dev] " Jani Nikula
2021-05-11 16:51 ` Matthew Auld [this message]
2021-05-11 16:51   ` [igt-dev] [PATCH i-g-t 08/12] Synchronize memory region uapi and tests with i915_drm.h Matthew Auld
2021-05-11 16:51 ` [Intel-gfx] [PATCH i-g-t 09/12] lib/i915/intel_memory_region/dg1: Add new lib to query memory region Matthew Auld
2021-05-11 16:51   ` [igt-dev] " Matthew Auld
2021-05-11 16:51 ` [Intel-gfx] [PATCH i-g-t 10/12] tests/i915/gem_create: exercise placements extension Matthew Auld
2021-05-11 16:51   ` [igt-dev] " Matthew Auld
2021-05-11 16:51 ` [Intel-gfx] [PATCH i-g-t 11/12] lib/i915/intel_memory_region: Add new macros and support for igt_collection Matthew Auld
2021-05-11 16:51   ` [igt-dev] " Matthew Auld
2021-05-11 16:51 ` [Intel-gfx] [PATCH i-g-t 12/12] tests/i915/gem_exec_basic/dg1: Iterate over all memory regions Matthew Auld
2021-05-11 16:51   ` [igt-dev] " Matthew Auld
2021-05-11 17:52 ` [igt-dev] ✗ Fi.CI.BAT: failure for DG1/LMEM uAPI basics Patchwork
2021-05-19  8:13 ` [Intel-gfx] [igt-dev] [PATCH i-g-t 00/12] " Matthew Auld
2021-05-19  8:50   ` Petri Latvala
2021-05-19 10:45     ` Matthew Auld
2021-05-19 10:45       ` Matthew Auld
2021-05-19 11:02       ` [Intel-gfx] " Petri Latvala
2021-05-19 11:02         ` Petri Latvala
2021-05-19 11:36         ` [Intel-gfx] " Matthew Auld
2021-05-19 11:36           ` Matthew Auld
2021-05-19 12:07           ` [Intel-gfx] " Petri Latvala
2021-05-19 12:07             ` Petri Latvala

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210511165117.428062-9-matthew.auld@intel.com \
    --to=matthew.auld@intel.com \
    --cc=andrzej.turko@linux.intel.com \
    --cc=dominik.grzegorzek@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=thomas.hellstrom@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is 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.