[igt-dev] [PATCH i-g-t v2 4/9] lib/ioctl_wrappers: drop gem_require_stolen_support()

Lucas De Marchi lucas.demarchi at intel.com
Sun Jul 11 06:12:06 UTC 2021


There is no such thing in the kernel as ioctl
DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE returning a struct with
stolen_total_size. So gem_total_stolen_size() always returns 0.

Also there are no callers for gem_total_stolen_size(), except for
gem_require_stolen_support() which is unused.

Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
---
 lib/ioctl_wrappers.c | 28 ----------------------------
 lib/ioctl_wrappers.h | 11 -----------
 2 files changed, 39 deletions(-)

diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
index 48526d29..25c5e495 100644
--- a/lib/ioctl_wrappers.c
+++ b/lib/ioctl_wrappers.c
@@ -986,34 +986,6 @@ bool gem_has_bsd2(int fd)
 	return has_param(fd, I915_PARAM_HAS_BSD2);
 }
 
-struct local_i915_gem_get_aperture {
-	__u64 aper_size;
-	__u64 aper_available_size;
-	__u64 version;
-	__u64 map_total_size;
-	__u64 stolen_total_size;
-};
-#define DRM_I915_GEM_GET_APERTURE	0x23
-#define LOCAL_IOCTL_I915_GEM_GET_APERTURE DRM_IOR  (DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE, struct local_i915_gem_get_aperture)
-
-/**
- * gem_total_stolen_size:
- * @fd: open i915 drm file descriptor
- *
- * Feature test macro to query the kernel for the total stolen size.
- *
- * Returns: Total stolen memory.
- */
-uint64_t gem_total_stolen_size(int fd)
-{
-	struct local_i915_gem_get_aperture aperture;
-
-	memset(&aperture, 0, sizeof(aperture));
-	do_ioctl(fd, LOCAL_IOCTL_I915_GEM_GET_APERTURE, &aperture);
-
-	return aperture.stolen_total_size;
-}
-
 /**
  * gem_has_softpin:
  * @fd: open i915 drm file descriptor
diff --git a/lib/ioctl_wrappers.h b/lib/ioctl_wrappers.h
index 689e6d53..0ed67b6e 100644
--- a/lib/ioctl_wrappers.h
+++ b/lib/ioctl_wrappers.h
@@ -89,17 +89,6 @@ int __gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *execbuf);
 #define I915_GEM_DOMAIN_WC 0x80
 #endif
 
-/**
- * gem_require_stolen_support:
- * @fd: open i915 drm file descriptor
- *
- * Test macro to query whether support for allocating objects from stolen
- * memory is available. Automatically skips through igt_require() if not.
- */
-#define gem_require_stolen_support(fd) \
-			igt_require(gem_create__has_stolen_support(fd) && \
-				    (gem_total_stolen_size(fd) > 0))
-
 int gem_madvise(int fd, uint32_t handle, int state);
 
 void gem_userptr(int fd, void *ptr, uint64_t size, int read_only, uint32_t flags, uint32_t *handle);
-- 
2.31.1



More information about the igt-dev mailing list