Lines Matching refs: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()
77 xe_mmio_write32(gt, CCS_MODE, mode); in __xe_gt_apply_ccs_mode()
79 xe_gt_dbg(gt, "CCS_MODE=%x config:%08x, num_engines:%d, num_slices:%d\n", in __xe_gt_apply_ccs_mode()
83 void xe_gt_apply_ccs_mode(struct xe_gt *gt) in xe_gt_apply_ccs_mode() argument
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() local
97 return sysfs_emit(buf, "%u\n", hweight32(CCS_MASK(gt))); in num_cslices_show()
106 struct xe_gt *gt = kobj_to_gt(&kdev->kobj); in ccs_mode_show() local
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() local
116 struct xe_device *xe = gt_to_xe(gt); in ccs_mode_store()
121 xe_gt_dbg(gt, "Can't change compute mode when running as %s\n", in ccs_mode_store()
134 num_slices = hweight32(CCS_MASK(gt)); in ccs_mode_store()
136 xe_gt_dbg(gt, "Invalid compute config, %d engines %d slices\n", in ccs_mode_store()
145 xe_gt_dbg(gt, "Rejecting compute mode change as there are active drm clients\n"); 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()
152 xe_gt_record_user_engines(gt); in ccs_mode_store()
153 xe_gt_reset_async(gt); in ccs_mode_store()
171 struct xe_gt *gt = arg; in xe_gt_ccs_mode_sysfs_fini() local
173 sysfs_remove_files(gt->sysfs, gt_ccs_mode_attrs); in xe_gt_ccs_mode_sysfs_fini()
189 int xe_gt_ccs_mode_sysfs_init(struct xe_gt *gt) in xe_gt_ccs_mode_sysfs_init() argument
191 struct xe_device *xe = gt_to_xe(gt); in xe_gt_ccs_mode_sysfs_init()
194 if (!xe_gt_ccs_mode_enabled(gt)) in xe_gt_ccs_mode_sysfs_init()
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()