Commit 47e51832 authored by Zhenyu Wang's avatar Zhenyu Wang

drm/i915/gvt: use context lrc_reg_state for shadow ppgtt override

We can replace kmap by using context's lrc_reg_state directly
for shadow ppgtt table override.
Reviewed-by: default avatarYan Zhao <yan.y.zhao@intel.com>
Cc: Yan Zhao <yan.y.zhao@intel.com>
Signed-off-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20200506095948.124979-1-zhenyuw@linux.intel.com
parent bec3df93
...@@ -58,10 +58,8 @@ static void set_context_pdp_root_pointer( ...@@ -58,10 +58,8 @@ static void set_context_pdp_root_pointer(
static void update_shadow_pdps(struct intel_vgpu_workload *workload) static void update_shadow_pdps(struct intel_vgpu_workload *workload)
{ {
struct drm_i915_gem_object *ctx_obj =
workload->req->context->state->obj;
struct execlist_ring_context *shadow_ring_context; struct execlist_ring_context *shadow_ring_context;
struct page *page; struct intel_context *ctx = workload->req->context;
if (WARN_ON(!workload->shadow_mm)) if (WARN_ON(!workload->shadow_mm))
return; return;
...@@ -69,11 +67,9 @@ static void update_shadow_pdps(struct intel_vgpu_workload *workload) ...@@ -69,11 +67,9 @@ static void update_shadow_pdps(struct intel_vgpu_workload *workload)
if (WARN_ON(!atomic_read(&workload->shadow_mm->pincount))) if (WARN_ON(!atomic_read(&workload->shadow_mm->pincount)))
return; return;
page = i915_gem_object_get_page(ctx_obj, LRC_STATE_PN); shadow_ring_context = (struct execlist_ring_context *)ctx->lrc_reg_state;
shadow_ring_context = kmap(page);
set_context_pdp_root_pointer(shadow_ring_context, set_context_pdp_root_pointer(shadow_ring_context,
(void *)workload->shadow_mm->ppgtt_mm.shadow_pdps); (void *)workload->shadow_mm->ppgtt_mm.shadow_pdps);
kunmap(page);
} }
/* /*
......
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