diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-01-15 17:14:56 +0100 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-01-15 17:14:56 +0100 |
commit | 7f944349efb98ae2ab777dc745c3d12acd03d82f (patch) | |
tree | faa8ee14be7b5cd5d30fb12cd838b0bfda53344c /lib | |
parent | d749921e48366c3b562fa315e7ed6cf4ce063a1c (diff) |
lib/drmtest: extract gem_aperture_size
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/drmtest.c | 9 | ||||
-rw-r--r-- | lib/drmtest.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/lib/drmtest.c b/lib/drmtest.c index a64aa6aa..6ee602cd 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -265,6 +265,15 @@ void *gem_mmap(int fd, uint32_t handle, int size, int prot) return ptr; } +uint64_t gem_aperture_size(int fd) +{ + struct drm_i915_gem_get_aperture aperture; + + aperture.aper_size = 256*1024*1024; + (void)drmIoctl(fd, DRM_IOCTL_I915_GEM_GET_APERTURE, &aperture); + return aperture.aper_size; +} + static pid_t signal_helper = -1; long long int sig_stat; static void signal_helper_process(pid_t pid) diff --git a/lib/drmtest.h b/lib/drmtest.h index 4af98002..9b0e6483 100644 --- a/lib/drmtest.h +++ b/lib/drmtest.h @@ -47,6 +47,7 @@ void gem_set_domain(int fd, uint32_t handle, void gem_sync(int fd, uint32_t handle); uint32_t gem_create(int fd, int size); void *gem_mmap(int fd, uint32_t handle, int size, int prot); +uint64_t gem_aperture_size(int fd); void drmtest_fork_signal_helper(void); void drmtest_stop_signal_helper(void); |