]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/gvt: use context lrc_reg_state for shadow ppgtt override
authorZhenyu Wang <zhenyuw@linux.intel.com>
Wed, 6 May 2020 09:59:48 +0000 (17:59 +0800)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Fri, 8 May 2020 04:37:14 +0000 (12:37 +0800)
We can replace kmap by using context's lrc_reg_state directly
for shadow ppgtt table override.

Reviewed-by: Yan Zhao <yan.y.zhao@intel.com>
Cc: Yan Zhao <yan.y.zhao@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20200506095948.124979-1-zhenyuw@linux.intel.com
drivers/gpu/drm/i915/gvt/scheduler.c

index da6a2a4242836e68da73c891b69b263fd07e8662..54c10dfcd3d2ed7200f71fca7e85b902c026c2b1 100644 (file)
@@ -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);
 }
 
 /*