提交 c7a71fc8 编写于 作者: J Jason Ekstrand 提交者: Daniel Vetter

drm/i915: Drop getparam support for I915_CONTEXT_PARAM_ENGINES

This has never been used by any userspace except IGT and provides no
real functionality beyond parroting back parameters userspace passed in
as part of context creation or via setparam.  If the context is in
legacy mode (where you use I915_EXEC_RENDER and friends), it returns
success with zero data so it's not useful for discovering what engines
are in the context.  It's also not a replacement for the recently
removed I915_CONTEXT_CLONE_ENGINES because it doesn't return any of the
balancing or bonding information.
Signed-off-by: NJason Ekstrand <jason@jlekstrand.net>
Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20210708154835.528166-9-jason@jlekstrand.net
上级 00dae4d3
......@@ -1724,78 +1724,6 @@ set_engines(struct i915_gem_context *ctx,
return 0;
}
static int
get_engines(struct i915_gem_context *ctx,
struct drm_i915_gem_context_param *args)
{
struct i915_context_param_engines __user *user;
struct i915_gem_engines *e;
size_t n, count, size;
bool user_engines;
int err = 0;
e = __context_engines_await(ctx, &user_engines);
if (!e)
return -ENOENT;
if (!user_engines) {
i915_sw_fence_complete(&e->fence);
args->size = 0;
return 0;
}
count = e->num_engines;
/* Be paranoid in case we have an impedance mismatch */
if (!check_struct_size(user, engines, count, &size)) {
err = -EINVAL;
goto err_free;
}
if (overflows_type(size, args->size)) {
err = -EINVAL;
goto err_free;
}
if (!args->size) {
args->size = size;
goto err_free;
}
if (args->size < size) {
err = -EINVAL;
goto err_free;
}
user = u64_to_user_ptr(args->value);
if (put_user(0, &user->extensions)) {
err = -EFAULT;
goto err_free;
}
for (n = 0; n < count; n++) {
struct i915_engine_class_instance ci = {
.engine_class = I915_ENGINE_CLASS_INVALID,
.engine_instance = I915_ENGINE_CLASS_INVALID_NONE,
};
if (e->engines[n]) {
ci.engine_class = e->engines[n]->engine->uabi_class;
ci.engine_instance = e->engines[n]->engine->uabi_instance;
}
if (copy_to_user(&user->engines[n], &ci, sizeof(ci))) {
err = -EFAULT;
goto err_free;
}
}
args->size = size;
err_free:
i915_sw_fence_complete(&e->fence);
return err;
}
static int
set_persistence(struct i915_gem_context *ctx,
const struct drm_i915_gem_context_param *args)
......@@ -2126,10 +2054,6 @@ int i915_gem_context_getparam_ioctl(struct drm_device *dev, void *data,
ret = get_ppgtt(file_priv, ctx, args);
break;
case I915_CONTEXT_PARAM_ENGINES:
ret = get_engines(ctx, args);
break;
case I915_CONTEXT_PARAM_PERSISTENCE:
args->size = 0;
args->value = i915_gem_context_is_persistent(ctx);
......@@ -2137,6 +2061,7 @@ int i915_gem_context_getparam_ioctl(struct drm_device *dev, void *data,
case I915_CONTEXT_PARAM_NO_ZEROMAP:
case I915_CONTEXT_PARAM_BAN_PERIOD:
case I915_CONTEXT_PARAM_ENGINES:
case I915_CONTEXT_PARAM_RINGSIZE:
default:
ret = -EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册