Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 321fe304 authored by Tvrtko Ursulin's avatar Tvrtko Ursulin
Browse files

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: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Nick Hoath <nicholas.hoath@intel.com>
parent e5292823
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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);
	}
}