[igt-dev] [PATCH i-g-t] tests/i915/gem_ctx_switch: Update with engine discovery

Chris Wilson chris at chris-wilson.co.uk
Tue Jul 2 10:43:25 UTC 2019


Quoting Tvrtko Ursulin (2019-06-27 11:20:19)
> +bool gem_context_has_engine_map(int fd, uint32_t ctx)
> +{
> +       struct drm_i915_gem_context_param param = {
> +               .param = I915_CONTEXT_PARAM_ENGINES,
> +               .ctx_id = ctx
> +       };
> +       int ret;
> +
> +       ret = __gem_context_get_param(fd, &param);
> +       igt_assert_eq(ret, 0);

ret is -EINVAL if the parameter doesn't exist on older kernels, where
naturally we have no engine map!

bool result;

result = false;
if (__gem_context_get_param(fd, &param) == 0)
	result = param.size;

return result;

?
-Chris


More information about the igt-dev mailing list