Lines Matching +full:compute +full:-

1 // SPDX-License-Identifier: MIT
32 * For example, if there are four compute slices available, the in __xe_gt_apply_ccs_mode()
33 * assignment of compute slices to compute engines would be, in __xe_gt_apply_ccs_mode()
48 for (width = num_slices / num_engines; width; width--) { in __xe_gt_apply_ccs_mode()
53 if (hwe->class != XE_ENGINE_CLASS_COMPUTE) in __xe_gt_apply_ccs_mode()
56 if (hwe->logical_instance >= num_engines) in __xe_gt_apply_ccs_mode()
59 config |= BIT(hwe->instance) << XE_HW_ENGINE_CCS0; in __xe_gt_apply_ccs_mode()
66 mode |= CCS_MODE_CSLICE(cslice, hwe->instance); in __xe_gt_apply_ccs_mode()
77 xe_mmio_write32(&gt->mmio, CCS_MODE, mode); in __xe_gt_apply_ccs_mode()
85 if (!gt->ccs_mode || IS_SRIOV_VF(gt_to_xe(gt))) in xe_gt_apply_ccs_mode()
88 __xe_gt_apply_ccs_mode(gt, gt->ccs_mode); in xe_gt_apply_ccs_mode()
95 struct xe_gt *gt = kobj_to_gt(&kdev->kobj); in num_cslices_show()
106 struct xe_gt *gt = kobj_to_gt(&kdev->kobj); in ccs_mode_show()
108 return sysfs_emit(buf, "%u\n", gt->ccs_mode); in ccs_mode_show()
115 struct xe_gt *gt = kobj_to_gt(&kdev->kobj); in ccs_mode_store()
121 xe_gt_dbg(gt, "Can't change compute mode when running as %s\n", in ccs_mode_store()
123 return -EOPNOTSUPP; in ccs_mode_store()
136 xe_gt_dbg(gt, "Invalid compute config, %d engines %d slices\n", in ccs_mode_store()
138 return -EINVAL; in ccs_mode_store()
142 mutex_lock(&xe->drm.filelist_mutex); in ccs_mode_store()
143 if (!list_empty(&xe->drm.filelist)) { in ccs_mode_store()
144 mutex_unlock(&xe->drm.filelist_mutex); in ccs_mode_store()
145 xe_gt_dbg(gt, "Rejecting compute mode change as there are active drm clients\n"); in ccs_mode_store()
146 return -EBUSY; in ccs_mode_store()
149 if (gt->ccs_mode != num_engines) { in ccs_mode_store()
150 xe_gt_info(gt, "Setting compute mode to %d\n", num_engines); in ccs_mode_store()
151 gt->ccs_mode = num_engines; in ccs_mode_store()
156 mutex_unlock(&xe->drm.filelist_mutex); in ccs_mode_store()
173 sysfs_remove_files(gt->sysfs, gt_ccs_mode_attrs); in xe_gt_ccs_mode_sysfs_fini()
177 * xe_gt_ccs_mode_sysfs_init - Initialize CCS mode sysfs interfaces
180 * Through a per-gt 'ccs_mode' sysfs interface, the user can enable a fixed
181 * number of compute hardware engines to which the available compute slices
184 * The number of available compute slices is exposed to user through a per-gt
197 err = sysfs_create_files(gt->sysfs, gt_ccs_mode_attrs); in xe_gt_ccs_mode_sysfs_init()
201 return devm_add_action_or_reset(xe->drm.dev, xe_gt_ccs_mode_sysfs_fini, gt); in xe_gt_ccs_mode_sysfs_init()