From ffbc59a3ef9b0d4347c43fd03681bbbd9d0e43d8 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 5 Feb 2016 11:16:18 +0000 Subject: [PATCH] lib: Silence a common debug message when creating a context In context tests, we may create thousands of contexts, the noise from each requirement passing drowning out the real information. Let's only do the requirement test (to detect if contexts are meant to be supported or plain broken) only on the error path. Signed-off-by: Chris Wilson --- lib/ioctl_wrappers.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c index 6b9d00ae..f371bf07 100644 --- a/lib/ioctl_wrappers.c +++ b/lib/ioctl_wrappers.c @@ -771,12 +771,14 @@ int gem_madvise(int fd, uint32_t handle, int state) uint32_t gem_context_create(int fd) { struct drm_i915_gem_context_create create; - int ret; memset(&create, 0, sizeof(create)); - ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_CONTEXT_CREATE, &create); - igt_require(ret == 0 || (errno != ENODEV && errno != EINVAL)); - igt_assert(ret == 0); + if (drmIoctl(fd, DRM_IOCTL_I915_GEM_CONTEXT_CREATE, &create)) { + int err = -errno; + igt_skip_on(err == -ENODEV || errno == -EINVAL); + igt_assert_eq(err, 0); + } + igt_assert(create.ctx_id != 0); errno = 0; return create.ctx_id;