From e85613b47c3ca40eeecd436dab3d6c660298d559 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 19 Mar 2016 14:01:38 +0000 Subject: igt/gem_concurrent_blit: dmabuf requires twice the number of files In order to keep the dmabuf mmap around whilst we keep the object alive, we need a file descriptor for each. Check that the VFS supports that many fd. Signed-off-by: Chris Wilson --- lib/intel_os.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/intel_os.c') diff --git a/lib/intel_os.c b/lib/intel_os.c index 90b30210..8fcf0d63 100644 --- a/lib/intel_os.c +++ b/lib/intel_os.c @@ -192,6 +192,19 @@ static uint64_t vfs_file_max(void) return max; } +/** + * intel_require_files: + * @count: number of files that will be created + * + * Does the system support enough file descriptors for the test? + */ +void intel_require_files(uint64_t count) +{ + igt_require_f(count < vfs_file_max(), + "Estimated that we need %'llu files, but the VFS maximum is only %'llu\n", + (long long)count, (long long)vfs_file_max()); +} + int __intel_check_memory(uint64_t count, uint64_t size, unsigned mode, uint64_t *out_required, uint64_t *out_total) { -- cgit v1.2.3