[PATCH 23/23] signed user engines
Jason Ekstrand
jason at jlekstrand.net
Fri Apr 23 03:38:13 UTC 2021
---
drivers/gpu/drm/i915/gem/i915_gem_context.c | 7 +++++--
drivers/gpu/drm/i915/gem/i915_gem_context_types.h | 4 ++--
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c
index ed59475ea5dba..63e5923165cca 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c
@@ -281,6 +281,9 @@ proto_context_create(struct drm_i915_private *i915, unsigned int flags)
proto_context_set_persistence(i915, pc, true);
pc->sched.priority = I915_PRIORITY_NORMAL;
+ pc->num_user_engines = -1;
+ pc->user_engines = NULL;
+
if (flags & I915_CONTEXT_CREATE_FLAGS_SINGLE_TIMELINE)
pc->single_timeline = true;
@@ -546,7 +549,7 @@ static int set_proto_ctx_engines(struct drm_i915_file_private *fpriv,
if (!args->size) {
kfree(pc->user_engines);
- pc->num_user_engines = 0;
+ pc->num_user_engines = -1;
pc->user_engines = NULL;
return 0;
}
@@ -1267,7 +1270,7 @@ i915_gem_create_context(struct drm_i915_private *i915,
RCU_INIT_POINTER(ctx->vm, i915_vm_open(pc->vm));
mutex_init(&ctx->engines_mutex);
- if (pc->num_user_engines) {
+ if (pc->num_user_engines >= 0) {
i915_gem_context_set_user_engines(ctx);
e = user_engines(ctx, pc->num_user_engines, pc->user_engines);
} else {
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context_types.h b/drivers/gpu/drm/i915/gem/i915_gem_context_types.h
index cf275e7795cb5..4aee3667358f0 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_context_types.h
+++ b/drivers/gpu/drm/i915/gem/i915_gem_context_types.h
@@ -84,8 +84,8 @@ struct i915_gem_proto_context {
/** @sched: See i915_gem_context::sched */
struct i915_sched_attr sched;
- /** @num_user_engines: Number of user-specified engines */
- unsigned num_user_engines;
+ /** @num_user_engines: Number of user-specified engines or -1 */
+ int num_user_engines;
/** @num_user_engines: User-specified engines */
struct i915_gem_proto_engine *user_engines;
--
2.31.1
More information about the Intel-gfx-trybot
mailing list