Lines Matching refs:gtidle
34 return &kobj_to_gt(kobj->parent)->gtidle; in dev_to_gtidle()
37 static struct xe_gt *gtidle_to_gt(struct xe_gt_idle *gtidle) in gtidle_to_gt() argument
39 return container_of(gtidle, struct xe_gt, gtidle); in gtidle_to_gt()
42 static struct xe_guc_pc *gtidle_to_pc(struct xe_gt_idle *gtidle) in gtidle_to_pc() argument
44 return >idle_to_gt(gtidle)->uc.guc.pc; in gtidle_to_pc()
68 static u64 get_residency_ms(struct xe_gt_idle *gtidle, u64 cur_residency) in get_residency_ms() argument
79 prev_residency = gtidle->prev_residency; in get_residency_ms()
80 gtidle->prev_residency = cur_residency; in get_residency_ms()
89 cur_residency = gtidle->cur_residency + delta; in get_residency_ms()
90 gtidle->cur_residency = cur_residency; in get_residency_ms()
93 cur_residency = mul_u64_u32_div(cur_residency, gtidle->residency_multiplier, 1e6); in get_residency_ms()
151 struct xe_gt_idle *gtidle = dev_to_gtidle(dev); in name_show() local
152 struct xe_guc_pc *pc = gtidle_to_pc(gtidle); in name_show()
156 ret = sysfs_emit(buff, "%s\n", gtidle->name); in name_show()
166 struct xe_gt_idle *gtidle = dev_to_gtidle(dev); in idle_status_show() local
167 struct xe_guc_pc *pc = gtidle_to_pc(gtidle); in idle_status_show()
171 state = gtidle->idle_status(pc); in idle_status_show()
181 struct xe_gt_idle *gtidle = dev_to_gtidle(dev); in idle_residency_ms_show() local
182 struct xe_guc_pc *pc = gtidle_to_pc(gtidle); in idle_residency_ms_show()
186 residency = gtidle->idle_residency(pc); in idle_residency_ms_show()
189 return sysfs_emit(buff, "%llu\n", get_residency_ms(gtidle, residency)); in idle_residency_ms_show()
217 int xe_gt_idle_init(struct xe_gt_idle *gtidle) in xe_gt_idle_init() argument
219 struct xe_gt *gt = gtidle_to_gt(gtidle); in xe_gt_idle_init()
232 snprintf(gtidle->name, sizeof(gtidle->name), "gt%d-mc", gt->info.id); in xe_gt_idle_init()
233 gtidle->idle_residency = xe_guc_pc_mc6_residency; in xe_gt_idle_init()
235 snprintf(gtidle->name, sizeof(gtidle->name), "gt%d-rc", gt->info.id); in xe_gt_idle_init()
236 gtidle->idle_residency = xe_guc_pc_rc6_residency; in xe_gt_idle_init()
240 gtidle->residency_multiplier = 1280; in xe_gt_idle_init()
241 gtidle->idle_status = xe_guc_pc_c_status; in xe_gt_idle_init()