[Intel-gfx] [RFC PATCH 3/4] drm/i915: pass wa_ctx as argument
Lionel Landwerlin
lionel.g.landwerlin at intel.com
Wed Aug 30 18:20:05 UTC 2017
Rather than accessing it from the engine structure. This will be used
for reprogramming later.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
---
drivers/gpu/drm/i915/intel_lrc.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index 6da2b4f0c5a5..c7e7c355b0a7 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -1125,7 +1125,8 @@ static u32 *gen9_init_perctx_bb(struct intel_engine_cs *engine, u32 *batch)
#define CTX_WA_BB_OBJ_SIZE (PAGE_SIZE)
-static int lrc_setup_wa_ctx(struct intel_engine_cs *engine)
+static int lrc_setup_wa_ctx(struct intel_engine_cs *engine,
+ struct i915_ctx_workarounds *wa_ctx)
{
struct drm_i915_gem_object *obj;
struct i915_vma *vma;
@@ -1145,7 +1146,7 @@ static int lrc_setup_wa_ctx(struct intel_engine_cs *engine)
if (err)
goto err;
- engine->wa_ctx.vma = vma;
+ wa_ctx->vma = vma;
return 0;
err:
@@ -1160,9 +1161,9 @@ static void lrc_destroy_wa_ctx(struct intel_engine_cs *engine)
typedef u32 *(*wa_bb_func_t)(struct intel_engine_cs *engine, u32 *batch);
-static int intel_init_workaround_bb(struct intel_engine_cs *engine)
+static int intel_init_workaround_bb(struct intel_engine_cs *engine,
+ struct i915_ctx_workarounds *wa_ctx)
{
- struct i915_ctx_workarounds *wa_ctx = &engine->wa_ctx;
struct i915_wa_ctx_bb *wa_bb[2] = { &wa_ctx->indirect_ctx,
&wa_ctx->per_ctx };
wa_bb_func_t wa_bb_fn[2];
@@ -1190,7 +1191,7 @@ static int intel_init_workaround_bb(struct intel_engine_cs *engine)
return 0;
}
- ret = lrc_setup_wa_ctx(engine);
+ ret = lrc_setup_wa_ctx(engine, wa_ctx);
if (ret) {
DRM_DEBUG_DRIVER("Failed to setup context WA page: %d\n", ret);
return ret;
@@ -1829,7 +1830,7 @@ int logical_render_ring_init(struct intel_engine_cs *engine)
if (ret)
return ret;
- ret = intel_init_workaround_bb(engine);
+ ret = intel_init_workaround_bb(engine, &engine->wa_ctx);
if (ret) {
/*
* We continue even if we fail to initialize WA batch
--
2.14.1
More information about the Intel-gfx
mailing list