Lines Matching +full:re +full:- +full:enabled
1 // SPDX-License-Identifier: MIT
3 * Copyright © 2016-2019 Intel Corporation
28 struct drm_i915_private *i915 = uc_to_gt(uc)->i915; in uc_expand_default_options()
30 if (i915->params.enable_guc != -1) in uc_expand_default_options()
33 /* Don't enable GuC/HuC on pre-Gen12 */ in uc_expand_default_options()
35 i915->params.enable_guc = 0; in uc_expand_default_options()
41 i915->params.enable_guc = 0; in uc_expand_default_options()
47 i915->params.enable_guc = ENABLE_GUC_LOAD_HUC; in uc_expand_default_options()
52 i915->params.enable_guc = ENABLE_GUC_LOAD_HUC | ENABLE_GUC_SUBMISSION; in uc_expand_default_options()
63 ret = i915_inject_probe_error(gt->i915, -ENXIO); in __intel_uc_reset_hw()
73 guc_status = intel_uncore_read(gt->uncore, GUC_STATUS); in __intel_uc_reset_hw()
84 struct drm_i915_private *i915 = gt->i915; in __confirm_options()
87 i915->params.enable_guc, in __confirm_options()
93 if (i915->params.enable_guc == 0) { in __confirm_options()
102 gt_info(gt, "Incompatible option enable_guc=%d - %s\n", in __confirm_options()
103 i915->params.enable_guc, "GuC is not supported!"); in __confirm_options()
105 if (i915->params.enable_guc & ENABLE_GUC_SUBMISSION && in __confirm_options()
107 gt_info(gt, "Incompatible option enable_guc=%d - %s\n", in __confirm_options()
108 i915->params.enable_guc, "GuC submission is N/A"); in __confirm_options()
110 if (i915->params.enable_guc & ~ENABLE_GUC_MASK) in __confirm_options()
111 gt_info(gt, "Incompatible option enable_guc=%d - %s\n", in __confirm_options()
112 i915->params.enable_guc, "undocumented flag"); in __confirm_options()
119 intel_guc_init_early(&uc->guc); in intel_uc_init_early()
120 intel_huc_init_early(&uc->huc); in intel_uc_init_early()
121 intel_gsc_uc_init_early(&uc->gsc); in intel_uc_init_early()
126 uc->ops = &uc_ops_on; in intel_uc_init_early()
128 uc->ops = &uc_ops_off; in intel_uc_init_early()
133 intel_guc_init_late(&uc->guc); in intel_uc_init_late()
134 intel_gsc_uc_load_start(&uc->gsc); in intel_uc_init_late()
139 intel_huc_fini_late(&uc->huc); in intel_uc_driver_late_release()
143 * intel_uc_init_mmio - setup uC MMIO access
151 intel_guc_init_send_regs(&uc->guc); in intel_uc_init_mmio()
156 struct intel_guc *guc = &uc->guc; in __uc_capture_load_err_log()
158 if (guc->log.vma && !uc->load_err_log) in __uc_capture_load_err_log()
159 uc->load_err_log = i915_gem_object_get(guc->log.vma->obj); in __uc_capture_load_err_log()
164 struct drm_i915_gem_object *log = fetch_and_zero(&uc->load_err_log); in __uc_free_load_err_log()
185 intel_uncore_write(guc_to_gt(guc)->uncore, SOFT_SCRATCH(15), 0); in guc_clear_mmio_msg()
192 spin_lock_irq(&guc->irq_lock); in guc_get_mmio_msg()
194 val = intel_uncore_read(guc_to_gt(guc)->uncore, SOFT_SCRATCH(15)); in guc_get_mmio_msg()
195 guc->mmio_msg |= val & guc->msg_enabled_mask; in guc_get_mmio_msg()
198 * clear all events, including the ones we're not currently servicing, in guc_get_mmio_msg()
204 spin_unlock_irq(&guc->irq_lock); in guc_get_mmio_msg()
209 /* we need communication to be enabled to reply to GuC */ in guc_handle_mmio_msg()
210 GEM_BUG_ON(!intel_guc_ct_enabled(&guc->ct)); in guc_handle_mmio_msg()
212 spin_lock_irq(&guc->irq_lock); in guc_handle_mmio_msg()
213 if (guc->mmio_msg) { in guc_handle_mmio_msg()
214 intel_guc_to_host_process_recv_msg(guc, &guc->mmio_msg, 1); in guc_handle_mmio_msg()
215 guc->mmio_msg = 0; in guc_handle_mmio_msg()
217 spin_unlock_irq(&guc->irq_lock); in guc_handle_mmio_msg()
223 struct drm_i915_private *i915 = gt->i915; in guc_enable_communication()
226 GEM_BUG_ON(intel_guc_ct_enabled(&guc->ct)); in guc_enable_communication()
228 ret = i915_inject_probe_error(i915, -ENXIO); in guc_enable_communication()
232 ret = intel_guc_ct_enable(&guc->ct); in guc_enable_communication()
242 /* check for CT messages received before we enabled interrupts */ in guc_enable_communication()
243 spin_lock_irq(gt->irq_lock); in guc_enable_communication()
244 intel_guc_ct_event_handler(&guc->ct); in guc_enable_communication()
245 spin_unlock_irq(gt->irq_lock); in guc_enable_communication()
247 guc_dbg(guc, "communication enabled\n"); in guc_enable_communication()
263 intel_guc_ct_disable(&guc->ct); in guc_disable_communication()
283 err = intel_uc_fw_fetch(&uc->guc.fw); in __uc_fetch_firmwares()
288 intel_uc_fw_change_status(&uc->huc.fw, in __uc_fetch_firmwares()
294 intel_uc_fw_change_status(&uc->gsc.fw, in __uc_fetch_firmwares()
302 intel_uc_fw_fetch(&uc->huc.fw); in __uc_fetch_firmwares()
305 intel_uc_fw_fetch(&uc->gsc.fw); in __uc_fetch_firmwares()
310 intel_uc_fw_cleanup_fetch(&uc->gsc.fw); in __uc_cleanup_firmwares()
311 intel_uc_fw_cleanup_fetch(&uc->huc.fw); in __uc_cleanup_firmwares()
312 intel_uc_fw_cleanup_fetch(&uc->guc.fw); in __uc_cleanup_firmwares()
317 struct intel_guc *guc = &uc->guc; in __uc_init()
318 struct intel_huc *huc = &uc->huc; in __uc_init()
326 if (i915_inject_probe_failure(uc_to_gt(uc)->i915)) in __uc_init()
327 return -ENOMEM; in __uc_init()
337 intel_gsc_uc_init(&uc->gsc); in __uc_init()
344 intel_gsc_uc_fini(&uc->gsc); in __uc_fini()
345 intel_huc_fini(&uc->huc); in __uc_fini()
346 intel_guc_fini(&uc->guc); in __uc_fini()
351 struct intel_guc *guc = &uc->guc; in __uc_sanitize()
352 struct intel_huc *huc = &uc->huc; in __uc_sanitize()
366 struct intel_uncore *uncore = gt->uncore; in uc_init_wopcm()
367 u32 base = intel_wopcm_guc_base(>->wopcm); in uc_init_wopcm()
368 u32 size = intel_wopcm_guc_size(>->wopcm); in uc_init_wopcm()
375 return -E2BIG; in uc_init_wopcm()
384 err = i915_inject_probe_error(gt->i915, -ENXIO); in uc_init_wopcm()
419 struct intel_uncore *uncore = gt->uncore; in uc_is_wopcm_locked()
427 if (uc->fw_table_invalid) in __uc_check_hw()
428 return -EIO; in __uc_check_hw()
434 * We can silently continue without GuC only if it was never enabled in __uc_check_hw()
439 return -EIO; in __uc_check_hw()
447 intel_uc_fw_type_repr(fw->type), fw->file_selected.path, in print_fw_ver()
448 fw->file_selected.ver.major, in print_fw_ver()
449 fw->file_selected.ver.minor, in print_fw_ver()
450 fw->file_selected.ver.patch); in print_fw_ver()
456 struct drm_i915_private *i915 = gt->i915; in __uc_init_hw()
457 struct intel_guc *guc = &uc->guc; in __uc_init_hw()
458 struct intel_huc *huc = &uc->huc; in __uc_init_hw()
465 print_fw_ver(gt, &guc->fw); in __uc_init_hw()
468 print_fw_ver(gt, &huc->fw); in __uc_init_hw()
470 if (!intel_uc_fw_is_loadable(&guc->fw)) { in __uc_init_hw()
472 intel_uc_fw_is_overridden(&guc->fw) || in __uc_init_hw()
474 intel_uc_fw_status_to_error(guc->fw.status) : 0; in __uc_init_hw()
492 i915_hwmon_power_max_disable(gt->i915, &pl1en); in __uc_init_hw()
494 intel_rps_raise_unslice(&uc_to_gt(uc)->rps); in __uc_init_hw()
496 while (attempts--) { in __uc_init_hw()
498 * Always reset the GuC just before (re)loading, so in __uc_init_hw()
525 * GSC-loaded HuC is authenticated by the GSC, so we don't need to in __uc_init_hw()
542 ret = intel_guc_slpc_enable(&guc->slpc); in __uc_init_hw()
546 /* Restore GT back to RPn for non-SLPC path */ in __uc_init_hw()
547 intel_rps_lower_unslice(&uc_to_gt(uc)->rps); in __uc_init_hw()
550 i915_hwmon_power_max_restore(gt->i915, pl1en); in __uc_init_hw()
566 intel_rps_lower_unslice(&uc_to_gt(uc)->rps); in __uc_init_hw()
568 i915_hwmon_power_max_restore(gt->i915, pl1en); in __uc_init_hw()
581 return -EIO; in __uc_init_hw()
586 struct intel_guc *guc = &uc->guc; in __uc_fini_hw()
598 * intel_uc_reset_prepare - Prepare for reset
605 struct intel_guc *guc = &uc->guc; in intel_uc_reset_prepare()
607 uc->reset_in_progress = true; in intel_uc_reset_prepare()
626 struct intel_guc *guc = &uc->guc; in intel_uc_reset()
635 struct intel_guc *guc = &uc->guc; in intel_uc_reset_finish()
638 * NB: The wedge code path results in prepare -> prepare -> finish -> finish. in intel_uc_reset_finish()
639 * So this function is sometimes called with the in-progress flag not set. in intel_uc_reset_finish()
641 uc->reset_in_progress = false; in intel_uc_reset_finish()
650 struct intel_guc *guc = &uc->guc; in intel_uc_cancel_requests()
659 struct intel_guc *guc = &uc->guc; in intel_uc_runtime_suspend()
662 guc->interrupts.enabled = false; in intel_uc_runtime_suspend()
671 intel_guc_wait_for_pending_msg(guc, &guc->outstanding_submission_g2h, in intel_uc_runtime_suspend()
673 GEM_WARN_ON(atomic_read(&guc->outstanding_submission_g2h)); in intel_uc_runtime_suspend()
680 struct intel_guc *guc = &uc->guc; in intel_uc_suspend()
685 intel_gsc_uc_flush_work(&uc->gsc); in intel_uc_suspend()
690 guc->interrupts.enabled = false; in intel_uc_suspend()
696 with_intel_runtime_pm(&uc_to_gt(uc)->i915->runtime_pm, wakeref) { in intel_uc_suspend()
705 intel_uc_fw_resume_mapping(&uc->guc.fw); in __uc_resume_mappings()
706 intel_uc_fw_resume_mapping(&uc->huc.fw); in __uc_resume_mappings()
711 struct intel_guc *guc = &uc->guc; in __uc_resume()
719 GEM_BUG_ON(enable_communication == intel_guc_ct_enabled(&guc->ct)); in __uc_resume()
725 * GuC, we need to ensure the ARAT timer interrupt is enabled in __uc_resume()
726 * again. In case of GuC reload, it is enabled during SLPC enable. in __uc_resume()
737 intel_gsc_uc_resume(&uc->gsc); in __uc_resume()
750 * When coming out of S3/S4 we sanitize and re-init the HW, so in intel_uc_resume()
751 * communication is already re-enabled at this point. in intel_uc_resume()
759 * During runtime resume we don't sanitize, so we need to re-init in intel_uc_runtime_resume()
767 .fini = __uc_fini, /* to clean-up the init_early initialization */