diff options
author | Antonio Argenziano <antonio.argenziano@intel.com> | 2018-02-06 16:27:14 -0800 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2018-02-07 08:26:14 +0000 |
commit | 2baf7ece5b6d2faccedc56527ec91623f41a85e4 (patch) | |
tree | c2362e443cd7b61e51e6b92f939e16a107734be5 /tests/gem_ctx_thrash.c | |
parent | 3fd9b578b3138b04178b4ce8ee4a60e74a16ec91 (diff) |
lib: Move __gem_context_create to common ioctl wrapper library.
This patch adds a context creation ioctl wrapper that returns the error
for the caller to consume. Multiple tests that implemented this already,
have been changed to use the new library function.
v2:
- Add gem_require_contexts() to check for contexts support (Chris)
v3:
- Add gem_has_contexts to check for contexts support and change
gem_require_contexts to skip if contests support is not available.
(Chris)
v4:
- Cosmetic changes and use lib function in gem_ctx_create where
possible. (Michal)
v5:
- Use gem_contexts_require() in tests and fixtures. (Chris)
Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michał Winiarski <michal.winiarski@intel.com>
Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/gem_ctx_thrash.c')
-rw-r--r-- | tests/gem_ctx_thrash.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/gem_ctx_thrash.c b/tests/gem_ctx_thrash.c index c0740b9f..b5d334f4 100644 --- a/tests/gem_ctx_thrash.c +++ b/tests/gem_ctx_thrash.c @@ -124,6 +124,8 @@ static void single(const char *name, bool all_engines) igt_require_gem(fd); igt_require(gem_can_store_dword(fd, 0)); + gem_require_contexts(fd); + gen = intel_gen(intel_get_drm_devid(fd)); num_engines = 0; @@ -371,6 +373,10 @@ static void threads(void) struct thread data; data.fd = drm_open_driver_render(DRIVER_INTEL); + igt_require_gem(data.fd); + + gem_require_contexts(data.fd); + data.num_ctx = get_num_contexts(data.fd, false); data.all_ctx = malloc(data.num_ctx * sizeof(uint32_t)); igt_assert(data.all_ctx); |