summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_sriov_vf.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/xe/xe_sriov_vf.c')
-rw-r--r--drivers/gpu/drm/xe/xe_sriov_vf.c39
1 files changed, 13 insertions, 26 deletions
diff --git a/drivers/gpu/drm/xe/xe_sriov_vf.c b/drivers/gpu/drm/xe/xe_sriov_vf.c
index 911d5720917b..39c829daa97c 100644
--- a/drivers/gpu/drm/xe/xe_sriov_vf.c
+++ b/drivers/gpu/drm/xe/xe_sriov_vf.c
@@ -130,10 +130,15 @@
bool xe_sriov_vf_migration_supported(struct xe_device *xe)
{
xe_assert(xe, IS_SRIOV_VF(xe));
- return xe->sriov.vf.migration.enabled;
+ return !xe->sriov.vf.migration.disabled;
}
-static void vf_disable_migration(struct xe_device *xe, const char *fmt, ...)
+/**
+ * xe_sriov_vf_migration_disable - Turn off VF migration with given log message.
+ * @xe: the &xe_device instance.
+ * @fmt: format string for the log message, to be combined with following VAs.
+ */
+void xe_sriov_vf_migration_disable(struct xe_device *xe, const char *fmt, ...)
{
struct va_format vaf;
va_list va_args;
@@ -146,7 +151,7 @@ static void vf_disable_migration(struct xe_device *xe, const char *fmt, ...)
xe_sriov_notice(xe, "migration disabled: %pV\n", &vaf);
va_end(va_args);
- xe->sriov.vf.migration.enabled = false;
+ xe->sriov.vf.migration.disabled = true;
}
static void vf_migration_init_early(struct xe_device *xe)
@@ -156,25 +161,12 @@ static void vf_migration_init_early(struct xe_device *xe)
* supported at production quality.
*/
if (!IS_ENABLED(CONFIG_DRM_XE_DEBUG))
- return vf_disable_migration(xe,
- "experimental feature not available on production builds");
-
- if (GRAPHICS_VER(xe) < 20)
- return vf_disable_migration(xe, "requires gfx version >= 20, but only %u found",
- GRAPHICS_VER(xe));
+ return xe_sriov_vf_migration_disable(xe,
+ "experimental feature not available on production builds");
- if (!IS_DGFX(xe)) {
- struct xe_uc_fw_version guc_version;
+ if (!xe_device_has_memirq(xe))
+ return xe_sriov_vf_migration_disable(xe, "requires memory-based IRQ support");
- xe_gt_sriov_vf_guc_versions(xe_device_get_gt(xe, 0), NULL, &guc_version);
- if (MAKE_GUC_VER_STRUCT(guc_version) < MAKE_GUC_VER(1, 23, 0))
- return vf_disable_migration(xe,
- "CCS migration requires GuC ABI >= 1.23 but only %u.%u found",
- guc_version.major, guc_version.minor);
- }
-
- xe->sriov.vf.migration.enabled = true;
- xe_sriov_dbg(xe, "migration support enabled\n");
}
/**
@@ -196,12 +188,7 @@ void xe_sriov_vf_init_early(struct xe_device *xe)
*/
int xe_sriov_vf_init_late(struct xe_device *xe)
{
- int err = 0;
-
- if (xe_sriov_vf_migration_supported(xe))
- err = xe_sriov_vf_ccs_init(xe);
-
- return err;
+ return xe_sriov_vf_ccs_init(xe);
}
static int sa_info_vf_ccs(struct seq_file *m, void *data)