From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Subject: [PATCH 4/5] drm/xe/pf: Prepare GuC Buffer Cache for PF-only actions
Date: Wed, 9 Oct 2024 19:21:24 +0200 [thread overview]
Message-ID: <20241009172125.1539-5-michal.wajdeczko@intel.com> (raw)
In-Reply-To: <20241009172125.1539-1-michal.wajdeczko@intel.com>
Some of the VF's management actions requires use of GuC indirect
data. Initialize PF-only instance of the GuC Buffer Cache that
could be used for that purposes.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
---
drivers/gpu/drm/xe/xe_gt.c | 6 +++++
drivers/gpu/drm/xe/xe_gt_sriov_pf.c | 32 +++++++++++++++++++++++
drivers/gpu/drm/xe/xe_gt_sriov_pf.h | 6 +++++
drivers/gpu/drm/xe/xe_gt_sriov_pf_types.h | 4 +++
4 files changed, 48 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
index 1c79660fb086..540451c3e972 100644
--- a/drivers/gpu/drm/xe/xe_gt.c
+++ b/drivers/gpu/drm/xe/xe_gt.c
@@ -435,6 +435,12 @@ static int gt_fw_domain_init(struct xe_gt *gt)
if (err)
goto err_force_wake;
+ if (IS_SRIOV_PF(gt_to_xe(gt))) {
+ err = xe_gt_sriov_pf_init(gt);
+ if (err)
+ goto err_force_wake;
+ }
+
/*
* Stash hardware-reported version. Since this register does not exist
* on pre-MTL platforms, reading it there will (correctly) return 0.
diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf.c b/drivers/gpu/drm/xe/xe_gt_sriov_pf.c
index e71fc3d2bda2..d96742e1e886 100644
--- a/drivers/gpu/drm/xe/xe_gt_sriov_pf.c
+++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf.c
@@ -15,6 +15,7 @@
#include "xe_gt_sriov_pf_helpers.h"
#include "xe_gt_sriov_pf_migration.h"
#include "xe_gt_sriov_pf_service.h"
+#include "xe_guc_buf.h"
#include "xe_mmio.h"
/*
@@ -68,6 +69,37 @@ int xe_gt_sriov_pf_init_early(struct xe_gt *gt)
return 0;
}
+static int pf_init_guc_buf_cache(struct xe_gt *gt)
+{
+ struct xe_guc_buf_cache *cache;
+
+ cache = xe_guc_buf_cache_init(>->uc.guc, SZ_8K);
+ if (IS_ERR(cache))
+ return PTR_ERR(cache);
+
+ gt->sriov.pf.buf_cache = cache;
+ return 0;
+}
+
+/**
+ * xe_gt_sriov_pf_init - Prepare SR-IOV PF data structures on PF.
+ * @gt: the &xe_gt to initialize
+ *
+ * Late initialization of the PF data.
+ *
+ * Return: 0 on success or a negative error code on failure.
+ */
+int xe_gt_sriov_pf_init(struct xe_gt *gt)
+{
+ int err;
+
+ err = pf_init_guc_buf_cache(gt);
+ if (err)
+ return err;
+
+ return 0;
+}
+
static bool pf_needs_enable_ggtt_guest_update(struct xe_device *xe)
{
return GRAPHICS_VERx100(xe) == 1200;
diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf.h b/drivers/gpu/drm/xe/xe_gt_sriov_pf.h
index 96fab779a906..f474509411c0 100644
--- a/drivers/gpu/drm/xe/xe_gt_sriov_pf.h
+++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf.h
@@ -10,6 +10,7 @@ struct xe_gt;
#ifdef CONFIG_PCI_IOV
int xe_gt_sriov_pf_init_early(struct xe_gt *gt);
+int xe_gt_sriov_pf_init(struct xe_gt *gt);
void xe_gt_sriov_pf_init_hw(struct xe_gt *gt);
void xe_gt_sriov_pf_sanitize_hw(struct xe_gt *gt, unsigned int vfid);
void xe_gt_sriov_pf_restart(struct xe_gt *gt);
@@ -19,6 +20,11 @@ static inline int xe_gt_sriov_pf_init_early(struct xe_gt *gt)
return 0;
}
+static inline int xe_gt_sriov_pf_init(struct xe_gt *gt)
+{
+ return 0;
+}
+
static inline void xe_gt_sriov_pf_init_hw(struct xe_gt *gt)
{
}
diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf_types.h b/drivers/gpu/drm/xe/xe_gt_sriov_pf_types.h
index 0426b1a77069..d76cfa16c422 100644
--- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_types.h
+++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_types.h
@@ -15,6 +15,8 @@
#include "xe_gt_sriov_pf_policy_types.h"
#include "xe_gt_sriov_pf_service_types.h"
+struct xe_guc_buf_cache;
+
/**
* struct xe_gt_sriov_metadata - GT level per-VF metadata.
*/
@@ -43,6 +45,7 @@ struct xe_gt_sriov_metadata {
* @migration: migration data.
* @spare: PF-only provisioning configuration.
* @vfs: metadata for all VFs.
+ * @buf_cache: PF-only GuC buffer cache for indirect data
*/
struct xe_gt_sriov_pf {
struct xe_gt_sriov_pf_service service;
@@ -51,6 +54,7 @@ struct xe_gt_sriov_pf {
struct xe_gt_sriov_pf_migration migration;
struct xe_gt_sriov_spare_config spare;
struct xe_gt_sriov_metadata *vfs;
+ struct xe_guc_buf_cache *buf_cache;
};
#endif
--
2.43.0
next prev parent reply other threads:[~2024-10-09 17:21 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-09 17:21 [PATCH 0/5] GuC Buffer Cache Michal Wajdeczko
2024-10-09 17:21 ` [PATCH 1/5] drm/xe/guc: Introduce the " Michal Wajdeczko
2024-10-12 1:50 ` Matthew Brost
2024-10-13 11:55 ` Michal Wajdeczko
2024-10-13 17:30 ` Matthew Brost
2024-10-14 17:32 ` Michal Wajdeczko
2024-10-14 19:55 ` Matthew Brost
2024-10-22 21:51 ` Rodrigo Vivi
2024-10-09 17:21 ` [PATCH 2/5] drm/xe/kunit: Allow to replace xe_managed_bo_create_pin_map() Michal Wajdeczko
2024-10-09 17:21 ` [PATCH 3/5] drm/xe/kunit: Add KUnit tests for GuC Buffer Cache Michal Wajdeczko
2024-10-09 17:21 ` Michal Wajdeczko [this message]
2024-10-09 17:21 ` [PATCH 5/5] drm/xe/pf: Use GuC Buffer Cache during VFs provisioning Michal Wajdeczko
2024-10-09 19:11 ` ✓ CI.Patch_applied: success for GuC Buffer Cache Patchwork
2024-10-09 19:12 ` ✗ CI.checkpatch: warning " Patchwork
2024-10-09 19:13 ` ✓ CI.KUnit: success " Patchwork
2024-10-09 19:24 ` ✓ CI.Build: " Patchwork
2024-10-09 19:27 ` ✓ CI.Hooks: " Patchwork
2024-10-09 19:28 ` ✓ CI.checksparse: " Patchwork
2024-10-09 19:56 ` ✓ CI.BAT: " Patchwork
2024-10-10 8:01 ` ✗ CI.FULL: failure " Patchwork
2024-10-10 10:12 ` Michal Wajdeczko
2024-10-12 2:02 ` [PATCH 0/5] " Matthew Brost
2024-10-13 12:41 ` 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=20241009172125.1539-5-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