summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-03-25 00:50:45 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2016-03-25 18:23:56 +0000
commit98dcf2f0dcf7097a9404c0598ade4fc94cffeaac (patch)
tree698208ad19343d9a7f663914fd9516529a7cc76e
parent4e2a785e2412f148693b993d1a29d62f48da4937 (diff)
igt/gem_concurrent_blit: Relax maxfiles restrictions
Only fail the dmabuf tests if we cannot prep the system to support "unlimited" fd. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--lib/intel_os.c17
-rw-r--r--tests/gem_concurrent_all.c2
2 files changed, 15 insertions, 4 deletions
diff --git a/lib/intel_os.c b/lib/intel_os.c
index 8fcf0d63..812199c1 100644
--- a/lib/intel_os.c
+++ b/lib/intel_os.c
@@ -46,6 +46,7 @@
#elif defined(HAVE_SWAPCTL) /* Solaris */
#include <sys/swap.h>
#endif
+#include <sys/resource.h>
#include "intel_io.h"
#include "drmtest.h"
@@ -192,6 +193,16 @@ static uint64_t vfs_file_max(void)
return max;
}
+static unsigned max_open_files(void)
+{
+ struct rlimit rlim;
+
+ if (getrlimit(RLIMIT_NOFILE, &rlim))
+ rlim.rlim_cur = 64 << 10;
+
+ return rlim.rlim_cur;
+}
+
/**
* intel_require_files:
* @count: number of files that will be created
@@ -200,9 +211,9 @@ static uint64_t vfs_file_max(void)
*/
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());
+ igt_require_f(count < max_open_files(),
+ "Estimated that we need %'llu files, but the process maximum is only %'llu\n",
+ (long long)count, (long long)max_open_files());
}
int __intel_check_memory(uint64_t count, uint64_t size, unsigned mode,
diff --git a/tests/gem_concurrent_all.c b/tests/gem_concurrent_all.c
index 4d8439f0..10e53575 100644
--- a/tests/gem_concurrent_all.c
+++ b/tests/gem_concurrent_all.c
@@ -1743,7 +1743,7 @@ igt_main
all = true;
igt_fixture {
- igt_require(allow_unlimited_files());
+ allow_unlimited_files();
fd = drm_open_driver(DRIVER_INTEL);
intel_detect_and_clear_missed_interrupts(fd);