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()
100 void xe_gt_idle_enable_pg(struct xe_gt *gt) in xe_gt_idle_enable_pg() argument
102 struct xe_device *xe = gt_to_xe(gt); in xe_gt_idle_enable_pg()
103 struct xe_gt_idle *gtidle = &gt->gtidle; in xe_gt_idle_enable_pg()
104 struct xe_mmio *mmio = &gt->mmio; in xe_gt_idle_enable_pg()
116 xe_device_assert_mem_access(gt_to_xe(gt)); in xe_gt_idle_enable_pg()
118 vcs_mask = xe_hw_engine_mask_per_class(gt, XE_ENGINE_CLASS_VIDEO_DECODE); in xe_gt_idle_enable_pg()
119 vecs_mask = xe_hw_engine_mask_per_class(gt, XE_ENGINE_CLASS_VIDEO_ENHANCE); in xe_gt_idle_enable_pg()
124 if (xe_gt_is_main_type(gt)) in xe_gt_idle_enable_pg()
132 if ((gt->info.engine_mask & BIT(i))) in xe_gt_idle_enable_pg()
138 fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT); in xe_gt_idle_enable_pg()
149 xe_force_wake_put(gt_to_fw(gt), fw_ref); in xe_gt_idle_enable_pg()
152 void xe_gt_idle_disable_pg(struct xe_gt *gt) in xe_gt_idle_disable_pg() argument
154 struct xe_gt_idle *gtidle = &gt->gtidle; in xe_gt_idle_disable_pg()
157 if (IS_SRIOV_VF(gt_to_xe(gt))) in xe_gt_idle_disable_pg()
160 xe_device_assert_mem_access(gt_to_xe(gt)); in xe_gt_idle_disable_pg()
163 fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT); in xe_gt_idle_disable_pg()
164 xe_mmio_write32(&gt->mmio, POWERGATE_ENABLE, gtidle->powergate_enable); in xe_gt_idle_disable_pg()
165 xe_force_wake_put(gt_to_fw(gt), fw_ref); in xe_gt_idle_disable_pg()
170 * @gt: GT object
177 int xe_gt_idle_pg_print(struct xe_gt *gt, struct drm_printer *p) in xe_gt_idle_pg_print() argument
179 struct xe_gt_idle *gtidle = &gt->gtidle; in xe_gt_idle_pg_print()
180 struct xe_device *xe = gt_to_xe(gt); in xe_gt_idle_pg_print()
219 /* Do not wake the GT to read powergating status */ in xe_gt_idle_pg_print()
221 fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT); in xe_gt_idle_pg_print()
225 pg_enabled = xe_mmio_read32(&gt->mmio, POWERGATE_ENABLE); in xe_gt_idle_pg_print()
226 pg_status = xe_mmio_read32(&gt->mmio, POWERGATE_DOMAIN_STATUS); in xe_gt_idle_pg_print()
228 xe_force_wake_put(gt_to_fw(gt), fw_ref); in xe_gt_idle_pg_print()
231 if (gt->info.engine_mask & XE_HW_ENGINE_RCS_MASK) { in xe_gt_idle_pg_print()
239 vcs_mask = xe_hw_engine_mask_per_class(gt, XE_ENGINE_CLASS_VIDEO_DECODE); in xe_gt_idle_pg_print()
240 vecs_mask = xe_hw_engine_mask_per_class(gt, XE_ENGINE_CLASS_VIDEO_ENHANCE); in xe_gt_idle_pg_print()
248 if (gt->info.engine_mask & media_slices[n].engines) in xe_gt_idle_pg_print()
332 struct xe_gt *gt = kobj_to_gt(kobj->parent); in gt_idle_fini() local
334 xe_gt_idle_disable_pg(gt); in gt_idle_fini()
336 if (gt_to_xe(gt)->info.skip_guc_pc) in gt_idle_fini()
337 xe_gt_idle_disable_c6(gt); in gt_idle_fini()
345 struct xe_gt *gt = gtidle_to_gt(gtidle); in xe_gt_idle_init() local
346 struct xe_device *xe = gt_to_xe(gt); in xe_gt_idle_init()
353 kobj = kobject_create_and_add("gtidle", gt->sysfs); in xe_gt_idle_init()
359 if (xe_gt_is_media_type(gt)) { in xe_gt_idle_init()
360 snprintf(gtidle->name, sizeof(gtidle->name), "gt%d-mc", gt->info.id); in xe_gt_idle_init()
363 snprintf(gtidle->name, sizeof(gtidle->name), "gt%d-rc", gt->info.id); in xe_gt_idle_init()
377 xe_gt_idle_enable_pg(gt); in xe_gt_idle_init()
382 void xe_gt_idle_enable_c6(struct xe_gt *gt) in xe_gt_idle_enable_c6() argument
384 xe_device_assert_mem_access(gt_to_xe(gt)); in xe_gt_idle_enable_c6()
385 xe_force_wake_assert_held(gt_to_fw(gt), XE_FW_GT); in xe_gt_idle_enable_c6()
387 if (IS_SRIOV_VF(gt_to_xe(gt))) in xe_gt_idle_enable_c6()
391 xe_mmio_write32(&gt->mmio, RC_IDLE_HYSTERSIS, 0x3B9ACA); in xe_gt_idle_enable_c6()
393 xe_mmio_write32(&gt->mmio, RC_CONTROL, in xe_gt_idle_enable_c6()
397 int xe_gt_idle_disable_c6(struct xe_gt *gt) in xe_gt_idle_disable_c6() argument
401 xe_device_assert_mem_access(gt_to_xe(gt)); in xe_gt_idle_disable_c6()
403 if (IS_SRIOV_VF(gt_to_xe(gt))) in xe_gt_idle_disable_c6()
406 fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT); in xe_gt_idle_disable_c6()
410 xe_mmio_write32(&gt->mmio, RC_CONTROL, 0); in xe_gt_idle_disable_c6()
411 xe_mmio_write32(&gt->mmio, RC_STATE, 0); in xe_gt_idle_disable_c6()
413 xe_force_wake_put(gt_to_fw(gt), fw_ref); in xe_gt_idle_disable_c6()