/* Should be called once at driver load only */ int xe_uc_init_noalloc(struct xe_uc *uc)
{ int ret;
ret = xe_guc_init_noalloc(&uc->guc); if (ret) goto err;
/* HuC and GSC have no early dependencies and will be initialized during xe_uc_init(). */ return 0;
err:
xe_gt_err(uc_to_gt(uc), "Failed to early initialize uC (%pe)\n", ERR_PTR(ret)); return ret;
}
int xe_uc_init(struct xe_uc *uc)
{ int ret;
/* * We call the GuC/HuC/GSC init functions even if GuC submission is off * to correctly move our tracking of the FW state to "disabled".
*/
ret = xe_guc_init(&uc->guc); if (ret) goto err;
ret = xe_huc_init(&uc->huc); if (ret) goto err;
ret = xe_gsc_init(&uc->gsc); if (ret) goto err;
if (!xe_device_uc_enabled(uc_to_xe(uc))) return 0;
if (!IS_SRIOV_VF(uc_to_xe(uc))) {
ret = xe_wopcm_init(&uc->wopcm); if (ret) goto err;
}
ret = xe_guc_min_load_for_hwconfig(&uc->guc); if (ret) goto err;
int xe_uc_sanitize_reset(struct xe_uc *uc)
{
xe_uc_sanitize(uc);
return uc_reset(uc);
}
staticint vf_uc_load_hw(struct xe_uc *uc)
{ int err;
err = xe_uc_sanitize_reset(uc); if (err) return err;
err = xe_guc_enable_communication(&uc->guc); if (err) return err;
err = xe_gt_sriov_vf_connect(uc_to_gt(uc)); if (err) goto err_out;
uc->guc.submission_state.enabled = true;
err = xe_guc_opt_in_features_enable(&uc->guc); if (err) goto err_out;
err = xe_gt_record_default_lrcs(uc_to_gt(uc)); if (err) goto err_out;
return 0;
err_out:
xe_guc_sanitize(&uc->guc); return err;
}
/* * Should be called during driver load, after every GT reset, and after every * suspend to reload / auth the firmwares.
*/ int xe_uc_load_hw(struct xe_uc *uc)
{ int ret;
/* GuC submission not enabled, nothing to do */ if (!xe_device_uc_enabled(uc_to_xe(uc))) return 0;
if (IS_SRIOV_VF(uc_to_xe(uc))) return vf_uc_load_hw(uc);
ret = xe_huc_upload(&uc->huc); if (ret) return ret;
ret = xe_guc_upload(&uc->guc); if (ret) return ret;
ret = xe_guc_enable_communication(&uc->guc); if (ret) return ret;
ret = xe_gt_record_default_lrcs(uc_to_gt(uc)); if (ret) goto err_out;
ret = xe_guc_post_load_init(&uc->guc); if (ret) goto err_out;
ret = xe_guc_pc_start(&uc->guc.pc); if (ret) goto err_out;
xe_guc_engine_activity_enable_stats(&uc->guc);
/* We don't fail the driver load if HuC fails to auth, but let's warn */
ret = xe_huc_auth(&uc->huc, XE_HUC_AUTH_VIA_GUC);
xe_gt_assert(uc_to_gt(uc), !ret);
/* GSC load is async */
xe_gsc_load_start(&uc->gsc);
return 0;
err_out:
xe_guc_sanitize(&uc->guc); return ret;
}
int xe_uc_reset_prepare(struct xe_uc *uc)
{ /* GuC submission not enabled, nothing to do */ if (!xe_device_uc_enabled(uc_to_xe(uc))) return 0;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.