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 <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2016-02-05 11:16:18 +00:00
parent e7faf33ec7
commit ffbc59a3ef

View File

@ -771,12 +771,14 @@ int gem_madvise(int fd, uint32_t handle, int state)
uint32_t gem_context_create(int fd) uint32_t gem_context_create(int fd)
{ {
struct drm_i915_gem_context_create create; struct drm_i915_gem_context_create create;
int ret;
memset(&create, 0, sizeof(create)); memset(&create, 0, sizeof(create));
ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_CONTEXT_CREATE, &create); if (drmIoctl(fd, DRM_IOCTL_I915_GEM_CONTEXT_CREATE, &create)) {
igt_require(ret == 0 || (errno != ENODEV && errno != EINVAL)); int err = -errno;
igt_assert(ret == 0); igt_skip_on(err == -ENODEV || errno == -EINVAL);
igt_assert_eq(err, 0);
}
igt_assert(create.ctx_id != 0);
errno = 0; errno = 0;
return create.ctx_id; return create.ctx_id;