mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
drm/i915: Only mark the ctx as initialised after a SET_CONTEXT operation
Fallout from commit46470fc932Author: Mika Kuoppala <[email protected]> Date: Wed May 21 19:01:06 2014 +0300 drm/i915: Add null state batch to active list undid the earlier fix of only marking the ctx as initialised after it is saved by the hardware during a SET_CONTEXT operation: commitad1d219974Author: Ben Widawsky <[email protected]> Date: Sat Dec 28 13:31:49 2013 -0800 drm/i915: set ctx->initialized only after RCS Signed-off-by: Chris Wilson <[email protected]> Cc: Ville Syrjälä <[email protected]> Cc: Damien Lespiau <[email protected]> Cc: Mika Kuoppala <[email protected]> Cc: Ben Widawsky <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Reviewed-by: Ben Widawsky <[email protected]> [Jani: add reference to the earlier fix in the commit messsage.] Signed-off-by: Jani Nikula <[email protected]>
This commit is contained in:
parent
56c4b63aaf
commit
967ab6b177
1 changed files with 5 additions and 3 deletions
|
|
@ -598,6 +598,7 @@ static int do_switch(struct intel_engine_cs *ring,
|
|||
struct intel_context *from = ring->last_context;
|
||||
struct i915_hw_ppgtt *ppgtt = ctx_to_ppgtt(to);
|
||||
u32 hw_flags = 0;
|
||||
bool uninitialized = false;
|
||||
int ret, i;
|
||||
|
||||
if (from != NULL && ring == &dev_priv->ring[RCS]) {
|
||||
|
|
@ -696,19 +697,20 @@ static int do_switch(struct intel_engine_cs *ring,
|
|||
i915_gem_context_unreference(from);
|
||||
}
|
||||
|
||||
uninitialized = !to->is_initialized && from == NULL;
|
||||
to->is_initialized = true;
|
||||
|
||||
done:
|
||||
i915_gem_context_reference(to);
|
||||
ring->last_context = to;
|
||||
to->last_ring = ring;
|
||||
|
||||
if (ring->id == RCS && !to->is_initialized && from == NULL) {
|
||||
if (uninitialized) {
|
||||
ret = i915_gem_render_state_init(ring);
|
||||
if (ret)
|
||||
DRM_ERROR("init render state: %d\n", ret);
|
||||
}
|
||||
|
||||
to->is_initialized = true;
|
||||
|
||||
return 0;
|
||||
|
||||
unpin_out:
|
||||
|
|
|
|||
Loading…
Reference in a new issue