summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_lrc.c
diff options
context:
space:
mode:
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>2016-01-28 10:29:55 +0000
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>2016-01-28 17:23:15 +0000
commit321fe304f1dd2dca025141b1d3211415af59020f (patch)
treed37ec4409d6948071dc4e4f36092a86d94a3abcf /drivers/gpu/drm/i915/intel_lrc.c
parente5292823c142c9873d7d18cf34e7d97fd8a38f86 (diff)
downloadtalos-op-linux-321fe304f1dd2dca025141b1d3211415af59020f.tar.gz
talos-op-linux-321fe304f1dd2dca025141b1d3211415af59020f.zip
drm/i915: Make LRC pinning own a reference to the context
Will simplify the following fix and sounds logical. v2: Add some whitespace to separate logic better. (Chris Wilson) Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Nick Hoath <nicholas.hoath@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_lrc.c')
-rw-r--r--drivers/gpu/drm/i915/intel_lrc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index 6c95aa19cc90..61e64d78adbd 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -1116,6 +1116,8 @@ static int intel_lr_context_pin(struct intel_context *ctx,
ret = intel_lr_context_do_pin(ctx, engine);
if (ret)
goto reset_pin_count;
+
+ i915_gem_context_reference(ctx);
}
return ret;
@@ -1141,6 +1143,8 @@ void intel_lr_context_unpin(struct intel_context *ctx,
ctx->engine[engine->id].lrc_vma = NULL;
ctx->engine[engine->id].lrc_desc = 0;
ctx->engine[engine->id].lrc_reg_state = NULL;
+
+ i915_gem_context_unreference(ctx);
}
}
OpenPOWER on IntegriCloud