[igt-dev] [PATCH i-g-t 65/79] lib/i915/gem_context: Delete all the context clone/copy stuff

Dixit, Ashutosh ashutosh.dixit at intel.com
Mon Jun 28 20:16:19 UTC 2021


On Thu, 17 Jun 2021 12:15:02 -0700, Jason Ekstrand wrote:
>
>  lib/i915/gem_context: Delete all the context clone/copy stuff

A couple of comments below but otherwise this is:

Reviewed-by: Ashutosh Dixit <ashutosh.dixit at intel.com>

> -bool gem_has_queues(int i915)
> -{
> -	return __gem_context_has(i915,
> -				 I915_CONTEXT_CLONE_VM,
> -				 I915_CONTEXT_CREATE_FLAGS_SINGLE_TIMELINE);
> -}
> -
> -uint32_t gem_queue_create(int i915)
> -{
> -	return gem_context_clone(i915, 0,
> -				 I915_CONTEXT_CLONE_VM |
> -				 I915_CONTEXT_CLONE_ENGINES,
> -				 I915_CONTEXT_CREATE_FLAGS_SINGLE_TIMELINE);
> -}

We are discussing if we can have alternative queue functions so let's see
if that happens, now or later.

> -uint32_t gem_context_create_for_engine(int i915, unsigned int class, unsigned int inst)
> -{
> -	I915_DEFINE_CONTEXT_PARAM_ENGINES(engines, 1) = {
> -		.engines = { { .engine_class = class, .engine_instance = inst } }
> -	};
> -	struct drm_i915_gem_context_create_ext_setparam p_engines = {
> -		.base = {
> -			.name = I915_CONTEXT_CREATE_EXT_SETPARAM,
> -			.next_extension = 0, /* end of chain */
> -		},
> -		.param = {
> -			.param = I915_CONTEXT_PARAM_ENGINES,
> -			.value = to_user_pointer(&engines),
> -			.size = sizeof(engines),
> -		},
> -	};
> -	struct drm_i915_gem_context_create_ext create = {
> -		.flags = I915_CONTEXT_CREATE_FLAGS_USE_EXTENSIONS,
> -		.extensions = to_user_pointer(&p_engines),
> -	};
> -
> -	igt_assert_eq(create_ext_ioctl(i915, &create), 0);
> -	igt_assert_neq(create.ctx_id, 0);
> -	return create.ctx_id;
> -}

gem_context_create_for_engine could probably stay if it doesn't cause link
warnings?


More information about the igt-dev mailing list