diff options
| author | Chris Wilson <chris@chris-wilson.co.uk> | 2019-03-18 21:23:47 +0000 |
|---|---|---|
| committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-03-19 08:21:13 +0000 |
| commit | 4c5896dc4c671cc46035c40b2d80bf4f4ed1598e (patch) | |
| tree | e4ad6b6fbcaa07ca80c961fcf1e43fae65fcec17 /drivers/gpu/drm/i915/intel_lrc.c | |
| parent | 206c2f812fee530f7eda8ad0e97126aec3cd7c43 (diff) | |
| download | linux-next-4c5896dc4c671cc46035c40b2d80bf4f4ed1598e.tar.gz linux-next-4c5896dc4c671cc46035c40b2d80bf4f4ed1598e.zip | |
drm/i915: Hold a reference to the active HW context
For virtual engines, we need to keep the HW context alive while it
remains in use. For regular HW contexts, they are created and kept alive
until the end of the GEM context. For simplicity, generalise the
requirements and keep an active reference to each HW context.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190318212347.30146-2-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/intel_lrc.c')
| -rw-r--r-- | drivers/gpu/drm/i915/intel_lrc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index c949af7be8bd..51c2ea164b36 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c @@ -1236,8 +1236,10 @@ static void __execlists_context_fini(struct intel_context *ce) i915_gem_object_put(ce->state->obj); } -static void execlists_context_destroy(struct intel_context *ce) +static void execlists_context_destroy(struct kref *kref) { + struct intel_context *ce = container_of(kref, typeof(*ce), ref); + GEM_BUG_ON(intel_context_is_pinned(ce)); if (ce->state) |
