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 <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson
2016-03-19 14:01:38 +00:00
parent c2248efbca
commit e85613b47c
3 changed files with 30 additions and 15 deletions
+1
View File
@@ -97,6 +97,7 @@ uint64_t intel_get_total_swap_mb(void);
int __intel_check_memory(uint64_t count, uint64_t size, unsigned mode,
uint64_t *out_required, uint64_t *out_total);
void intel_require_memory(uint64_t count, uint64_t size, unsigned mode);
void intel_require_files(uint64_t count);
#define CHECK_RAM 0x1
#define CHECK_SWAP 0x2
+13
View File
@@ -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)
{