Commit 1d719cda authored by John Harrison's avatar John Harrison Committed by Daniel Vetter

drm/i915: Update mi_set_context() to take a request structure

Updated mi_set_context() to take a request structure instead of a ring and
context pair.

For: VIZ-5115
Signed-off-by: default avatarJohn Harrison <John.C.Harrison@Intel.com>
Reviewed-by: default avatarTomas Elf <tomas.elf@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 6909a666
...@@ -478,10 +478,9 @@ i915_gem_context_get(struct drm_i915_file_private *file_priv, u32 id) ...@@ -478,10 +478,9 @@ i915_gem_context_get(struct drm_i915_file_private *file_priv, u32 id)
} }
static inline int static inline int
mi_set_context(struct intel_engine_cs *ring, mi_set_context(struct drm_i915_gem_request *req, u32 hw_flags)
struct intel_context *new_context,
u32 hw_flags)
{ {
struct intel_engine_cs *ring = req->ring;
u32 flags = hw_flags | MI_MM_SPACE_GTT; u32 flags = hw_flags | MI_MM_SPACE_GTT;
const int num_rings = const int num_rings =
/* Use an extended w/a on ivb+ if signalling from other rings */ /* Use an extended w/a on ivb+ if signalling from other rings */
...@@ -533,7 +532,7 @@ mi_set_context(struct intel_engine_cs *ring, ...@@ -533,7 +532,7 @@ mi_set_context(struct intel_engine_cs *ring,
intel_ring_emit(ring, MI_NOOP); intel_ring_emit(ring, MI_NOOP);
intel_ring_emit(ring, MI_SET_CONTEXT); intel_ring_emit(ring, MI_SET_CONTEXT);
intel_ring_emit(ring, i915_gem_obj_ggtt_offset(new_context->legacy_hw_ctx.rcs_state) | intel_ring_emit(ring, i915_gem_obj_ggtt_offset(req->ctx->legacy_hw_ctx.rcs_state) |
flags); flags);
/* /*
* w/a: MI_SET_CONTEXT must always be followed by MI_NOOP * w/a: MI_SET_CONTEXT must always be followed by MI_NOOP
...@@ -695,7 +694,7 @@ static int do_switch(struct drm_i915_gem_request *req) ...@@ -695,7 +694,7 @@ static int do_switch(struct drm_i915_gem_request *req)
WARN_ON(needs_pd_load_pre(ring, to) && WARN_ON(needs_pd_load_pre(ring, to) &&
needs_pd_load_post(ring, to, hw_flags)); needs_pd_load_post(ring, to, hw_flags));
ret = mi_set_context(ring, to, hw_flags); ret = mi_set_context(req, hw_flags);
if (ret) if (ret)
goto unpin_out; goto unpin_out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment