summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/drmtest.c9
-rw-r--r--lib/drmtest.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/lib/drmtest.c b/lib/drmtest.c
index 8c696b1c..97a44031 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -588,6 +588,15 @@ void *gem_mmap__cpu(int fd, uint32_t handle, int size, int prot)
return (void *)(uintptr_t)mmap_arg.addr_ptr;
}
+uint64_t gem_available_aperture_size(int fd)
+{
+ struct drm_i915_gem_get_aperture aperture;
+
+ aperture.aper_size = 256*1024*1024;
+ do_ioctl(fd, DRM_IOCTL_I915_GEM_GET_APERTURE, &aperture);
+ return aperture.aper_available_size;
+}
+
uint64_t gem_aperture_size(int fd)
{
struct drm_i915_gem_get_aperture aperture;
diff --git a/lib/drmtest.h b/lib/drmtest.h
index 5e831e5f..20e26205 100644
--- a/lib/drmtest.h
+++ b/lib/drmtest.h
@@ -79,6 +79,7 @@ void *gem_mmap__gtt(int fd, uint32_t handle, int size, int prot);
void *gem_mmap__cpu(int fd, uint32_t handle, int size, int prot);
#define gem_mmap gem_mmap__gtt
+uint64_t gem_available_aperture_size(int fd);
uint64_t gem_aperture_size(int fd);
uint64_t gem_mappable_aperture_size(void);
int gem_madvise(int fd, uint32_t handle, int state);