Commit abd68d9e authored by John Harrison's avatar John Harrison Committed by Daniel Vetter

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

Updated do_switch() to take a request pointer instead of a ring/context pair.

v2: Removed some overzealous req-> dereferencing.

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 ba01cc93
...@@ -614,9 +614,10 @@ needs_pd_load_post(struct intel_engine_cs *ring, struct intel_context *to, ...@@ -614,9 +614,10 @@ needs_pd_load_post(struct intel_engine_cs *ring, struct intel_context *to,
return false; return false;
} }
static int do_switch(struct intel_engine_cs *ring, static int do_switch(struct drm_i915_gem_request *req)
struct intel_context *to)
{ {
struct intel_context *to = req->ctx;
struct intel_engine_cs *ring = req->ring;
struct drm_i915_private *dev_priv = ring->dev->dev_private; struct drm_i915_private *dev_priv = ring->dev->dev_private;
struct intel_context *from = ring->last_context; struct intel_context *from = ring->last_context;
u32 hw_flags = 0; u32 hw_flags = 0;
...@@ -804,7 +805,7 @@ int i915_switch_context(struct drm_i915_gem_request *req) ...@@ -804,7 +805,7 @@ int i915_switch_context(struct drm_i915_gem_request *req)
return 0; return 0;
} }
return do_switch(req->ring, req->ctx); return do_switch(req);
} }
static bool contexts_enabled(struct drm_device *dev) static bool contexts_enabled(struct drm_device *dev)
......
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