Lines Matching +full:0 +full:xe
15 static unsigned int wanted_max_vfs(struct xe_device *xe) in wanted_max_vfs() argument
20 static int pf_reduce_totalvfs(struct xe_device *xe, int limit) in pf_reduce_totalvfs() argument
22 struct device *dev = xe->drm.dev; in pf_reduce_totalvfs()
28 xe_sriov_notice(xe, "Failed to set number of VFs to %d (%pe)\n", in pf_reduce_totalvfs()
33 static bool pf_continue_as_native(struct xe_device *xe, const char *why) in pf_continue_as_native() argument
35 xe_sriov_dbg(xe, "%s, continuing as native\n", why); in pf_continue_as_native()
36 pf_reduce_totalvfs(xe, 0); in pf_continue_as_native()
42 * @xe: the &xe_device to check
49 bool xe_sriov_pf_readiness(struct xe_device *xe) in xe_sriov_pf_readiness() argument
51 struct device *dev = xe->drm.dev; in xe_sriov_pf_readiness()
54 int newlimit = min_t(u16, wanted_max_vfs(xe), totalvfs); in xe_sriov_pf_readiness()
56 xe_assert(xe, totalvfs <= U16_MAX); in xe_sriov_pf_readiness()
61 if (!xe_device_uc_enabled(xe)) in xe_sriov_pf_readiness()
62 return pf_continue_as_native(xe, "Guc submission disabled"); in xe_sriov_pf_readiness()
65 return pf_continue_as_native(xe, "all VFs disabled"); in xe_sriov_pf_readiness()
67 pf_reduce_totalvfs(xe, newlimit); in xe_sriov_pf_readiness()
69 xe->sriov.pf.device_total_vfs = totalvfs; in xe_sriov_pf_readiness()
70 xe->sriov.pf.driver_max_vfs = newlimit; in xe_sriov_pf_readiness()
77 * @xe: the &xe_device to initialize
79 * Return: 0 on success or a negative error code on failure.
81 int xe_sriov_pf_init_early(struct xe_device *xe) in xe_sriov_pf_init_early() argument
83 xe_assert(xe, IS_SRIOV_PF(xe)); in xe_sriov_pf_init_early()
85 return drmm_mutex_init(&xe->drm, &xe->sriov.pf.master_lock); in xe_sriov_pf_init_early()
90 * @xe: the &xe_device to print info from
95 void xe_sriov_pf_print_vfs_summary(struct xe_device *xe, struct drm_printer *p) in xe_sriov_pf_print_vfs_summary() argument
97 struct pci_dev *pdev = to_pci_dev(xe->drm.dev); in xe_sriov_pf_print_vfs_summary()
99 xe_assert(xe, IS_SRIOV_PF(xe)); in xe_sriov_pf_print_vfs_summary()
101 drm_printf(p, "total: %u\n", xe->sriov.pf.device_total_vfs); in xe_sriov_pf_print_vfs_summary()
102 drm_printf(p, "supported: %u\n", xe->sriov.pf.driver_max_vfs); in xe_sriov_pf_print_vfs_summary()