Lines Matching refs:uc

21 static void uc_expand_default_options(struct intel_uc *uc)  in uc_expand_default_options()  argument
23 struct drm_i915_private *i915 = uc_to_gt(uc)->i915; in uc_expand_default_options()
56 static int __intel_uc_reset_hw(struct intel_uc *uc) in __intel_uc_reset_hw() argument
58 struct intel_gt *gt = uc_to_gt(uc); in __intel_uc_reset_hw()
80 static void __confirm_options(struct intel_uc *uc) in __confirm_options() argument
82 struct drm_i915_private *i915 = uc_to_gt(uc)->i915; in __confirm_options()
87 str_yes_no(intel_uc_wants_guc(uc)), in __confirm_options()
88 str_yes_no(intel_uc_wants_guc_submission(uc)), in __confirm_options()
89 str_yes_no(intel_uc_wants_huc(uc)), in __confirm_options()
90 str_yes_no(intel_uc_wants_guc_slpc(uc))); in __confirm_options()
93 GEM_BUG_ON(intel_uc_wants_guc(uc)); in __confirm_options()
94 GEM_BUG_ON(intel_uc_wants_guc_submission(uc)); in __confirm_options()
95 GEM_BUG_ON(intel_uc_wants_huc(uc)); in __confirm_options()
96 GEM_BUG_ON(intel_uc_wants_guc_slpc(uc)); in __confirm_options()
100 if (!intel_uc_supports_guc(uc)) in __confirm_options()
106 !intel_uc_supports_huc(uc)) in __confirm_options()
112 !intel_uc_supports_guc_submission(uc)) in __confirm_options()
123 void intel_uc_init_early(struct intel_uc *uc) in intel_uc_init_early() argument
125 uc_expand_default_options(uc); in intel_uc_init_early()
127 intel_guc_init_early(&uc->guc); in intel_uc_init_early()
128 intel_huc_init_early(&uc->huc); in intel_uc_init_early()
130 __confirm_options(uc); in intel_uc_init_early()
132 if (intel_uc_wants_guc(uc)) in intel_uc_init_early()
133 uc->ops = &uc_ops_on; in intel_uc_init_early()
135 uc->ops = &uc_ops_off; in intel_uc_init_early()
138 void intel_uc_init_late(struct intel_uc *uc) in intel_uc_init_late() argument
140 intel_guc_init_late(&uc->guc); in intel_uc_init_late()
143 void intel_uc_driver_late_release(struct intel_uc *uc) in intel_uc_driver_late_release() argument
154 void intel_uc_init_mmio(struct intel_uc *uc) in intel_uc_init_mmio() argument
156 intel_guc_init_send_regs(&uc->guc); in intel_uc_init_mmio()
159 static void __uc_capture_load_err_log(struct intel_uc *uc) in __uc_capture_load_err_log() argument
161 struct intel_guc *guc = &uc->guc; in __uc_capture_load_err_log()
163 if (guc->log.vma && !uc->load_err_log) in __uc_capture_load_err_log()
164 uc->load_err_log = i915_gem_object_get(guc->log.vma->obj); in __uc_capture_load_err_log()
167 static void __uc_free_load_err_log(struct intel_uc *uc) in __uc_free_load_err_log() argument
169 struct drm_i915_gem_object *log = fetch_and_zero(&uc->load_err_log); in __uc_free_load_err_log()
175 void intel_uc_driver_remove(struct intel_uc *uc) in intel_uc_driver_remove() argument
177 intel_uc_fini_hw(uc); in intel_uc_driver_remove()
178 intel_uc_fini(uc); in intel_uc_driver_remove()
179 __uc_free_load_err_log(uc); in intel_uc_driver_remove()
283 static void __uc_fetch_firmwares(struct intel_uc *uc) in __uc_fetch_firmwares() argument
287 GEM_BUG_ON(!intel_uc_wants_guc(uc)); in __uc_fetch_firmwares()
289 err = intel_uc_fw_fetch(&uc->guc.fw); in __uc_fetch_firmwares()
292 if (intel_uc_wants_huc(uc)) { in __uc_fetch_firmwares()
293 drm_dbg(&uc_to_gt(uc)->i915->drm, in __uc_fetch_firmwares()
295 intel_uc_fw_change_status(&uc->huc.fw, in __uc_fetch_firmwares()
302 if (intel_uc_wants_huc(uc)) in __uc_fetch_firmwares()
303 intel_uc_fw_fetch(&uc->huc.fw); in __uc_fetch_firmwares()
306 static void __uc_cleanup_firmwares(struct intel_uc *uc) in __uc_cleanup_firmwares() argument
308 intel_uc_fw_cleanup_fetch(&uc->huc.fw); in __uc_cleanup_firmwares()
309 intel_uc_fw_cleanup_fetch(&uc->guc.fw); in __uc_cleanup_firmwares()
312 static int __uc_init(struct intel_uc *uc) in __uc_init() argument
314 struct intel_guc *guc = &uc->guc; in __uc_init()
315 struct intel_huc *huc = &uc->huc; in __uc_init()
318 GEM_BUG_ON(!intel_uc_wants_guc(uc)); in __uc_init()
320 if (!intel_uc_uses_guc(uc)) in __uc_init()
323 if (i915_inject_probe_failure(uc_to_gt(uc)->i915)) in __uc_init()
330 if (intel_uc_uses_huc(uc)) in __uc_init()
336 static void __uc_fini(struct intel_uc *uc) in __uc_fini() argument
338 intel_huc_fini(&uc->huc); in __uc_fini()
339 intel_guc_fini(&uc->guc); in __uc_fini()
342 static int __uc_sanitize(struct intel_uc *uc) in __uc_sanitize() argument
344 struct intel_guc *guc = &uc->guc; in __uc_sanitize()
345 struct intel_huc *huc = &uc->huc; in __uc_sanitize()
347 GEM_BUG_ON(!intel_uc_supports_guc(uc)); in __uc_sanitize()
352 return __intel_uc_reset_hw(uc); in __uc_sanitize()
356 static int uc_init_wopcm(struct intel_uc *uc) in uc_init_wopcm() argument
358 struct intel_gt *gt = uc_to_gt(uc); in uc_init_wopcm()
362 u32 huc_agent = intel_uc_uses_huc(uc) ? HUC_LOADING_AGENT_GUC : 0; in uc_init_wopcm()
371 GEM_BUG_ON(!intel_uc_supports_guc(uc)); in uc_init_wopcm()
409 static bool uc_is_wopcm_locked(struct intel_uc *uc) in uc_is_wopcm_locked() argument
411 struct intel_gt *gt = uc_to_gt(uc); in uc_is_wopcm_locked()
418 static int __uc_check_hw(struct intel_uc *uc) in __uc_check_hw() argument
420 if (!intel_uc_supports_guc(uc)) in __uc_check_hw()
428 if (uc_is_wopcm_locked(uc)) in __uc_check_hw()
434 static void print_fw_ver(struct intel_uc *uc, struct intel_uc_fw *fw) in print_fw_ver() argument
436 struct drm_i915_private *i915 = uc_to_gt(uc)->i915; in print_fw_ver()
445 static int __uc_init_hw(struct intel_uc *uc) in __uc_init_hw() argument
447 struct drm_i915_private *i915 = uc_to_gt(uc)->i915; in __uc_init_hw()
448 struct intel_guc *guc = &uc->guc; in __uc_init_hw()
449 struct intel_huc *huc = &uc->huc; in __uc_init_hw()
452 GEM_BUG_ON(!intel_uc_supports_guc(uc)); in __uc_init_hw()
453 GEM_BUG_ON(!intel_uc_wants_guc(uc)); in __uc_init_hw()
455 print_fw_ver(uc, &guc->fw); in __uc_init_hw()
457 if (intel_uc_uses_huc(uc)) in __uc_init_hw()
458 print_fw_ver(uc, &huc->fw); in __uc_init_hw()
461 ret = __uc_check_hw(uc) || in __uc_init_hw()
463 intel_uc_wants_guc_submission(uc) ? in __uc_init_hw()
468 ret = uc_init_wopcm(uc); in __uc_init_hw()
481 intel_rps_raise_unslice(&uc_to_gt(uc)->rps); in __uc_init_hw()
488 ret = __uc_sanitize(uc); in __uc_init_hw()
522 if (intel_uc_uses_guc_submission(uc)) in __uc_init_hw()
525 if (intel_uc_uses_guc_slpc(uc)) { in __uc_init_hw()
531 intel_rps_lower_unslice(&uc_to_gt(uc)->rps); in __uc_init_hw()
535 str_enabled_disabled(intel_uc_uses_guc_submission(uc))); in __uc_init_hw()
537 str_enabled_disabled(intel_uc_uses_guc_slpc(uc))); in __uc_init_hw()
547 __uc_capture_load_err_log(uc); in __uc_init_hw()
550 intel_rps_lower_unslice(&uc_to_gt(uc)->rps); in __uc_init_hw()
552 __uc_sanitize(uc); in __uc_init_hw()
566 static void __uc_fini_hw(struct intel_uc *uc) in __uc_fini_hw() argument
568 struct intel_guc *guc = &uc->guc; in __uc_fini_hw()
573 if (intel_uc_uses_guc_submission(uc)) in __uc_fini_hw()
576 __uc_sanitize(uc); in __uc_fini_hw()
585 void intel_uc_reset_prepare(struct intel_uc *uc) in intel_uc_reset_prepare() argument
587 struct intel_guc *guc = &uc->guc; in intel_uc_reset_prepare()
589 uc->reset_in_progress = true; in intel_uc_reset_prepare()
592 if (!intel_uc_supports_guc(uc)) in intel_uc_reset_prepare()
599 if (intel_uc_uses_guc_submission(uc)) in intel_uc_reset_prepare()
603 __uc_sanitize(uc); in intel_uc_reset_prepare()
606 void intel_uc_reset(struct intel_uc *uc, intel_engine_mask_t stalled) in intel_uc_reset() argument
608 struct intel_guc *guc = &uc->guc; in intel_uc_reset()
611 if (intel_uc_uses_guc_submission(uc)) in intel_uc_reset()
615 void intel_uc_reset_finish(struct intel_uc *uc) in intel_uc_reset_finish() argument
617 struct intel_guc *guc = &uc->guc; in intel_uc_reset_finish()
619 uc->reset_in_progress = false; in intel_uc_reset_finish()
622 if (intel_guc_is_fw_running(guc) && intel_uc_uses_guc_submission(uc)) in intel_uc_reset_finish()
626 void intel_uc_cancel_requests(struct intel_uc *uc) in intel_uc_cancel_requests() argument
628 struct intel_guc *guc = &uc->guc; in intel_uc_cancel_requests()
631 if (intel_uc_uses_guc_submission(uc)) in intel_uc_cancel_requests()
635 void intel_uc_runtime_suspend(struct intel_uc *uc) in intel_uc_runtime_suspend() argument
637 struct intel_guc *guc = &uc->guc; in intel_uc_runtime_suspend()
654 void intel_uc_suspend(struct intel_uc *uc) in intel_uc_suspend() argument
656 struct intel_guc *guc = &uc->guc; in intel_uc_suspend()
663 with_intel_runtime_pm(&uc_to_gt(uc)->i915->runtime_pm, wakeref) { in intel_uc_suspend()
670 static int __uc_resume(struct intel_uc *uc, bool enable_communication) in __uc_resume() argument
672 struct intel_guc *guc = &uc->guc; in __uc_resume()
689 if (enable_communication && intel_uc_uses_guc_slpc(uc)) in __uc_resume()
701 int intel_uc_resume(struct intel_uc *uc) in intel_uc_resume() argument
707 return __uc_resume(uc, false); in intel_uc_resume()
710 int intel_uc_runtime_resume(struct intel_uc *uc) in intel_uc_runtime_resume() argument
716 return __uc_resume(uc, true); in intel_uc_runtime_resume()