From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: intel-xe@lists.freedesktop.org
Subject: [PATCH 2/4] drm/xe/vf: Custom uC initialization
Date: Tue, 4 Jun 2024 23:22:29 +0200 [thread overview]
Message-ID: <20240604212231.1416-3-michal.wajdeczko@intel.com> (raw)
In-Reply-To: <20240604212231.1416-1-michal.wajdeczko@intel.com>
VF drivers can't modify WOPCM registers nor upload firmwares to
GuC, HuC or GSC. Modify xe_uc initialization functions to skip
those steps if running in the VF mode.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
---
drivers/gpu/drm/xe/xe_uc.c | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_uc.c b/drivers/gpu/drm/xe/xe_uc.c
index 85808706d1c8..0f240534fb72 100644
--- a/drivers/gpu/drm/xe/xe_uc.c
+++ b/drivers/gpu/drm/xe/xe_uc.c
@@ -11,9 +11,11 @@
#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_pc.h"
#include "xe_huc.h"
+#include "xe_sriov.h"
#include "xe_uc_fw.h"
#include "xe_wopcm.h"
@@ -53,6 +55,9 @@ int xe_uc_init(struct xe_uc *uc)
if (!xe_device_uc_enabled(uc_to_xe(uc)))
return 0;
+ if (IS_SRIOV_VF(uc_to_xe(uc)))
+ return 0;
+
ret = xe_wopcm_init(&uc->wopcm);
if (ret)
goto err;
@@ -141,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.
@@ -153,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;
--
2.43.0
next prev parent reply other threads:[~2024-06-04 21:22 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-04 21:22 [PATCH 0/4] VF: Custom init and reset steps Michal Wajdeczko
2024-06-04 21:22 ` [PATCH 1/4] drm/xe/vf: Support only GuC/HuC firmwares Michal Wajdeczko
2024-06-06 11:29 ` Piotr Piórkowski
2024-06-04 21:22 ` Michal Wajdeczko [this message]
2024-06-06 11:37 ` [PATCH 2/4] drm/xe/vf: Custom uC initialization Piotr Piórkowski
2024-06-06 13:34 ` Michal Wajdeczko
2024-06-04 21:22 ` [PATCH 3/4] drm/xe/vf: Custom GuC reset Michal Wajdeczko
2024-06-06 11:38 ` Piotr Piórkowski
2024-06-04 21:22 ` [PATCH 4/4] drm/xe/vf: Custom GT restart Michal Wajdeczko
2024-06-06 11:49 ` Piotr Piórkowski
2024-06-05 5:02 ` ✓ CI.Patch_applied: success for VF: Custom init and reset steps Patchwork
2024-06-05 5:02 ` ✓ CI.checkpatch: " Patchwork
2024-06-05 5:03 ` ✓ CI.KUnit: " Patchwork
2024-06-05 5:15 ` ✓ CI.Build: " Patchwork
2024-06-05 5:15 ` ✗ CI.Hooks: failure " Patchwork
2024-06-05 5:17 ` ✓ CI.checksparse: success " Patchwork
2024-06-05 5:44 ` ✓ CI.BAT: " Patchwork
2024-06-05 15:36 ` ✗ CI.FULL: failure " Patchwork
2024-06-06 13:58 ` Michal Wajdeczko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240604212231.1416-3-michal.wajdeczko@intel.com \
--to=michal.wajdeczko@intel.com \
--cc=intel-xe@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox