Lines Matching refs:ddat

66 	struct hwm_drvdata ddat;  member
76 hwm_locked_with_pm_intel_uncore_rmw(struct hwm_drvdata *ddat, in hwm_locked_with_pm_intel_uncore_rmw() argument
79 struct i915_hwmon *hwmon = ddat->hwmon; in hwm_locked_with_pm_intel_uncore_rmw()
80 struct intel_uncore *uncore = ddat->uncore; in hwm_locked_with_pm_intel_uncore_rmw()
98 hwm_field_read_and_scale(struct hwm_drvdata *ddat, i915_reg_t rgadr, in hwm_field_read_and_scale() argument
101 struct intel_uncore *uncore = ddat->uncore; in hwm_field_read_and_scale()
134 hwm_energy(struct hwm_drvdata *ddat, long *energy) in hwm_energy() argument
136 struct intel_uncore *uncore = ddat->uncore; in hwm_energy()
137 struct i915_hwmon *hwmon = ddat->hwmon; in hwm_energy()
138 struct hwm_energy_info *ei = &ddat->ei; in hwm_energy()
143 if (ddat->gt_n >= 0) in hwm_energy()
169 struct hwm_drvdata *ddat = dev_get_drvdata(dev); in hwm_power1_max_interval_show() local
170 struct i915_hwmon *hwmon = ddat->hwmon; in hwm_power1_max_interval_show()
175 with_intel_runtime_pm(ddat->uncore->rpm, wakeref) in hwm_power1_max_interval_show()
176 r = intel_uncore_read(ddat->uncore, hwmon->rg.pkg_rapl_limit); in hwm_power1_max_interval_show()
200 struct hwm_drvdata *ddat = dev_get_drvdata(dev); in hwm_power1_max_interval_store() local
201 struct i915_hwmon *hwmon = ddat->hwmon; in hwm_power1_max_interval_store()
245 hwm_locked_with_pm_intel_uncore_rmw(ddat, hwmon->rg.pkg_rapl_limit, in hwm_power1_max_interval_store()
263 struct hwm_drvdata *ddat = dev_get_drvdata(dev); in hwm_attributes_visible() local
264 struct i915_hwmon *hwmon = ddat->hwmon; in hwm_attributes_visible()
314 hwm_in_is_visible(const struct hwm_drvdata *ddat, u32 attr) in hwm_in_is_visible() argument
316 struct drm_i915_private *i915 = ddat->uncore->i915; in hwm_in_is_visible()
327 hwm_in_read(struct hwm_drvdata *ddat, u32 attr, long *val) in hwm_in_read() argument
329 struct i915_hwmon *hwmon = ddat->hwmon; in hwm_in_read()
335 with_intel_runtime_pm(ddat->uncore->rpm, wakeref) in hwm_in_read()
336 reg_value = intel_uncore_read(ddat->uncore, hwmon->rg.gt_perf_status); in hwm_in_read()
346 hwm_power_is_visible(const struct hwm_drvdata *ddat, u32 attr, int chan) in hwm_power_is_visible() argument
348 struct drm_i915_private *i915 = ddat->uncore->i915; in hwm_power_is_visible()
349 struct i915_hwmon *hwmon = ddat->hwmon; in hwm_power_is_visible()
374 hwm_power_max_read(struct hwm_drvdata *ddat, long *val) in hwm_power_max_read() argument
376 struct i915_hwmon *hwmon = ddat->hwmon; in hwm_power_max_read()
381 with_intel_runtime_pm(ddat->uncore->rpm, wakeref) in hwm_power_max_read()
382 r = intel_uncore_read(ddat->uncore, hwmon->rg.pkg_rapl_limit); in hwm_power_max_read()
388 *val = hwm_field_read_and_scale(ddat, in hwm_power_max_read()
394 with_intel_runtime_pm(ddat->uncore->rpm, wakeref) in hwm_power_max_read()
395 r = intel_uncore_read64(ddat->uncore, hwmon->rg.pkg_power_sku); in hwm_power_max_read()
408 hwm_power_max_write(struct hwm_drvdata *ddat, long val) in hwm_power_max_write() argument
410 struct i915_hwmon *hwmon = ddat->hwmon; in hwm_power_max_write()
418 wakeref = intel_runtime_pm_get(ddat->uncore->rpm); in hwm_power_max_write()
421 prepare_to_wait(&ddat->waitq, &wait, TASK_INTERRUPTIBLE); in hwm_power_max_write()
423 if (!hwmon->ddat.reset_in_progress) in hwm_power_max_write()
432 intel_runtime_pm_put(ddat->uncore->rpm, wakeref); in hwm_power_max_write()
436 finish_wait(&ddat->waitq, &wait); in hwm_power_max_write()
442 intel_uncore_rmw(ddat->uncore, hwmon->rg.pkg_rapl_limit, in hwm_power_max_write()
444 nval = intel_uncore_read(ddat->uncore, hwmon->rg.pkg_rapl_limit); in hwm_power_max_write()
455 intel_uncore_rmw(ddat->uncore, hwmon->rg.pkg_rapl_limit, in hwm_power_max_write()
459 intel_runtime_pm_put(ddat->uncore->rpm, wakeref); in hwm_power_max_write()
464 hwm_power_read(struct hwm_drvdata *ddat, u32 attr, int chan, long *val) in hwm_power_read() argument
466 struct i915_hwmon *hwmon = ddat->hwmon; in hwm_power_read()
472 return hwm_power_max_read(ddat, val); in hwm_power_read()
474 *val = hwm_field_read_and_scale(ddat, in hwm_power_read()
481 ret = hwm_pcode_read_i1(ddat->uncore->i915, &uval); in hwm_power_read()
495 hwm_power_write(struct hwm_drvdata *ddat, u32 attr, int chan, long val) in hwm_power_write() argument
501 return hwm_power_max_write(ddat, val); in hwm_power_write()
504 return hwm_pcode_write_i1(ddat->uncore->i915, uval); in hwm_power_write()
520 hwmon->ddat.reset_in_progress = true; in i915_hwmon_power_max_disable()
521 r = intel_uncore_rmw(hwmon->ddat.uncore, hwmon->rg.pkg_rapl_limit, in i915_hwmon_power_max_disable()
537 intel_uncore_rmw(hwmon->ddat.uncore, hwmon->rg.pkg_rapl_limit, in i915_hwmon_power_max_restore()
539 hwmon->ddat.reset_in_progress = false; in i915_hwmon_power_max_restore()
540 wake_up_all(&hwmon->ddat.waitq); in i915_hwmon_power_max_restore()
546 hwm_energy_is_visible(const struct hwm_drvdata *ddat, u32 attr) in hwm_energy_is_visible() argument
548 struct i915_hwmon *hwmon = ddat->hwmon; in hwm_energy_is_visible()
553 if (ddat->gt_n >= 0) in hwm_energy_is_visible()
564 hwm_energy_read(struct hwm_drvdata *ddat, u32 attr, long *val) in hwm_energy_read() argument
568 hwm_energy(ddat, val); in hwm_energy_read()
576 hwm_curr_is_visible(const struct hwm_drvdata *ddat, u32 attr) in hwm_curr_is_visible() argument
578 struct drm_i915_private *i915 = ddat->uncore->i915; in hwm_curr_is_visible()
591 hwm_curr_read(struct hwm_drvdata *ddat, u32 attr, long *val) in hwm_curr_read() argument
598 ret = hwm_pcode_read_i1(ddat->uncore->i915, &uval); in hwm_curr_read()
612 hwm_curr_write(struct hwm_drvdata *ddat, u32 attr, long val) in hwm_curr_write() argument
619 return hwm_pcode_write_i1(ddat->uncore->i915, uval); in hwm_curr_write()
626 hwm_fan_is_visible(const struct hwm_drvdata *ddat, u32 attr) in hwm_fan_is_visible() argument
628 struct i915_hwmon *hwmon = ddat->hwmon; in hwm_fan_is_visible()
637 hwm_fan_input_read(struct hwm_drvdata *ddat, long *val) in hwm_fan_input_read() argument
639 struct i915_hwmon *hwmon = ddat->hwmon; in hwm_fan_input_read()
640 struct hwm_fan_info *fi = &ddat->fi; in hwm_fan_input_read()
646 wakeref = intel_runtime_pm_get(ddat->uncore->rpm); in hwm_fan_input_read()
649 reg_val = intel_uncore_read(ddat->uncore, hwmon->rg.fan_speed); in hwm_fan_input_read()
675 intel_runtime_pm_put(ddat->uncore->rpm, wakeref); in hwm_fan_input_read()
680 hwm_fan_read(struct hwm_drvdata *ddat, u32 attr, long *val) in hwm_fan_read() argument
683 return hwm_fan_input_read(ddat, val); in hwm_fan_read()
692 struct hwm_drvdata *ddat = (struct hwm_drvdata *)drvdata; in hwm_is_visible() local
696 return hwm_in_is_visible(ddat, attr); in hwm_is_visible()
698 return hwm_power_is_visible(ddat, attr, channel); in hwm_is_visible()
700 return hwm_energy_is_visible(ddat, attr); in hwm_is_visible()
702 return hwm_curr_is_visible(ddat, attr); in hwm_is_visible()
704 return hwm_fan_is_visible(ddat, attr); in hwm_is_visible()
714 struct hwm_drvdata *ddat = dev_get_drvdata(dev); in hwm_read() local
718 return hwm_in_read(ddat, attr, val); in hwm_read()
720 return hwm_power_read(ddat, attr, channel, val); in hwm_read()
722 return hwm_energy_read(ddat, attr, val); in hwm_read()
724 return hwm_curr_read(ddat, attr, val); in hwm_read()
726 return hwm_fan_read(ddat, attr, val); in hwm_read()
736 struct hwm_drvdata *ddat = dev_get_drvdata(dev); in hwm_write() local
740 return hwm_power_write(ddat, attr, channel, val); in hwm_write()
742 return hwm_curr_write(ddat, attr, val); in hwm_write()
763 struct hwm_drvdata *ddat = (struct hwm_drvdata *)drvdata; in hwm_gt_is_visible() local
767 return hwm_energy_is_visible(ddat, attr); in hwm_gt_is_visible()
777 struct hwm_drvdata *ddat = dev_get_drvdata(dev); in hwm_gt_read() local
781 return hwm_energy_read(ddat, attr, val); in hwm_gt_read()
802 struct hwm_drvdata *ddat = &hwmon->ddat; in hwm_get_preregistration_info() local
842 ddat->fi.reg_val_prev = intel_uncore_read(uncore, in hwm_get_preregistration_info()
844 ddat->fi.time_prev = get_jiffies_64(); in hwm_get_preregistration_info()
857 hwm_energy(ddat, &energy); in hwm_get_preregistration_info()
869 struct hwm_drvdata *ddat; in i915_hwmon_register() local
884 ddat = &hwmon->ddat; in i915_hwmon_register()
886 ddat->hwmon = hwmon; in i915_hwmon_register()
887 ddat->uncore = &i915->uncore; in i915_hwmon_register()
888 snprintf(ddat->name, sizeof(ddat->name), "i915"); in i915_hwmon_register()
889 ddat->gt_n = -1; in i915_hwmon_register()
890 init_waitqueue_head(&ddat->waitq); in i915_hwmon_register()
904 hwmon_dev = hwmon_device_register_with_info(dev, ddat->name, in i915_hwmon_register()
905 ddat, in i915_hwmon_register()
911 ddat->hwmon_dev = hwmon_dev; in i915_hwmon_register()
947 if (hwmon->ddat.hwmon_dev) in i915_hwmon_unregister()
948 hwmon_device_unregister(hwmon->ddat.hwmon_dev); in i915_hwmon_unregister()