Lines Matching refs:to
578 struct intel_context *to) in should_skip_switch() argument
582 if (to->remap_slice) in should_skip_switch()
585 if (to->ppgtt) { in should_skip_switch()
586 if (from == to && !test_bit(ring->id, in should_skip_switch()
587 &to->ppgtt->pd_dirty_rings)) in should_skip_switch()
590 if (from == to && !test_bit(ring->id, in should_skip_switch()
599 needs_pd_load_pre(struct intel_engine_cs *ring, struct intel_context *to) in needs_pd_load_pre() argument
603 if (!to->ppgtt) in needs_pd_load_pre()
616 needs_pd_load_post(struct intel_engine_cs *ring, struct intel_context *to, in needs_pd_load_post() argument
621 if (!to->ppgtt) in needs_pd_load_post()
637 struct intel_context *to) in do_switch() argument
651 if (should_skip_switch(ring, from, to)) in do_switch()
656 ret = i915_gem_obj_ggtt_pin(to->legacy_hw_ctx.rcs_state, in do_switch()
669 if (needs_pd_load_pre(ring, to)) { in do_switch()
674 trace_switch_mm(ring, to); in do_switch()
675 ret = to->ppgtt->switch_mm(to->ppgtt, ring); in do_switch()
680 clear_bit(ring->id, &to->ppgtt->pd_dirty_rings); in do_switch()
697 ret = i915_gem_object_set_to_gtt_domain(to->legacy_hw_ctx.rcs_state, false); in do_switch()
701 vma = i915_gem_obj_to_ggtt(to->legacy_hw_ctx.rcs_state); in do_switch()
704 to->legacy_hw_ctx.rcs_state->cache_level, in do_switch()
711 if (!to->legacy_hw_ctx.initialized || i915_gem_context_is_default(to)) { in do_switch()
717 } else if (to->ppgtt && in do_switch()
718 test_and_clear_bit(ring->id, &to->ppgtt->pd_dirty_rings)) in do_switch()
722 WARN_ON(needs_pd_load_pre(ring, to) && in do_switch()
723 needs_pd_load_post(ring, to, hw_flags)); in do_switch()
725 ret = mi_set_context(ring, to, hw_flags); in do_switch()
732 if (needs_pd_load_post(ring, to, hw_flags)) { in do_switch()
733 trace_switch_mm(ring, to); in do_switch()
734 ret = to->ppgtt->switch_mm(to->ppgtt, ring); in do_switch()
747 if (!(to->remap_slice & (1<<i))) in do_switch()
755 to->remap_slice &= ~(1<<i); in do_switch()
783 uninitialized = !to->legacy_hw_ctx.initialized; in do_switch()
784 to->legacy_hw_ctx.initialized = true; in do_switch()
787 i915_gem_context_reference(to); in do_switch()
788 ring->last_context = to; in do_switch()
792 ret = ring->init_context(ring, to); in do_switch()
802 i915_gem_object_ggtt_unpin(to->legacy_hw_ctx.rcs_state); in do_switch()
821 struct intel_context *to) in i915_switch_context() argument
828 if (to->legacy_hw_ctx.rcs_state == NULL) { /* We have the fake context */ in i915_switch_context()
829 if (to != ring->last_context) { in i915_switch_context()
830 i915_gem_context_reference(to); in i915_switch_context()
833 ring->last_context = to; in i915_switch_context()
838 return do_switch(ring, to); in i915_switch_context()