Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+12 -2
+1 -1
drivers/gpu/drm/xe/tests/xe_gt_sriov_pf_config_kunit.c
··· 15 15 static void pf_set_admin_mode(struct xe_device *xe, bool enable) 16 16 { 17 17 /* should match logic of xe_sriov_pf_admin_only() */ 18 - xe->info.probe_display = !enable; 18 + xe->sriov.pf.admin_only = enable; 19 19 KUNIT_EXPECT_EQ(kunit_get_current_test(), enable, xe_sriov_pf_admin_only(xe)); 20 20 } 21 21
+6
drivers/gpu/drm/xe/xe_sriov_pf.c
··· 20 20 #include "xe_sriov_pf_sysfs.h" 21 21 #include "xe_sriov_printk.h" 22 22 23 + static bool wanted_admin_only(struct xe_device *xe) 24 + { 25 + return !xe->info.probe_display; 26 + } 27 + 23 28 static unsigned int wanted_max_vfs(struct xe_device *xe) 24 29 { 25 30 return xe_configfs_get_max_vfs(to_pci_dev(xe->drm.dev)); ··· 79 74 80 75 pf_reduce_totalvfs(xe, newlimit); 81 76 77 + xe->sriov.pf.admin_only = wanted_admin_only(xe); 82 78 xe->sriov.pf.device_total_vfs = totalvfs; 83 79 xe->sriov.pf.driver_max_vfs = newlimit; 84 80
+2 -1
drivers/gpu/drm/xe/xe_sriov_pf_helpers.h
··· 56 56 */ 57 57 static inline bool xe_sriov_pf_admin_only(const struct xe_device *xe) 58 58 { 59 - return !xe->info.probe_display; 59 + xe_assert(xe, IS_SRIOV_PF(xe)); 60 + return xe->sriov.pf.admin_only; 60 61 } 61 62 62 63 static inline struct mutex *xe_sriov_pf_master_mutex(struct xe_device *xe)
+3
drivers/gpu/drm/xe/xe_sriov_pf_types.h
··· 36 36 * @XE_SRIOV_MODE_PF mode. 37 37 */ 38 38 struct xe_device_pf { 39 + /** @admin_only: PF functionality focused on VFs management only. */ 40 + bool admin_only; 41 + 39 42 /** @device_total_vfs: Maximum number of VFs supported by the device. */ 40 43 u16 device_total_vfs; 41 44