diff options
| author | Michal Wajdeczko <michal.wajdeczko@intel.com> | 2026-01-28 00:05:01 +0300 |
|---|---|---|
| committer | Michal Wajdeczko <michal.wajdeczko@intel.com> | 2026-02-03 14:02:44 +0300 |
| commit | 10f817c256d7d5fd2680ecdb4ab52c5506fe90b5 (patch) | |
| tree | 890082f8ab1c9b91fc1395b972a37ae30fadbd0b | |
| parent | 0dfc7306b9600127afce5dbcb53389ca72237031 (diff) | |
| download | linux-10f817c256d7d5fd2680ecdb4ab52c5506fe90b5.tar.xz | |
drm/xe/pf: Define admin_only as real flag
Instead of doing guesses each time during the runtime, set flag
admin_only once during PF's initialization.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patch.msgid.link/20260127210501.794-1-michal.wajdeczko@intel.com
| -rw-r--r-- | drivers/gpu/drm/xe/tests/xe_gt_sriov_pf_config_kunit.c | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/xe/xe_sriov_pf.c | 6 | ||||
| -rw-r--r-- | drivers/gpu/drm/xe/xe_sriov_pf_helpers.h | 3 | ||||
| -rw-r--r-- | drivers/gpu/drm/xe/xe_sriov_pf_types.h | 3 |
4 files changed, 12 insertions, 2 deletions
diff --git a/drivers/gpu/drm/xe/tests/xe_gt_sriov_pf_config_kunit.c b/drivers/gpu/drm/xe/tests/xe_gt_sriov_pf_config_kunit.c index 42bfc4bcfbcf..3889dc3e49ca 100644 --- a/drivers/gpu/drm/xe/tests/xe_gt_sriov_pf_config_kunit.c +++ b/drivers/gpu/drm/xe/tests/xe_gt_sriov_pf_config_kunit.c @@ -15,7 +15,7 @@ static void pf_set_admin_mode(struct xe_device *xe, bool enable) { /* should match logic of xe_sriov_pf_admin_only() */ - xe->info.probe_display = !enable; + xe->sriov.pf.admin_only = enable; KUNIT_EXPECT_EQ(kunit_get_current_test(), enable, xe_sriov_pf_admin_only(xe)); } diff --git a/drivers/gpu/drm/xe/xe_sriov_pf.c b/drivers/gpu/drm/xe/xe_sriov_pf.c index 33bd754d138f..919f176a19eb 100644 --- a/drivers/gpu/drm/xe/xe_sriov_pf.c +++ b/drivers/gpu/drm/xe/xe_sriov_pf.c @@ -20,6 +20,11 @@ #include "xe_sriov_pf_sysfs.h" #include "xe_sriov_printk.h" +static bool wanted_admin_only(struct xe_device *xe) +{ + return !xe->info.probe_display; +} + static unsigned int wanted_max_vfs(struct xe_device *xe) { return xe_configfs_get_max_vfs(to_pci_dev(xe->drm.dev)); @@ -74,6 +79,7 @@ bool xe_sriov_pf_readiness(struct xe_device *xe) pf_reduce_totalvfs(xe, newlimit); + xe->sriov.pf.admin_only = wanted_admin_only(xe); xe->sriov.pf.device_total_vfs = totalvfs; xe->sriov.pf.driver_max_vfs = newlimit; diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_helpers.h b/drivers/gpu/drm/xe/xe_sriov_pf_helpers.h index 9054fdc34597..0fcc6cec4afc 100644 --- a/drivers/gpu/drm/xe/xe_sriov_pf_helpers.h +++ b/drivers/gpu/drm/xe/xe_sriov_pf_helpers.h @@ -56,7 +56,8 @@ static inline unsigned int xe_sriov_pf_num_vfs(const struct xe_device *xe) */ static inline bool xe_sriov_pf_admin_only(const struct xe_device *xe) { - return !xe->info.probe_display; + xe_assert(xe, IS_SRIOV_PF(xe)); + return xe->sriov.pf.admin_only; } static inline struct mutex *xe_sriov_pf_master_mutex(struct xe_device *xe) diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_types.h b/drivers/gpu/drm/xe/xe_sriov_pf_types.h index b0253e1ae5da..080cf10512f4 100644 --- a/drivers/gpu/drm/xe/xe_sriov_pf_types.h +++ b/drivers/gpu/drm/xe/xe_sriov_pf_types.h @@ -36,6 +36,9 @@ struct xe_sriov_metadata { * @XE_SRIOV_MODE_PF mode. */ struct xe_device_pf { + /** @admin_only: PF functionality focused on VFs management only. */ + bool admin_only; + /** @device_total_vfs: Maximum number of VFs supported by the device. */ u16 device_total_vfs; |
