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>
This commit is contained in:
Chris Wilson
2016-02-05 18:35:21 +00:00
parent e85c530eab
commit 391b32c382
9 changed files with 39 additions and 50 deletions
+19 -19
View File
@@ -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:
+1 -1
View File
@@ -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);