summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/xe/xe_sriov_pf.h
diff options
context:
space:
mode:
authorMichal Wajdeczko <michal.wajdeczko@intel.com>2024-04-04 17:44:30 +0200
committerMichal Wajdeczko <michal.wajdeczko@intel.com>2024-04-10 11:26:18 +0200
commit146e4384956926d95c7636020adb5c4949c690da (patch)
treeffbdcb160a0a0b6fe89aa228d3a409b406c7ebc7 /drivers/gpu/drm/xe/xe_sriov_pf.h
parentdrm/xe: Add max_vfs module parameter (diff)
downloadlinux-146e4384956926d95c7636020adb5c4949c690da.tar.xz
linux-146e4384956926d95c7636020adb5c4949c690da.zip
drm/xe: Add proper detection of the SR-IOV PF mode
SR-IOV PF mode detection is based on PCI capability as reported by the PCI dev_is_pf() function and additionally on 'max_vfs' module parameter which could be also used to disable PF capability even if SR-IOV PF capability is reported by the hardware. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240404154431.583-3-michal.wajdeczko@intel.com
Diffstat (limited to 'drivers/gpu/drm/xe/xe_sriov_pf.h')
-rw-r--r--drivers/gpu/drm/xe/xe_sriov_pf.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/gpu/drm/xe/xe_sriov_pf.h b/drivers/gpu/drm/xe/xe_sriov_pf.h
new file mode 100644
index 000000000000..ebef2e01838a
--- /dev/null
+++ b/drivers/gpu/drm/xe/xe_sriov_pf.h
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2023-2024 Intel Corporation
+ */
+
+#ifndef _XE_SRIOV_PF_H_
+#define _XE_SRIOV_PF_H_
+
+#include <linux/types.h>
+
+struct drm_printer;
+struct xe_device;
+
+#ifdef CONFIG_PCI_IOV
+bool xe_sriov_pf_readiness(struct xe_device *xe);
+void xe_sriov_pf_print_vfs_summary(struct xe_device *xe, struct drm_printer *p);
+#else
+static inline bool xe_sriov_pf_readiness(struct xe_device *xe)
+{
+ return false;
+}
+#endif
+
+#endif