Commit 848862e6 authored by Chris Wilson's avatar Chris Wilson

drm/i915/gt: Free request pool from virtual engines

While extremely unlikely to be populated, we could capture a request on
the virtual engine which we should free along with the virtual engine.

Fixes: 43acd651 ("drm/i915: Keep a per-engine request pool")
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarJanusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200403203303.10903-1-chris@chris-wilson.co.uk
parent 53f5da74
......@@ -199,6 +199,8 @@ void intel_engine_cleanup(struct intel_engine_cs *engine);
int intel_engines_init_mmio(struct intel_gt *gt);
int intel_engines_init(struct intel_gt *gt);
void intel_engine_free_request_pool(struct intel_engine_cs *engine);
void intel_engines_release(struct intel_gt *gt);
void intel_engines_free(struct intel_gt *gt);
......
......@@ -426,6 +426,14 @@ void intel_engines_release(struct intel_gt *gt)
}
}
void intel_engine_free_request_pool(struct intel_engine_cs *engine)
{
if (!engine->request_pool)
return;
kmem_cache_free(i915_request_slab_cache(), engine->request_pool);
}
void intel_engines_free(struct intel_gt *gt)
{
struct intel_engine_cs *engine;
......@@ -435,10 +443,7 @@ void intel_engines_free(struct intel_gt *gt)
rcu_barrier();
for_each_engine(engine, gt, id) {
if (engine->request_pool)
kmem_cache_free(i915_request_slab_cache(),
engine->request_pool);
intel_engine_free_request_pool(engine);
kfree(engine);
gt->engine[id] = NULL;
}
......
......@@ -4931,6 +4931,8 @@ static void virtual_context_destroy(struct kref *kref)
__execlists_context_fini(&ve->context);
intel_context_fini(&ve->context);
intel_engine_free_request_pool(&ve->base);
kfree(ve->bonds);
kfree(ve);
}
......
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