]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/gvt: Rename intel_vgpu_{init, clean}_gvt_context()
authorZhi Wang <zhi.a.wang@intel.com>
Sun, 10 Sep 2017 12:08:18 +0000 (20:08 +0800)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Thu, 16 Nov 2017 03:46:08 +0000 (11:46 +0800)
To move workload related functions into scheduler.c, an expected way is
to collect all the init/clean functions related to vGPU workload
submission into fewer functions.

Rename intel_vgpu_{init, clean}_gvt_context() for above usage in future.

Signed-off-by: Zhi Wang <zhi.a.wang@intel.com>
drivers/gpu/drm/i915/gvt/scheduler.c
drivers/gpu/drm/i915/gvt/scheduler.h
drivers/gpu/drm/i915/gvt/vgpu.c

index 42cc61230ca7d35c60580ead7e723fd81228b741..5913bcb7b73e5c2db9c70a7db5690d4cc5593cfc 100644 (file)
@@ -709,12 +709,29 @@ err:
        return ret;
 }
 
-void intel_vgpu_clean_gvt_context(struct intel_vgpu *vgpu)
+/**
+ * intel_vgpu_clean_submission - free submission-related resource for vGPU
+ * @vgpu: a vGPU
+ *
+ * This function is called when a vGPU is being destroyed.
+ *
+ */
+void intel_vgpu_clean_submission(struct intel_vgpu *vgpu)
 {
        i915_gem_context_put(vgpu->shadow_ctx);
 }
 
-int intel_vgpu_init_gvt_context(struct intel_vgpu *vgpu)
+/**
+ * intel_vgpu_setup_submission - setup submission-related resource for vGPU
+ * @vgpu: a vGPU
+ *
+ * This function is called when a vGPU is being created.
+ *
+ * Returns:
+ * Zero on success, negative error code if failed.
+ *
+ */
+int intel_vgpu_setup_submission(struct intel_vgpu *vgpu)
 {
        atomic_set(&vgpu->running_workload_num, 0);
 
index 2d694f6c09076a31efc3165dc074312527450345..c216aefaa73e168a4101c4bc69f7a530c1c487a8 100644 (file)
@@ -137,9 +137,9 @@ void intel_gvt_clean_workload_scheduler(struct intel_gvt *gvt);
 
 void intel_gvt_wait_vgpu_idle(struct intel_vgpu *vgpu);
 
-int intel_vgpu_init_gvt_context(struct intel_vgpu *vgpu);
+int intel_vgpu_setup_submission(struct intel_vgpu *vgpu);
 
-void intel_vgpu_clean_gvt_context(struct intel_vgpu *vgpu);
+void intel_vgpu_clean_submission(struct intel_vgpu *vgpu);
 
 void release_shadow_wa_ctx(struct intel_shadow_wa_ctx *wa_ctx);
 #endif
index 02c61a1ad56a213146f808eb506ac00dccc257d3..3d69871d28e9ef746c536880ca0116a523ff11ee 100644 (file)
@@ -254,7 +254,7 @@ void intel_gvt_destroy_vgpu(struct intel_vgpu *vgpu)
 
        idr_remove(&gvt->vgpu_idr, vgpu->id);
        intel_vgpu_clean_sched_policy(vgpu);
-       intel_vgpu_clean_gvt_context(vgpu);
+       intel_vgpu_clean_submission(vgpu);
        intel_vgpu_clean_execlist(vgpu);
        intel_vgpu_clean_display(vgpu);
        intel_vgpu_clean_opregion(vgpu);
@@ -376,7 +376,7 @@ static struct intel_vgpu *__intel_gvt_create_vgpu(struct intel_gvt *gvt,
        if (ret)
                goto out_clean_display;
 
-       ret = intel_vgpu_init_gvt_context(vgpu);
+       ret = intel_vgpu_setup_submission(vgpu);
        if (ret)
                goto out_clean_execlist;
 
@@ -389,7 +389,7 @@ static struct intel_vgpu *__intel_gvt_create_vgpu(struct intel_gvt *gvt,
        return vgpu;
 
 out_clean_shadow_ctx:
-       intel_vgpu_clean_gvt_context(vgpu);
+       intel_vgpu_clean_submission(vgpu);
 out_clean_execlist:
        intel_vgpu_clean_execlist(vgpu);
 out_clean_display: