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

Commit 70ffe995 authored by Chris Wilson's avatar Chris Wilson
Browse files

drm/i915: Mark the shadow gvt context as closed



As the shadow gvt is not user accessible and does not have an associated
vm, we can mark it as closed during its construction. This saves leaking
the internal knowledge of i915_gem_context into gvt/.

Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161218153724.8439-5-chris@chris-wilson.co.uk
parent 69df05e1
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -547,18 +547,10 @@ int intel_gvt_init_workload_scheduler(struct intel_gvt *gvt)

void intel_vgpu_clean_gvt_context(struct intel_vgpu *vgpu)
{
	struct drm_i915_private *dev_priv = vgpu->gvt->dev_priv;

	atomic_notifier_chain_unregister(&vgpu->shadow_ctx->status_notifier,
			&vgpu->shadow_ctx_notifier_block);

	mutex_lock(&dev_priv->drm.struct_mutex);

	/* a little hacky to mark as ctx closed */
	vgpu->shadow_ctx->closed = true;
	i915_gem_context_put(vgpu->shadow_ctx);

	mutex_unlock(&dev_priv->drm.struct_mutex);
	i915_gem_context_put_unlocked(vgpu->shadow_ctx);
}

int intel_vgpu_init_gvt_context(struct intel_vgpu *vgpu)
+1 −0
Original line number Diff line number Diff line
@@ -409,6 +409,7 @@ i915_gem_context_create_gvt(struct drm_device *dev)
	if (IS_ERR(ctx))
		goto out;

	ctx->closed = true; /* not user accessible */
	ctx->execlists_force_single_submission = true;
	ctx->ring_size = 512 * PAGE_SIZE; /* Max ring buffer size */
out: