Lines Matching full:gt

17 static void __xe_gt_apply_ccs_mode(struct xe_gt *gt, u32 num_engines)  in __xe_gt_apply_ccs_mode()  argument
20 int num_slices = hweight32(CCS_MASK(gt)); in __xe_gt_apply_ccs_mode()
21 struct xe_device *xe = gt_to_xe(gt); in __xe_gt_apply_ccs_mode()
25 xe_assert(xe, xe_gt_ccs_mode_enabled(gt)); in __xe_gt_apply_ccs_mode()
52 for_each_hw_engine(hwe, gt, id) { in __xe_gt_apply_ccs_mode()
62 while ((CCS_MASK(gt) & BIT(cslice)) == 0) in __xe_gt_apply_ccs_mode()
71 xe_mmio_write32(gt, CCS_MODE, mode); in __xe_gt_apply_ccs_mode()
73 xe_gt_dbg(gt, "CCS_MODE=%x config:%08x, num_engines:%d, num_slices:%d\n", in __xe_gt_apply_ccs_mode()
77 void xe_gt_apply_ccs_mode(struct xe_gt *gt) in xe_gt_apply_ccs_mode() argument
79 if (!gt->ccs_mode || IS_SRIOV_VF(gt_to_xe(gt))) in xe_gt_apply_ccs_mode()
82 __xe_gt_apply_ccs_mode(gt, gt->ccs_mode); in xe_gt_apply_ccs_mode()
89 struct xe_gt *gt = kobj_to_gt(&kdev->kobj); in num_cslices_show() local
91 return sysfs_emit(buf, "%u\n", hweight32(CCS_MASK(gt))); in num_cslices_show()
100 struct xe_gt *gt = kobj_to_gt(&kdev->kobj); in ccs_mode_show() local
102 return sysfs_emit(buf, "%u\n", gt->ccs_mode); in ccs_mode_show()
109 struct xe_gt *gt = kobj_to_gt(&kdev->kobj); in ccs_mode_store() local
110 struct xe_device *xe = gt_to_xe(gt); in ccs_mode_store()
115 xe_gt_dbg(gt, "Can't change compute mode when running as %s\n", in ccs_mode_store()
128 num_slices = hweight32(CCS_MASK(gt)); in ccs_mode_store()
130 xe_gt_dbg(gt, "Invalid compute config, %d engines %d slices\n", in ccs_mode_store()
142 if (gt->ccs_mode != num_engines) { in ccs_mode_store()
143 xe_gt_info(gt, "Setting compute mode to %d\n", num_engines); in ccs_mode_store()
144 gt->ccs_mode = num_engines; in ccs_mode_store()
145 xe_gt_record_user_engines(gt); in ccs_mode_store()
146 xe_gt_reset_async(gt); in ccs_mode_store()
164 struct xe_gt *gt = arg; in xe_gt_ccs_mode_sysfs_fini() local
166 sysfs_remove_files(gt->sysfs, gt_ccs_mode_attrs); in xe_gt_ccs_mode_sysfs_fini()
171 * @gt: GT structure
173 * Through a per-gt 'ccs_mode' sysfs interface, the user can enable a fixed
175 * are to be allocated. This user configuration change triggers a gt reset
177 * The number of available compute slices is exposed to user through a per-gt
182 int xe_gt_ccs_mode_sysfs_init(struct xe_gt *gt) in xe_gt_ccs_mode_sysfs_init() argument
184 struct xe_device *xe = gt_to_xe(gt); in xe_gt_ccs_mode_sysfs_init()
187 if (!xe_gt_ccs_mode_enabled(gt)) in xe_gt_ccs_mode_sysfs_init()
190 err = sysfs_create_files(gt->sysfs, gt_ccs_mode_attrs); in xe_gt_ccs_mode_sysfs_init()
194 return devm_add_action_or_reset(xe->drm.dev, xe_gt_ccs_mode_sysfs_fini, gt); in xe_gt_ccs_mode_sysfs_init()