summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_uc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/xe/xe_uc.c')
-rw-r--r--drivers/gpu/drm/xe/xe_uc.c58
1 files changed, 42 insertions, 16 deletions
diff --git a/drivers/gpu/drm/xe/xe_uc.c b/drivers/gpu/drm/xe/xe_uc.c
index 4feb35c95a1c..0f240534fb72 100644
--- a/drivers/gpu/drm/xe/xe_uc.c
+++ b/drivers/gpu/drm/xe/xe_uc.c
@@ -5,15 +5,17 @@
#include "xe_uc.h"
+#include "xe_assert.h"
#include "xe_device.h"
#include "xe_gsc.h"
#include "xe_gsc_proxy.h"
#include "xe_gt.h"
+#include "xe_gt_printk.h"
+#include "xe_gt_sriov_vf.h"
#include "xe_guc.h"
-#include "xe_guc_db_mgr.h"
#include "xe_guc_pc.h"
-#include "xe_guc_submit.h"
#include "xe_huc.h"
+#include "xe_sriov.h"
#include "xe_uc_fw.h"
#include "xe_wopcm.h"
@@ -51,19 +53,19 @@ int xe_uc_init(struct xe_uc *uc)
goto err;
if (!xe_device_uc_enabled(uc_to_xe(uc)))
- goto err;
+ return 0;
- ret = xe_wopcm_init(&uc->wopcm);
- if (ret)
- goto err;
+ if (IS_SRIOV_VF(uc_to_xe(uc)))
+ return 0;
- ret = xe_guc_submit_init(&uc->guc);
+ ret = xe_wopcm_init(&uc->wopcm);
if (ret)
goto err;
- ret = xe_guc_db_mgr_init(&uc->guc.dbm, ~0);
+ return 0;
err:
+ xe_gt_err(uc_to_gt(uc), "Failed to initialize uC (%pe)\n", ERR_PTR(ret));
return ret;
}
@@ -144,6 +146,31 @@ int xe_uc_init_hwconfig(struct xe_uc *uc)
return 0;
}
+static int vf_uc_init_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)
+ return err;
+
+ uc->guc.submission_state.enabled = true;
+
+ err = xe_gt_record_default_lrcs(uc_to_gt(uc));
+ if (err)
+ return err;
+
+ return 0;
+}
+
/*
* Should be called during driver load, after every GT reset, and after every
* suspend to reload / auth the firmwares.
@@ -156,6 +183,9 @@ int xe_uc_init_hw(struct xe_uc *uc)
if (!xe_device_uc_enabled(uc_to_xe(uc)))
return 0;
+ if (IS_SRIOV_VF(uc_to_xe(uc)))
+ return vf_uc_init_hw(uc);
+
ret = xe_huc_upload(&uc->huc);
if (ret)
return ret;
@@ -215,13 +245,13 @@ void xe_uc_stop_prepare(struct xe_uc *uc)
xe_guc_stop_prepare(&uc->guc);
}
-int xe_uc_stop(struct xe_uc *uc)
+void xe_uc_stop(struct xe_uc *uc)
{
/* GuC submission not enabled, nothing to do */
if (!xe_device_uc_enabled(uc_to_xe(uc)))
- return 0;
+ return;
- return xe_guc_stop(&uc->guc);
+ xe_guc_stop(&uc->guc);
}
int xe_uc_start(struct xe_uc *uc)
@@ -247,17 +277,13 @@ again:
int xe_uc_suspend(struct xe_uc *uc)
{
- int ret;
-
/* GuC submission not enabled, nothing to do */
if (!xe_device_uc_enabled(uc_to_xe(uc)))
return 0;
uc_reset_wait(uc);
- ret = xe_uc_stop(uc);
- if (ret)
- return ret;
+ xe_uc_stop(uc);
return xe_guc_suspend(&uc->guc);
}