Commit bcce7d90 authored by Chris Wilson's avatar Chris Wilson

drm/i915/selftests: Add the mock engine to the gt->engine[]

Remember to include the newly created mock engine in the list of
available engines inside the gt.

Fixes: a50134b1 ("drm/i915: Make for_each_engine_masked work on intel_gt")
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191018130703.31125-1-chris@chris-wilson.co.uk
parent 72405c3d
...@@ -253,6 +253,7 @@ struct intel_engine_cs *mock_engine(struct drm_i915_private *i915, ...@@ -253,6 +253,7 @@ struct intel_engine_cs *mock_engine(struct drm_i915_private *i915,
snprintf(engine->base.name, sizeof(engine->base.name), "%s", name); snprintf(engine->base.name, sizeof(engine->base.name), "%s", name);
engine->base.id = id; engine->base.id = id;
engine->base.mask = BIT(id); engine->base.mask = BIT(id);
engine->base.legacy_idx = INVALID_ENGINE;
engine->base.instance = id; engine->base.instance = id;
engine->base.status_page.addr = (void *)(engine + 1); engine->base.status_page.addr = (void *)(engine + 1);
...@@ -267,6 +268,9 @@ struct intel_engine_cs *mock_engine(struct drm_i915_private *i915, ...@@ -267,6 +268,9 @@ struct intel_engine_cs *mock_engine(struct drm_i915_private *i915,
engine->base.reset.finish = mock_reset_finish; engine->base.reset.finish = mock_reset_finish;
engine->base.cancel_requests = mock_cancel_requests; engine->base.cancel_requests = mock_cancel_requests;
i915->gt.engine[id] = &engine->base;
i915->gt.engine_class[0][id] = &engine->base;
/* fake hw queue */ /* fake hw queue */
spin_lock_init(&engine->hw_lock); spin_lock_init(&engine->hw_lock);
timer_setup(&engine->hw_delay, hw_delay_complete, 0); timer_setup(&engine->hw_delay, hw_delay_complete, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment