summaryrefslogtreecommitdiff
path: root/lib/ioctl_wrappers.h
diff options
context:
space:
mode:
authorAnkitprasad Sharma <ankitprasad.r.sharma@intel.com>2016-06-06 14:52:42 +0530
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>2016-06-07 15:03:37 +0100
commitbeef31a02679a914e2c101e60308511d396201fc (patch)
tree53ea7a853465404bf92545a349027f938d72797a /lib/ioctl_wrappers.h
parent293aa16a12f9e553c0dd767addd27d34c4739b39 (diff)
igt/gem_stolen: Check for available stolen memory size
Check for available stolen memory size before attempting to run the stolen memory tests. This way we make sure that we do not create objects from stolen memory without knowing the available size. This checks if the kernel supports creation of stolen backed objects before doing any operation on stolen backed objects. Also correcting the CREATE_VERSION ioctl number in getparam ioctl, due to kernel changes added in between. v2: Removed size argument for checking stolen memory availability (Tvrtko) Signed-off-by: Ankitprasad Sharma <ankitprasad.r.sharma@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Diffstat (limited to 'lib/ioctl_wrappers.h')
-rw-r--r--lib/ioctl_wrappers.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/ioctl_wrappers.h b/lib/ioctl_wrappers.h
index f3bd23f5..0d42ba95 100644
--- a/lib/ioctl_wrappers.h
+++ b/lib/ioctl_wrappers.h
@@ -94,7 +94,8 @@ void *__gem_mmap__wc(int fd, uint32_t handle, uint64_t offset, uint64_t size, un
* memory is available. Automatically skips through igt_require() if not.
*/
#define gem_require_stolen_support(fd) \
- igt_require(gem_create__has_stolen_support(fd))
+ igt_require(gem_create__has_stolen_support(fd) && \
+ (gem_total_stolen_size(fd) > 0))
/**
* gem_require_mmap_wc:
@@ -153,6 +154,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_total_mappable_size(int fd);
+uint64_t gem_total_stolen_size(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);