[PATCH 1/2] drm/i915/gvt: combine intel_gvt_scan_and_shadow_workload and intel_gvt_scan_and_shadow_wa_ctx
changbin.du at intel.com
changbin.du at intel.com
Thu Feb 9 08:58:02 UTC 2017
From: Changbin Du <changbin.du at intel.com>
Actually we only need one unified interface to scan and shadow workload.
This patch removed the interface intel_gvt_scan_and_shadow_wa_ctx(), only
remain intel_gvt_scan_and_shadow_workload(). The shadow wa_ctx work is
moved to intel_gvt_scan_and_shadow_workload().
Signed-off-by: Changbin Du <changbin.du at intel.com>
---
drivers/gpu/drm/i915/gvt/cmd_parser.c | 44 ++++++++++++++++++++---------------
drivers/gpu/drm/i915/gvt/cmd_parser.h | 2 --
drivers/gpu/drm/i915/gvt/scheduler.c | 4 ----
3 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/drivers/gpu/drm/i915/gvt/cmd_parser.c b/drivers/gpu/drm/i915/gvt/cmd_parser.c
index e456398..369039e 100644
--- a/drivers/gpu/drm/i915/gvt/cmd_parser.c
+++ b/drivers/gpu/drm/i915/gvt/cmd_parser.c
@@ -2641,24 +2641,6 @@ static int shadow_workload_ring_buffer(struct intel_vgpu_workload *workload)
return 0;
}
-int intel_gvt_scan_and_shadow_workload(struct intel_vgpu_workload *workload)
-{
- int ret;
-
- ret = shadow_workload_ring_buffer(workload);
- if (ret) {
- gvt_err("fail to shadow workload ring_buffer\n");
- return ret;
- }
-
- ret = scan_workload(workload);
- if (ret) {
- gvt_err("scan workload error\n");
- return ret;
- }
- return 0;
-}
-
static int shadow_indirect_ctx(struct intel_shadow_wa_ctx *wa_ctx)
{
struct drm_device *dev = &wa_ctx->workload->vgpu->gvt->dev_priv->drm;
@@ -2724,7 +2706,7 @@ static int combine_wa_ctx(struct intel_shadow_wa_ctx *wa_ctx)
return 0;
}
-int intel_gvt_scan_and_shadow_wa_ctx(struct intel_shadow_wa_ctx *wa_ctx)
+static int scan_and_shadow_wa_ctx(struct intel_shadow_wa_ctx *wa_ctx)
{
int ret;
@@ -2748,6 +2730,30 @@ int intel_gvt_scan_and_shadow_wa_ctx(struct intel_shadow_wa_ctx *wa_ctx)
return 0;
}
+int intel_gvt_scan_and_shadow_workload(struct intel_vgpu_workload *workload)
+{
+ int ret;
+
+ ret = shadow_workload_ring_buffer(workload);
+ if (ret) {
+ gvt_err("fail to shadow workload ring_buffer\n");
+ return ret;
+ }
+
+ ret = scan_workload(workload);
+ if (ret) {
+ gvt_err("scan workload error\n");
+ return ret;
+ }
+
+ ret = scan_and_shadow_wa_ctx(&workload->wa_ctx);
+ if (ret) {
+ gvt_err("scan and shadow wa ctx error\n");
+ return ret;
+ }
+ return 0;
+}
+
static struct cmd_info *find_cmd_entry_any_ring(struct intel_gvt *gvt,
unsigned int opcode, int rings)
{
diff --git a/drivers/gpu/drm/i915/gvt/cmd_parser.h b/drivers/gpu/drm/i915/gvt/cmd_parser.h
index bed3351..a9978bc 100644
--- a/drivers/gpu/drm/i915/gvt/cmd_parser.h
+++ b/drivers/gpu/drm/i915/gvt/cmd_parser.h
@@ -44,6 +44,4 @@ int intel_gvt_init_cmd_parser(struct intel_gvt *gvt);
int intel_gvt_scan_and_shadow_workload(struct intel_vgpu_workload *workload);
-int intel_gvt_scan_and_shadow_wa_ctx(struct intel_shadow_wa_ctx *wa_ctx);
-
#endif
diff --git a/drivers/gpu/drm/i915/gvt/scheduler.c b/drivers/gpu/drm/i915/gvt/scheduler.c
index e91885d..5994b03 100644
--- a/drivers/gpu/drm/i915/gvt/scheduler.c
+++ b/drivers/gpu/drm/i915/gvt/scheduler.c
@@ -189,10 +189,6 @@ static int dispatch_workload(struct intel_vgpu_workload *workload)
if (ret)
goto out;
- ret = intel_gvt_scan_and_shadow_wa_ctx(&workload->wa_ctx);
- if (ret)
- goto out;
-
ret = populate_shadow_context(workload);
if (ret)
goto out;
--
2.7.4
More information about the intel-gvt-dev
mailing list