summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-02-05 18:35:21 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2016-02-18 10:30:56 +0000
commit391b32c3822993a6dd5874d2898b0c16b8eb9d03 (patch)
tree630469f4b2578ef87f085fdab6dc1b75f6b69138 /lib
parente85c530eab9ef20b2708ff36bfc6f6fa3990e1f4 (diff)
igt: Report the global GTT size
For many tests, the relevant aperture is not the ppGTT but the internal global GTT managed by the kernel. Use this limit appropriately. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib')
-rw-r--r--lib/ioctl_wrappers.c38
-rw-r--r--lib/ioctl_wrappers.h2
2 files changed, 20 insertions, 20 deletions
diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
index 8c7e939d..a222e1b0 100644
--- a/lib/ioctl_wrappers.c
+++ b/lib/ioctl_wrappers.c
@@ -1226,25 +1226,6 @@ bool gem_has_bsd2(int fd)
has_bsd2 = gem_has_enable_ring(fd,LOCAL_I915_PARAM_HAS_BSD2);
return has_bsd2;
}
-/**
- * gem_available_aperture_size:
- * @fd: open i915 drm file descriptor
- *
- * Feature test macro to query the kernel for the available gpu aperture size
- * usable in a batchbuffer.
- *
- * Returns: The available gtt address space size.
- */
-uint64_t gem_available_aperture_size(int fd)
-{
- struct drm_i915_gem_get_aperture aperture;
-
- memset(&aperture, 0, sizeof(aperture));
- aperture.aper_size = 256*1024*1024;
- do_ioctl(fd, DRM_IOCTL_I915_GEM_GET_APERTURE, &aperture);
-
- return aperture.aper_available_size;
-}
/**
* gem_aperture_size:
@@ -1300,6 +1281,25 @@ uint64_t gem_mappable_aperture_size(void)
return pci_dev->regions[bar].size;
}
+/**
+ * gem_global_aperture_size:
+ *
+ * Feature test macro to query the kernel for the global gpu aperture size.
+ * This is the area available for the kernel to perform address translations.
+ *
+ * Returns: The mappable gtt address space size.
+ */
+uint64_t gem_global_aperture_size(int fd)
+{
+ struct drm_i915_gem_get_aperture aperture;
+
+ memset(&aperture, 0, sizeof(aperture));
+ aperture.aper_size = 256*1024*1024;
+ do_ioctl(fd, DRM_IOCTL_I915_GEM_GET_APERTURE, &aperture);
+
+ return aperture.aper_size;
+}
+
#define LOCAL_I915_PARAM_HAS_EXEC_SOFTPIN 37
/**
* gem_has_softpin:
diff --git a/lib/ioctl_wrappers.h b/lib/ioctl_wrappers.h
index 200b2dab..691dc013 100644
--- a/lib/ioctl_wrappers.h
+++ b/lib/ioctl_wrappers.h
@@ -143,8 +143,8 @@ int gem_gtt_type(int fd);
bool gem_uses_ppgtt(int fd);
bool gem_uses_full_ppgtt(int fd);
int gem_available_fences(int fd);
-uint64_t gem_available_aperture_size(int fd);
uint64_t gem_aperture_size(int fd);
+uint64_t gem_global_aperture_size(int fd);
uint64_t gem_mappable_aperture_size(void);
bool gem_has_softpin(int fd);