From: Zhenyu Wang Date: Wed, 6 May 2020 09:59:48 +0000 (+0800) Subject: drm/i915/gvt: use context lrc_reg_state for shadow ppgtt override X-Git-Tag: baikal/mips/sdk5.9~13559^2~7^2~8^2 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=fcbe9a6967ff2846cc2b10b68bd25c326aeccf86;p=kernel.git 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: Yan Zhao Cc: Yan Zhao Signed-off-by: Zhenyu Wang Link: http://patchwork.freedesktop.org/patch/msgid/20200506095948.124979-1-zhenyuw@linux.intel.com --- diff --git a/drivers/gpu/drm/i915/gvt/scheduler.c b/drivers/gpu/drm/i915/gvt/scheduler.c index da6a2a4242836..54c10dfcd3d2e 100644 --- a/drivers/gpu/drm/i915/gvt/scheduler.c +++ b/drivers/gpu/drm/i915/gvt/scheduler.c @@ -58,10 +58,8 @@ static void set_context_pdp_root_pointer( 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 page *page; + struct intel_context *ctx = workload->req->context; if (WARN_ON(!workload->shadow_mm)) return; @@ -69,11 +67,9 @@ static void update_shadow_pdps(struct intel_vgpu_workload *workload) if (WARN_ON(!atomic_read(&workload->shadow_mm->pincount))) return; - page = i915_gem_object_get_page(ctx_obj, LRC_STATE_PN); - shadow_ring_context = kmap(page); + shadow_ring_context = (struct execlist_ring_context *)ctx->lrc_reg_state; set_context_pdp_root_pointer(shadow_ring_context, (void *)workload->shadow_mm->ppgtt_mm.shadow_pdps); - kunmap(page); } /*