@@ -882,6 +882,7 @@ struct intel_context {
u64 lrc_desc;
uint32_t *lrc_reg_state;
bool initialised;
+ bool skip_init_context;
} engine[I915_NUM_ENGINES];
struct list_head link;
@@ -2478,6 +2478,13 @@ uint32_t intel_lr_context_size(struct intel_engine_cs *engine)
return ret;
}
+static bool engine_initialised(struct intel_context *ctx,
+ struct intel_engine_cs *engine)
+{
+ return engine->init_context == NULL
+ || ctx->engine[engine->id].skip_init_context;
+}
+
/**
* execlists_context_deferred_alloc() - create the LRC specific bits of a context
* @ctx: LR context to create.
@@ -2527,7 +2534,7 @@ static int execlists_context_deferred_alloc(struct intel_context *ctx,
ctx->engine[engine->id].ringbuf = ringbuf;
ctx->engine[engine->id].state = ctx_obj;
- ctx->engine[engine->id].initialised = engine->init_context == NULL;
+ ctx->engine[engine->id].initialised = engine_initialised(ctx, engine);
return 0;
GVT-g will copy guest context into GVT LRC context before using it, so engine context initialization is not necessary. This patch introduces an option, and caller could configure it to choose if the engine context initialization should be skipped. Signed-off-by: Zhi Wang <zhi.a.wang@intel.com> --- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/intel_lrc.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-)