Lines Matching refs:guc_state

182 	lockdep_assert_held(&ce->guc_state.lock);  in init_sched_state()
183 ce->guc_state.sched_state &= SCHED_STATE_BLOCKED_MASK; in init_sched_state()
199 return !(ce->guc_state.sched_state & ~SCHED_STATE_VALID_INIT); in sched_state_is_init()
205 return ce->guc_state.sched_state & in context_wait_for_deregister_to_register()
212 lockdep_assert_held(&ce->guc_state.lock); in set_context_wait_for_deregister_to_register()
213 ce->guc_state.sched_state |= in set_context_wait_for_deregister_to_register()
220 lockdep_assert_held(&ce->guc_state.lock); in clr_context_wait_for_deregister_to_register()
221 ce->guc_state.sched_state &= in clr_context_wait_for_deregister_to_register()
228 return ce->guc_state.sched_state & SCHED_STATE_DESTROYED; in context_destroyed()
234 lockdep_assert_held(&ce->guc_state.lock); in set_context_destroyed()
235 ce->guc_state.sched_state |= SCHED_STATE_DESTROYED; in set_context_destroyed()
240 return ce->guc_state.sched_state & SCHED_STATE_PENDING_DISABLE; in context_pending_disable()
245 lockdep_assert_held(&ce->guc_state.lock); in set_context_pending_disable()
246 ce->guc_state.sched_state |= SCHED_STATE_PENDING_DISABLE; in set_context_pending_disable()
251 lockdep_assert_held(&ce->guc_state.lock); in clr_context_pending_disable()
252 ce->guc_state.sched_state &= ~SCHED_STATE_PENDING_DISABLE; in clr_context_pending_disable()
257 return ce->guc_state.sched_state & SCHED_STATE_BANNED; in context_banned()
262 lockdep_assert_held(&ce->guc_state.lock); in set_context_banned()
263 ce->guc_state.sched_state |= SCHED_STATE_BANNED; in set_context_banned()
268 lockdep_assert_held(&ce->guc_state.lock); in clr_context_banned()
269 ce->guc_state.sched_state &= ~SCHED_STATE_BANNED; in clr_context_banned()
274 return ce->guc_state.sched_state & SCHED_STATE_ENABLED; in context_enabled()
279 lockdep_assert_held(&ce->guc_state.lock); in set_context_enabled()
280 ce->guc_state.sched_state |= SCHED_STATE_ENABLED; in set_context_enabled()
285 lockdep_assert_held(&ce->guc_state.lock); in clr_context_enabled()
286 ce->guc_state.sched_state &= ~SCHED_STATE_ENABLED; in clr_context_enabled()
291 return ce->guc_state.sched_state & SCHED_STATE_PENDING_ENABLE; in context_pending_enable()
296 lockdep_assert_held(&ce->guc_state.lock); in set_context_pending_enable()
297 ce->guc_state.sched_state |= SCHED_STATE_PENDING_ENABLE; in set_context_pending_enable()
302 lockdep_assert_held(&ce->guc_state.lock); in clr_context_pending_enable()
303 ce->guc_state.sched_state &= ~SCHED_STATE_PENDING_ENABLE; in clr_context_pending_enable()
308 return ce->guc_state.sched_state & SCHED_STATE_REGISTERED; in context_registered()
313 lockdep_assert_held(&ce->guc_state.lock); in set_context_registered()
314 ce->guc_state.sched_state |= SCHED_STATE_REGISTERED; in set_context_registered()
319 lockdep_assert_held(&ce->guc_state.lock); in clr_context_registered()
320 ce->guc_state.sched_state &= ~SCHED_STATE_REGISTERED; in clr_context_registered()
325 return ce->guc_state.sched_state & SCHED_STATE_POLICY_REQUIRED; in context_policy_required()
330 lockdep_assert_held(&ce->guc_state.lock); in set_context_policy_required()
331 ce->guc_state.sched_state |= SCHED_STATE_POLICY_REQUIRED; in set_context_policy_required()
336 lockdep_assert_held(&ce->guc_state.lock); in clr_context_policy_required()
337 ce->guc_state.sched_state &= ~SCHED_STATE_POLICY_REQUIRED; in clr_context_policy_required()
342 return ce->guc_state.sched_state & SCHED_STATE_CLOSED; in context_close_done()
347 lockdep_assert_held(&ce->guc_state.lock); in set_context_close_done()
348 ce->guc_state.sched_state |= SCHED_STATE_CLOSED; in set_context_close_done()
353 return (ce->guc_state.sched_state & SCHED_STATE_BLOCKED_MASK) >> in context_blocked()
359 lockdep_assert_held(&ce->guc_state.lock); in incr_context_blocked()
361 ce->guc_state.sched_state += SCHED_STATE_BLOCKED; in incr_context_blocked()
368 lockdep_assert_held(&ce->guc_state.lock); in decr_context_blocked()
372 ce->guc_state.sched_state -= SCHED_STATE_BLOCKED; in decr_context_blocked()
712 spin_lock(&ce->guc_state.lock); in __guc_add_request()
761 spin_unlock(&ce->guc_state.lock); in __guc_add_request()
1081 (cancel_delayed_work(&ce->guc_state.sched_disable_delay_work))) { in scrub_guc_desc_for_outstanding_g2h()
1086 spin_lock(&ce->guc_state.lock); in scrub_guc_desc_for_outstanding_g2h()
1102 spin_unlock(&ce->guc_state.lock); in scrub_guc_desc_for_outstanding_g2h()
1127 spin_lock(&ce->guc_state.lock); in scrub_guc_desc_for_outstanding_g2h()
1129 spin_unlock(&ce->guc_state.lock); in scrub_guc_desc_for_outstanding_g2h()
1718 spin_lock(&ce->guc_state.lock); in __unwind_incomplete_requests()
1720 &ce->guc_state.requests, in __unwind_incomplete_requests()
1739 spin_unlock(&ce->guc_state.lock); in __unwind_incomplete_requests()
1761 spin_lock_irqsave(&ce->guc_state.lock, flags); in __guc_reset_context()
1763 spin_unlock_irqrestore(&ce->guc_state.lock, flags); in __guc_reset_context()
1839 spin_lock(&ce->guc_state.lock); in guc_cancel_context_requests()
1840 list_for_each_entry(rq, &ce->guc_state.requests, sched.link) in guc_cancel_context_requests()
1842 spin_unlock(&ce->guc_state.lock); in guc_cancel_context_requests()
2143 spin_lock(&cn->guc_state.lock); in steal_guc_id()
2145 spin_unlock(&cn->guc_state.lock); in steal_guc_id()
2198 might_lock(&ce->guc_state.lock); in pin_guc_id()
2411 spin_lock_irqsave(&ce->guc_state.lock, flags); in register_context()
2413 spin_unlock_irqrestore(&ce->guc_state.lock, flags); in register_context()
2533 __guc_context_policy_add_priority(&policy, ce->guc_state.prio); in guc_context_policy_init_v70()
2542 spin_lock_irqsave(&ce->guc_state.lock, flags); in guc_context_policy_init_v70()
2547 spin_unlock_irqrestore(&ce->guc_state.lock, flags); in guc_context_policy_init_v70()
2611 desc->priority = ce->guc_state.prio; in prepare_context_registration_info_v69()
2648 desc->priority = ce->guc_state.prio; in prepare_context_registration_info_v69()
2684 info->hwlrca_lo |= map_guc_prio_to_lrc_desc_prio(ce->guc_state.prio); in prepare_context_registration_info_v70()
2753 spin_lock_irqsave(&ce->guc_state.lock, flags); in try_context_registration()
2759 spin_unlock_irqrestore(&ce->guc_state.lock, flags); in try_context_registration()
2881 lockdep_assert_held(&ce->guc_state.lock); in guc_blocked_fence_complete()
2883 if (!i915_sw_fence_done(&ce->guc_state.blocked)) in guc_blocked_fence_complete()
2884 i915_sw_fence_complete(&ce->guc_state.blocked); in guc_blocked_fence_complete()
2889 lockdep_assert_held(&ce->guc_state.lock); in guc_blocked_fence_reinit()
2890 GEM_BUG_ON(!i915_sw_fence_done(&ce->guc_state.blocked)); in guc_blocked_fence_reinit()
2897 i915_sw_fence_fini(&ce->guc_state.blocked); in guc_blocked_fence_reinit()
2898 i915_sw_fence_reinit(&ce->guc_state.blocked); in guc_blocked_fence_reinit()
2899 i915_sw_fence_await(&ce->guc_state.blocked); in guc_blocked_fence_reinit()
2900 i915_sw_fence_commit(&ce->guc_state.blocked); in guc_blocked_fence_reinit()
2905 lockdep_assert_held(&ce->guc_state.lock); in prep_context_pending_disable()
2926 spin_lock_irqsave(&ce->guc_state.lock, flags); in guc_context_block()
2934 spin_unlock_irqrestore(&ce->guc_state.lock, flags); in guc_context_block()
2935 return &ce->guc_state.blocked; in guc_context_block()
2946 spin_unlock_irqrestore(&ce->guc_state.lock, flags); in guc_context_block()
2951 return &ce->guc_state.blocked; in guc_context_block()
2963 lockdep_assert_held(&ce->guc_state.lock); in context_cant_unblock()
2965 return (ce->guc_state.sched_state & SCHED_STATE_NO_UNBLOCK) || in context_cant_unblock()
2982 spin_lock_irqsave(&ce->guc_state.lock, flags); in guc_context_unblock()
2996 spin_unlock_irqrestore(&ce->guc_state.lock, flags); in guc_context_unblock()
3062 spin_lock_irqsave(&ce->guc_state.lock, flags); in guc_context_revoke()
3067 spin_unlock_irqrestore(&ce->guc_state.lock, flags); in guc_context_revoke()
3081 spin_unlock_irqrestore(&ce->guc_state.lock, flags); in guc_context_revoke()
3099 spin_unlock_irqrestore(&ce->guc_state.lock, flags); in guc_context_revoke()
3105 __releases(ce->guc_state.lock) in do_sched_disable()
3111 lockdep_assert_held(&ce->guc_state.lock); in do_sched_disable()
3114 spin_unlock_irqrestore(&ce->guc_state.lock, flags); in do_sched_disable()
3123 lockdep_assert_held(&ce->guc_state.lock); in bypass_sched_disable()
3138 container_of(wrk, typeof(*ce), guc_state.sched_disable_delay_work.work); in __delay_sched_disable()
3142 spin_lock_irqsave(&ce->guc_state.lock, flags); in __delay_sched_disable()
3145 spin_unlock_irqrestore(&ce->guc_state.lock, flags); in __delay_sched_disable()
3174 spin_lock_irqsave(&ce->guc_state.lock, flags); in guc_context_sched_disable()
3177 spin_unlock_irqrestore(&ce->guc_state.lock, flags); in guc_context_sched_disable()
3181 spin_unlock_irqrestore(&ce->guc_state.lock, flags); in guc_context_sched_disable()
3183 &ce->guc_state.sched_disable_delay_work, in guc_context_sched_disable()
3195 cancel_delayed_work(&ce->guc_state.sched_disable_delay_work)) in guc_context_close()
3196 __delay_sched_disable(&ce->guc_state.sched_disable_delay_work.work); in guc_context_close()
3198 spin_lock_irqsave(&ce->guc_state.lock, flags); in guc_context_close()
3200 spin_unlock_irqrestore(&ce->guc_state.lock, flags); in guc_context_close()
3216 spin_lock_irqsave(&ce->guc_state.lock, flags); in guc_lrc_desc_unpin()
3223 spin_unlock_irqrestore(&ce->guc_state.lock, flags); in guc_lrc_desc_unpin()
3235 GEM_BUG_ON(ce->guc_state.prio_count[GUC_CLIENT_PRIORITY_KMD_HIGH] || in __guc_context_destroy()
3236 ce->guc_state.prio_count[GUC_CLIENT_PRIORITY_HIGH] || in __guc_context_destroy()
3237 ce->guc_state.prio_count[GUC_CLIENT_PRIORITY_KMD_NORMAL] || in __guc_context_destroy()
3238 ce->guc_state.prio_count[GUC_CLIENT_PRIORITY_NORMAL]); in __guc_context_destroy()
3362 __guc_context_policy_add_priority(&policy, ce->guc_state.prio); in __guc_context_set_prio()
3368 ce->guc_state.prio, in __guc_context_set_prio()
3381 lockdep_assert_held(&ce->guc_state.lock); in guc_context_set_prio()
3383 if (ce->guc_state.prio == prio || submission_disabled(guc) || in guc_context_set_prio()
3385 ce->guc_state.prio = prio; in guc_context_set_prio()
3389 ce->guc_state.prio = prio; in guc_context_set_prio()
3410 lockdep_assert_held(&ce->guc_state.lock); in add_context_inflight_prio()
3411 GEM_BUG_ON(guc_prio >= ARRAY_SIZE(ce->guc_state.prio_count)); in add_context_inflight_prio()
3413 ++ce->guc_state.prio_count[guc_prio]; in add_context_inflight_prio()
3416 GEM_WARN_ON(!ce->guc_state.prio_count[guc_prio]); in add_context_inflight_prio()
3422 lockdep_assert_held(&ce->guc_state.lock); in sub_context_inflight_prio()
3423 GEM_BUG_ON(guc_prio >= ARRAY_SIZE(ce->guc_state.prio_count)); in sub_context_inflight_prio()
3426 GEM_WARN_ON(!ce->guc_state.prio_count[guc_prio]); in sub_context_inflight_prio()
3428 --ce->guc_state.prio_count[guc_prio]; in sub_context_inflight_prio()
3439 lockdep_assert_held(&ce->guc_state.lock); in update_context_prio()
3441 for (i = 0; i < ARRAY_SIZE(ce->guc_state.prio_count); ++i) { in update_context_prio()
3442 if (ce->guc_state.prio_count[i]) { in update_context_prio()
3463 spin_lock(&ce->guc_state.lock); in add_to_context()
3464 list_move_tail(&rq->sched.link, &ce->guc_state.requests); in add_to_context()
3476 spin_unlock(&ce->guc_state.lock); in add_to_context()
3481 lockdep_assert_held(&ce->guc_state.lock); in guc_prio_fini()
3497 spin_lock_irq(&ce->guc_state.lock); in remove_from_context()
3507 spin_unlock_irq(&ce->guc_state.lock); in remove_from_context()
3554 lockdep_assert_held(&ce->guc_state.lock); in __guc_signal_context_fence()
3556 if (!list_empty(&ce->guc_state.fences)) in __guc_signal_context_fence()
3563 list_for_each_entry_safe(rq, rn, &ce->guc_state.fences, in __guc_signal_context_fence()
3569 INIT_LIST_HEAD(&ce->guc_state.fences); in __guc_signal_context_fence()
3578 spin_lock_irqsave(&ce->guc_state.lock, flags); in guc_signal_context_fence()
3581 spin_unlock_irqrestore(&ce->guc_state.lock, flags); in guc_signal_context_fence()
3602 ce->guc_state.prio = map_i915_prio_to_guc_prio(prio); in guc_context_init()
3604 INIT_DELAYED_WORK(&ce->guc_state.sched_disable_delay_work, in guc_context_init()
3658 if (cancel_delayed_work_sync(&ce->guc_state.sched_disable_delay_work)) in guc_request_alloc()
3709 spin_lock_irqsave(&ce->guc_state.lock, flags); in guc_request_alloc()
3715 list_add_tail(&rq->guc_fence_link, &ce->guc_state.fences); in guc_request_alloc()
3717 spin_unlock_irqrestore(&ce->guc_state.lock, flags); in guc_request_alloc()
4079 spin_lock(&ce->guc_state.lock); in guc_bump_inflight_request_prio()
4087 spin_unlock(&ce->guc_state.lock); in guc_bump_inflight_request_prio()
4094 spin_lock(&ce->guc_state.lock); in guc_retire_inflight_request_prio()
4096 spin_unlock(&ce->guc_state.lock); in guc_retire_inflight_request_prio()
4700 ce->guc_state.sched_state, ctx_id); in intel_guc_sched_done_process_msg()
4714 spin_lock_irqsave(&ce->guc_state.lock, flags); in intel_guc_sched_done_process_msg()
4716 spin_unlock_irqrestore(&ce->guc_state.lock, flags); in intel_guc_sched_done_process_msg()
4736 spin_lock_irqsave(&ce->guc_state.lock, flags); in intel_guc_sched_done_process_msg()
4742 spin_unlock_irqrestore(&ce->guc_state.lock, flags); in intel_guc_sched_done_process_msg()
4997 spin_lock(&ce->guc_state.lock); in intel_guc_find_hung_context()
4998 list_for_each_entry(rq, &ce->guc_state.requests, sched.link) { in intel_guc_find_hung_context()
5005 spin_unlock(&ce->guc_state.lock); in intel_guc_find_hung_context()
5055 spin_lock(&ce->guc_state.lock); in intel_guc_dump_active_requests()
5056 intel_engine_dump_active_requests(&ce->guc_state.requests, in intel_guc_dump_active_requests()
5058 spin_unlock(&ce->guc_state.lock); in intel_guc_dump_active_requests()
5105 drm_printf(p, "\t\tPriority: %d\n", ce->guc_state.prio); in guc_log_context_priority()
5110 i, ce->guc_state.prio_count[i]); in guc_log_context_priority()
5131 ce->guc_state.sched_state); in guc_log_context()