Lines Matching full:gt

21  * DOC: Xe GT Idle
23 * Contains functions that init GT idle features like C6
25 * device/gt#/gtidle/name - name of the state
26 * device/gt#/gtidle/idle_residency_ms - Provides residency of the idle state in ms
27 * device/gt#/gtidle/idle_status - Provides current idle state
51 struct xe_gt *gt = container_of(guc, struct xe_gt, uc.guc); in pc_to_xe() local
53 return gt_to_xe(gt); in pc_to_xe()
60 return "gt-c0"; in gt_idle_state_to_string()
62 return "gt-c6"; in gt_idle_state_to_string()
98 void xe_gt_idle_enable_pg(struct xe_gt *gt) in xe_gt_idle_enable_pg() argument
100 struct xe_device *xe = gt_to_xe(gt); in xe_gt_idle_enable_pg()
111 xe_device_assert_mem_access(gt_to_xe(gt)); in xe_gt_idle_enable_pg()
116 if ((gt->info.engine_mask & BIT(i))) in xe_gt_idle_enable_pg()
121 XE_WARN_ON(xe_force_wake_get(gt_to_fw(gt), XE_FW_GT)); in xe_gt_idle_enable_pg()
127 xe_mmio_write32(gt, MEDIA_POWERGATE_IDLE_HYSTERESIS, 25); in xe_gt_idle_enable_pg()
128 xe_mmio_write32(gt, RENDER_POWERGATE_IDLE_HYSTERESIS, 25); in xe_gt_idle_enable_pg()
131 xe_mmio_write32(gt, POWERGATE_ENABLE, pg_enable); in xe_gt_idle_enable_pg()
132 XE_WARN_ON(xe_force_wake_put(gt_to_fw(gt), XE_FW_GT)); in xe_gt_idle_enable_pg()
135 void xe_gt_idle_disable_pg(struct xe_gt *gt) in xe_gt_idle_disable_pg() argument
137 if (IS_SRIOV_VF(gt_to_xe(gt))) in xe_gt_idle_disable_pg()
140 xe_device_assert_mem_access(gt_to_xe(gt)); in xe_gt_idle_disable_pg()
141 XE_WARN_ON(xe_force_wake_get(gt_to_fw(gt), XE_FW_GT)); in xe_gt_idle_disable_pg()
143 xe_mmio_write32(gt, POWERGATE_ENABLE, 0); in xe_gt_idle_disable_pg()
145 XE_WARN_ON(xe_force_wake_put(gt_to_fw(gt), XE_FW_GT)); in xe_gt_idle_disable_pg()
203 struct xe_gt *gt = kobj_to_gt(kobj->parent); in gt_idle_fini() local
205 xe_gt_idle_disable_pg(gt); in gt_idle_fini()
207 if (gt_to_xe(gt)->info.skip_guc_pc) { in gt_idle_fini()
208 XE_WARN_ON(xe_force_wake_get(gt_to_fw(gt), XE_FW_GT)); in gt_idle_fini()
209 xe_gt_idle_disable_c6(gt); in gt_idle_fini()
210 xe_force_wake_put(gt_to_fw(gt), XE_FW_GT); in gt_idle_fini()
219 struct xe_gt *gt = gtidle_to_gt(gtidle); in xe_gt_idle_init() local
220 struct xe_device *xe = gt_to_xe(gt); in xe_gt_idle_init()
227 kobj = kobject_create_and_add("gtidle", gt->sysfs); in xe_gt_idle_init()
231 if (xe_gt_is_media_type(gt)) { in xe_gt_idle_init()
232 snprintf(gtidle->name, sizeof(gtidle->name), "gt%d-mc", gt->info.id); in xe_gt_idle_init()
235 snprintf(gtidle->name, sizeof(gtidle->name), "gt%d-rc", gt->info.id); in xe_gt_idle_init()
249 xe_gt_idle_enable_pg(gt); in xe_gt_idle_init()
254 void xe_gt_idle_enable_c6(struct xe_gt *gt) in xe_gt_idle_enable_c6() argument
256 xe_device_assert_mem_access(gt_to_xe(gt)); in xe_gt_idle_enable_c6()
257 xe_force_wake_assert_held(gt_to_fw(gt), XE_FW_GT); in xe_gt_idle_enable_c6()
259 if (IS_SRIOV_VF(gt_to_xe(gt))) in xe_gt_idle_enable_c6()
263 xe_mmio_write32(gt, RC_IDLE_HYSTERSIS, 0x3B9ACA); in xe_gt_idle_enable_c6()
265 xe_mmio_write32(gt, RC_CONTROL, in xe_gt_idle_enable_c6()
269 void xe_gt_idle_disable_c6(struct xe_gt *gt) in xe_gt_idle_disable_c6() argument
271 xe_device_assert_mem_access(gt_to_xe(gt)); in xe_gt_idle_disable_c6()
272 xe_force_wake_assert_held(gt_to_fw(gt), XE_FW_GT); in xe_gt_idle_disable_c6()
274 if (IS_SRIOV_VF(gt_to_xe(gt))) in xe_gt_idle_disable_c6()
277 xe_mmio_write32(gt, RC_CONTROL, 0); in xe_gt_idle_disable_c6()
278 xe_mmio_write32(gt, RC_STATE, 0); in xe_gt_idle_disable_c6()