Lines Matching +full:compute +full:-

1 // SPDX-License-Identifier: MIT
30 * For example, if there are four compute slices available, the in __xe_gt_apply_ccs_mode()
31 * assignment of compute slices to compute engines would be, in __xe_gt_apply_ccs_mode()
46 for (width = num_slices / num_engines; width; width--) { in __xe_gt_apply_ccs_mode()
51 if (hwe->class != XE_ENGINE_CLASS_COMPUTE) in __xe_gt_apply_ccs_mode()
54 if (hwe->logical_instance >= num_engines) in __xe_gt_apply_ccs_mode()
57 config |= BIT(hwe->instance) << XE_HW_ENGINE_CCS0; in __xe_gt_apply_ccs_mode()
64 mode |= CCS_MODE_CSLICE(cslice, hwe->instance); in __xe_gt_apply_ccs_mode()
77 if (!gt->ccs_mode) in xe_gt_apply_ccs_mode()
80 __xe_gt_apply_ccs_mode(gt, gt->ccs_mode); in xe_gt_apply_ccs_mode()
87 struct xe_gt *gt = kobj_to_gt(&kdev->kobj); in num_cslices_show()
98 struct xe_gt *gt = kobj_to_gt(&kdev->kobj); in ccs_mode_show()
100 return sysfs_emit(buf, "%u\n", gt->ccs_mode); in ccs_mode_show()
107 struct xe_gt *gt = kobj_to_gt(&kdev->kobj); in ccs_mode_store()
122 xe_gt_dbg(gt, "Invalid compute config, %d engines %d slices\n", in ccs_mode_store()
124 return -EINVAL; in ccs_mode_store()
128 spin_lock(&xe->clients.lock); in ccs_mode_store()
129 if (xe->clients.count) { in ccs_mode_store()
130 spin_unlock(&xe->clients.lock); in ccs_mode_store()
131 return -EBUSY; in ccs_mode_store()
134 if (gt->ccs_mode != num_engines) { in ccs_mode_store()
135 xe_gt_info(gt, "Setting compute mode to %d\n", num_engines); in ccs_mode_store()
136 gt->ccs_mode = num_engines; in ccs_mode_store()
140 spin_unlock(&xe->clients.lock); in ccs_mode_store()
157 sysfs_remove_files(gt->sysfs, gt_ccs_mode_attrs); in xe_gt_ccs_mode_sysfs_fini()
161 * xe_gt_ccs_mode_sysfs_init - Initialize CCS mode sysfs interfaces
164 * Through a per-gt 'ccs_mode' sysfs interface, the user can enable a fixed
165 * number of compute hardware engines to which the available compute slices
168 * The number of available compute slices is exposed to user through a per-gt
179 err = sysfs_create_files(gt->sysfs, gt_ccs_mode_attrs); in xe_gt_ccs_mode_sysfs_init()
181 drm_warn(&xe->drm, "Sysfs creation for ccs_mode failed err: %d\n", err); in xe_gt_ccs_mode_sysfs_init()
185 err = drmm_add_action_or_reset(&xe->drm, xe_gt_ccs_mode_sysfs_fini, gt); in xe_gt_ccs_mode_sysfs_init()
187 sysfs_remove_files(gt->sysfs, gt_ccs_mode_attrs); in xe_gt_ccs_mode_sysfs_init()
188 drm_warn(&xe->drm, "%s: drmm_add_action_or_reset failed, err: %d\n", in xe_gt_ccs_mode_sysfs_init()