Lines Matching refs:xe
19 static unsigned int wanted_max_vfs(struct xe_device *xe)
24 static int pf_reduce_totalvfs(struct xe_device *xe, int limit)
26 struct device *dev = xe->drm.dev;
32 xe_sriov_notice(xe, "Failed to set number of VFs to %d (%pe)\n",
37 static bool pf_continue_as_native(struct xe_device *xe, const char *why)
39 xe_sriov_dbg(xe, "%s, continuing as native\n", why);
40 pf_reduce_totalvfs(xe, 0);
46 * @xe: the &xe_device to check
53 bool xe_sriov_pf_readiness(struct xe_device *xe)
55 struct device *dev = xe->drm.dev;
58 int newlimit = min_t(u16, wanted_max_vfs(xe), totalvfs);
60 xe_assert(xe, totalvfs <= U16_MAX);
65 if (!xe_device_uc_enabled(xe))
66 return pf_continue_as_native(xe, "Guc submission disabled");
69 return pf_continue_as_native(xe, "all VFs disabled");
71 pf_reduce_totalvfs(xe, newlimit);
73 xe->sriov.pf.device_total_vfs = totalvfs;
74 xe->sriov.pf.driver_max_vfs = newlimit;
81 * @xe: the &xe_device to initialize
85 int xe_sriov_pf_init_early(struct xe_device *xe)
89 xe_assert(xe, IS_SRIOV_PF(xe));
91 xe->sriov.pf.vfs = drmm_kcalloc(&xe->drm, 1 + xe_sriov_pf_get_totalvfs(xe),
92 sizeof(*xe->sriov.pf.vfs), GFP_KERNEL);
93 if (!xe->sriov.pf.vfs)
96 err = drmm_mutex_init(&xe->drm, &xe->sriov.pf.master_lock);
100 xe_sriov_pf_service_init(xe);
107 * @xe: the &xe_device to print info from
112 void xe_sriov_pf_print_vfs_summary(struct xe_device *xe, struct drm_printer *p)
114 struct pci_dev *pdev = to_pci_dev(xe->drm.dev);
116 xe_assert(xe, IS_SRIOV_PF(xe));
118 drm_printf(p, "total: %u\n", xe->sriov.pf.device_total_vfs);
119 drm_printf(p, "supported: %u\n", xe->sriov.pf.driver_max_vfs);
128 struct xe_device *xe = parent->d_inode->i_private;
131 print(xe, &p);
142 * @xe: the &xe_device
147 void xe_sriov_pf_debugfs_register(struct xe_device *xe, struct dentry *root)
149 struct drm_minor *minor = xe->drm.primary;
160 parent->d_inode->i_private = xe;