Lines Matching full:gt

29 			  int (func)(struct intel_gt *gt, u32 val), u32 val)  in sysfs_gt_attribute_w_func()  argument
31 struct intel_gt *gt; in sysfs_gt_attribute_w_func() local
39 for_each_gt(gt, i915, i) { in sysfs_gt_attribute_w_func()
40 ret = func(gt, val); in sysfs_gt_attribute_w_func()
45 gt = intel_gt_sysfs_get_drvdata(kobj, attr->name); in sysfs_gt_attribute_w_func()
46 ret = func(gt, val); in sysfs_gt_attribute_w_func()
54 u32 (func)(struct intel_gt *gt), in sysfs_gt_attribute_r_func() argument
57 struct intel_gt *gt; in sysfs_gt_attribute_r_func() local
67 for_each_gt(gt, i915, i) { in sysfs_gt_attribute_r_func()
68 u32 val = func(gt); in sysfs_gt_attribute_r_func()
83 gt = intel_gt_sysfs_get_drvdata(kobj, attr->name); in sysfs_gt_attribute_r_func()
84 ret = func(gt); in sysfs_gt_attribute_r_func()
168 static u32 get_residency(struct intel_gt *gt, enum intel_rc6_res_type id) in get_residency() argument
173 with_intel_runtime_pm(gt->uncore->rpm, wakeref) in get_residency()
174 res = intel_rc6_residency_us(&gt->rc6, id); in get_residency()
183 struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); in rc6_enable_show() local
185 return sysfs_emit(buff, "%x\n", gt->rc6.enabled); in rc6_enable_show()
192 struct intel_gt *gt = intel_gt_sysfs_get_drvdata(&dev->kobj, attr->attr.name); in rc6_enable_dev_show() local
194 return sysfs_emit(buff, "%x\n", gt->rc6.enabled); in rc6_enable_dev_show()
197 static u32 __rc6_residency_ms_show(struct intel_gt *gt) in __rc6_residency_ms_show() argument
199 return get_residency(gt, INTEL_RC6_RES_RC6); in __rc6_residency_ms_show()
202 static u32 __rc6p_residency_ms_show(struct intel_gt *gt) in __rc6p_residency_ms_show() argument
204 return get_residency(gt, INTEL_RC6_RES_RC6p); in __rc6p_residency_ms_show()
207 static u32 __rc6pp_residency_ms_show(struct intel_gt *gt) in __rc6pp_residency_ms_show() argument
209 return get_residency(gt, INTEL_RC6_RES_RC6pp); in __rc6pp_residency_ms_show()
212 static u32 __media_rc6_residency_ms_show(struct intel_gt *gt) in __media_rc6_residency_ms_show() argument
214 return get_residency(gt, INTEL_RC6_RES_VLV_MEDIA); in __media_rc6_residency_ms_show()
285 static void intel_sysfs_rc6_init(struct intel_gt *gt, struct kobject *kobj) in intel_sysfs_rc6_init() argument
289 if (!IS_ENABLED(CONFIG_PM) || !HAS_RC6(gt->i915)) in intel_sysfs_rc6_init()
294 gt_warn(gt, "failed to create RC6 sysfs files (%pe)\n", ERR_PTR(ret)); in intel_sysfs_rc6_init()
300 if (HAS_RC6p(gt->i915)) { in intel_sysfs_rc6_init()
303 gt_warn(gt, "failed to create RC6p sysfs files (%pe)\n", ERR_PTR(ret)); in intel_sysfs_rc6_init()
306 if (IS_VALLEYVIEW(gt->i915) || IS_CHERRYVIEW(gt->i915)) { in intel_sysfs_rc6_init()
309 gt_warn(gt, "failed to create media RC6 sysfs files (%pe)\n", ERR_PTR(ret)); in intel_sysfs_rc6_init()
313 static u32 __act_freq_mhz_show(struct intel_gt *gt) in __act_freq_mhz_show() argument
315 return intel_rps_read_actual_frequency(&gt->rps); in __act_freq_mhz_show()
318 static u32 __cur_freq_mhz_show(struct intel_gt *gt) in __cur_freq_mhz_show() argument
320 return intel_rps_get_requested_frequency(&gt->rps); in __cur_freq_mhz_show()
323 static u32 __boost_freq_mhz_show(struct intel_gt *gt) in __boost_freq_mhz_show() argument
325 return intel_rps_get_boost_frequency(&gt->rps); in __boost_freq_mhz_show()
328 static int __boost_freq_mhz_store(struct intel_gt *gt, u32 val) in __boost_freq_mhz_store() argument
330 return intel_rps_set_boost_frequency(&gt->rps, val); in __boost_freq_mhz_store()
333 static u32 __RP0_freq_mhz_show(struct intel_gt *gt) in __RP0_freq_mhz_show() argument
335 return intel_rps_get_rp0_frequency(&gt->rps); in __RP0_freq_mhz_show()
338 static u32 __RPn_freq_mhz_show(struct intel_gt *gt) in __RPn_freq_mhz_show() argument
340 return intel_rps_get_rpn_frequency(&gt->rps); in __RPn_freq_mhz_show()
343 static u32 __RP1_freq_mhz_show(struct intel_gt *gt) in __RP1_freq_mhz_show() argument
345 return intel_rps_get_rp1_frequency(&gt->rps); in __RP1_freq_mhz_show()
348 static u32 __max_freq_mhz_show(struct intel_gt *gt) in __max_freq_mhz_show() argument
350 return intel_rps_get_max_frequency(&gt->rps); in __max_freq_mhz_show()
353 static int __set_max_freq(struct intel_gt *gt, u32 val) in __set_max_freq() argument
355 return intel_rps_set_max_frequency(&gt->rps, val); in __set_max_freq()
358 static u32 __min_freq_mhz_show(struct intel_gt *gt) in __min_freq_mhz_show() argument
360 return intel_rps_get_min_frequency(&gt->rps); in __min_freq_mhz_show()
363 static int __set_min_freq(struct intel_gt *gt, u32 val) in __set_min_freq() argument
365 return intel_rps_set_min_frequency(&gt->rps, val); in __set_min_freq()
368 static u32 __vlv_rpe_freq_mhz_show(struct intel_gt *gt) in __vlv_rpe_freq_mhz_show() argument
370 struct intel_rps *rps = &gt->rps; in __vlv_rpe_freq_mhz_show()
425 #define GEN6_GT_ATTR GEN6_ATTR(dev_, gt)
434 struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); in punit_req_freq_mhz_show() local
435 u32 preq = intel_rps_read_punit_req_frequency(&gt->rps); in punit_req_freq_mhz_show()
444 struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); in slpc_ignore_eff_freq_show() local
445 struct intel_guc_slpc *slpc = &gt_to_guc(gt)->slpc; in slpc_ignore_eff_freq_show()
454 struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); in slpc_ignore_eff_freq_store() local
455 struct intel_guc_slpc *slpc = &gt_to_guc(gt)->slpc; in slpc_ignore_eff_freq_store()
471 i915_reg_t (*reg32)(struct intel_gt *gt);
479 struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); in throttle_reason_bool_show() local
482 bool val = rps_read_mask_mmio(&gt->rps, t_attr->reg32(gt), t_attr->mask); in throttle_reason_bool_show()
575 struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); in media_freq_factor_show() local
583 with_intel_runtime_pm(gt->uncore->rpm, wakeref) in media_freq_factor_show()
584 mode = intel_uncore_read(gt->uncore, GEN6_RPNSWREQ); in media_freq_factor_show()
597 struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); in media_freq_factor_store() local
598 struct intel_guc_slpc *slpc = &gt_to_guc(gt)->slpc; in media_freq_factor_store()
626 struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); in media_RP0_freq_mhz_show() local
630 err = snb_pcode_read_p(gt->uncore, XEHP_PCODE_FREQUENCY_CONFIG, in media_RP0_freq_mhz_show()
647 struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); in media_RPn_freq_mhz_show() local
651 err = snb_pcode_read_p(gt->uncore, XEHP_PCODE_FREQUENCY_CONFIG, in media_RPn_freq_mhz_show()
684 struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); in rps_up_threshold_pct_show() local
685 struct intel_rps *rps = &gt->rps; in rps_up_threshold_pct_show()
694 struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); in rps_up_threshold_pct_store() local
695 struct intel_rps *rps = &gt->rps; in rps_up_threshold_pct_store()
718 struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); in rps_down_threshold_pct_show() local
719 struct intel_rps *rps = &gt->rps; in rps_down_threshold_pct_show()
728 struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name); in rps_down_threshold_pct_store() local
729 struct intel_rps *rps = &gt->rps; in rps_down_threshold_pct_store()
757 struct intel_gt *gt = kobj_to_gt(kobj->parent); in default_min_freq_mhz_show() local
759 return sysfs_emit(buf, "%u\n", gt->defaults.min_freq); in default_min_freq_mhz_show()
768 struct intel_gt *gt = kobj_to_gt(kobj->parent); in default_max_freq_mhz_show() local
770 return sysfs_emit(buf, "%u\n", gt->defaults.max_freq); in default_max_freq_mhz_show()
781 struct intel_gt *gt = kobj_to_gt(kobj->parent); in default_rps_up_threshold_pct_show() local
783 return sysfs_emit(buf, "%u\n", gt->defaults.rps_up_threshold); in default_rps_up_threshold_pct_show()
794 struct intel_gt *gt = kobj_to_gt(kobj->parent); in default_rps_down_threshold_pct_show() local
796 return sysfs_emit(buf, "%u\n", gt->defaults.rps_down_threshold); in default_rps_down_threshold_pct_show()
810 static int intel_sysfs_rps_init(struct intel_gt *gt, struct kobject *kobj) in intel_sysfs_rps_init() argument
816 if (GRAPHICS_VER(gt->i915) < 6) in intel_sysfs_rps_init()
831 if (IS_VALLEYVIEW(gt->i915) || IS_CHERRYVIEW(gt->i915)) in intel_sysfs_rps_init()
834 if (is_object_gt(kobj) && !intel_uc_uses_guc_slpc(&gt->uc)) { in intel_sysfs_rps_init()
843 void intel_gt_sysfs_pm_init(struct intel_gt *gt, struct kobject *kobj) in intel_gt_sysfs_pm_init() argument
847 intel_sysfs_rc6_init(gt, kobj); in intel_gt_sysfs_pm_init()
849 ret = intel_sysfs_rps_init(gt, kobj); in intel_gt_sysfs_pm_init()
851 gt_warn(gt, "failed to create RPS sysfs files (%pe)", ERR_PTR(ret)); in intel_gt_sysfs_pm_init()
859 gt_warn(gt, "failed to create punit_req_freq_mhz sysfs (%pe)", ERR_PTR(ret)); in intel_gt_sysfs_pm_init()
861 if (intel_uc_uses_guc_slpc(&gt->uc)) { in intel_gt_sysfs_pm_init()
864 gt_warn(gt, "failed to create ignore_eff_freq sysfs (%pe)", ERR_PTR(ret)); in intel_gt_sysfs_pm_init()
867 if (i915_mmio_reg_valid(intel_gt_perf_limit_reasons_reg(gt))) { in intel_gt_sysfs_pm_init()
870 gt_warn(gt, "failed to create throttle sysfs files (%pe)", ERR_PTR(ret)); in intel_gt_sysfs_pm_init()
873 if (HAS_MEDIA_RATIO_MODE(gt->i915) && intel_uc_uses_guc_slpc(&gt->uc)) { in intel_gt_sysfs_pm_init()
876 gt_warn(gt, "failed to create media_perf_power_attrs sysfs (%pe)\n", in intel_gt_sysfs_pm_init()
880 ret = sysfs_create_files(gt->sysfs_defaults, rps_defaults_attrs); in intel_gt_sysfs_pm_init()
882 gt_warn(gt, "failed to add rps defaults (%pe)\n", ERR_PTR(ret)); in intel_gt_sysfs_pm_init()