return 0;
}
+/**
+ * xe_gt_sriov_vf_guc_ids - VF GuC context IDs configuration.
+ * @gt: the &xe_gt
+ *
+ * This function is for VF use only.
+ *
+ * Return: number of GuC context IDs assigned to VF.
+ */
+u16 xe_gt_sriov_vf_guc_ids(struct xe_gt *gt)
+{
+ xe_gt_assert(gt, IS_SRIOV_VF(gt_to_xe(gt)));
+ xe_gt_assert(gt, gt->sriov.vf.guc_version.major);
+ xe_gt_assert(gt, gt->sriov.vf.self_config.num_ctxs);
+
+ return gt->sriov.vf.self_config.num_ctxs;
+}
+
static int relay_action_handshake(struct xe_gt *gt, u32 *major, u32 *minor)
{
u32 request[VF2PF_HANDSHAKE_REQUEST_MSG_LEN] = {
int xe_gt_sriov_vf_connect(struct xe_gt *gt);
int xe_gt_sriov_vf_query_runtime(struct xe_gt *gt);
+u16 xe_gt_sriov_vf_guc_ids(struct xe_gt *gt);
+
void xe_gt_sriov_vf_print_config(struct xe_gt *gt, struct drm_printer *p);
void xe_gt_sriov_vf_print_runtime(struct xe_gt *gt, struct drm_printer *p);
void xe_gt_sriov_vf_print_version(struct xe_gt *gt, struct drm_printer *p);
return 0;
}
+static int vf_guc_init(struct xe_guc *guc)
+{
+ int err;
+
+ xe_guc_comm_init_early(guc);
+
+ err = xe_guc_ct_init(&guc->ct);
+ if (err)
+ return err;
+
+ err = xe_guc_relay_init(&guc->relay);
+ if (err)
+ return err;
+
+ return 0;
+}
+
int xe_guc_init(struct xe_guc *guc)
{
struct xe_device *xe = guc_to_xe(guc);
if (!xe_uc_fw_is_enabled(&guc->fw))
return 0;
+ if (IS_SRIOV_VF(xe)) {
+ ret = vf_guc_init(guc);
+ if (ret)
+ goto out;
+ return 0;
+ }
+
ret = xe_guc_log_init(&guc->log);
if (ret)
goto out;
return ret;
}
+static int vf_guc_init_post_hwconfig(struct xe_guc *guc)
+{
+ int err;
+
+ err = xe_guc_submit_init(guc, xe_gt_sriov_vf_guc_ids(guc_to_gt(guc)));
+ if (err)
+ return err;
+
+ /* XXX xe_guc_db_mgr_init not needed for now */
+
+ return 0;
+}
+
/**
* xe_guc_init_post_hwconfig - initialize GuC post hwconfig load
* @guc: The GuC object
{
int ret;
+ if (IS_SRIOV_VF(guc_to_xe(guc)))
+ return vf_guc_init_post_hwconfig(guc);
+
ret = xe_guc_realloc_post_hwconfig(guc);
if (ret)
return ret;