amdgpu_dpm.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * Copyright 2014 Advanced Micro Devices, Inc.
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  17. * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
  18. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  19. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  20. * OTHER DEALINGS IN THE SOFTWARE.
  21. *
  22. */
  23. #ifndef __AMDGPU_DPM_H__
  24. #define __AMDGPU_DPM_H__
  25. #define R600_SSTU_DFLT 0
  26. #define R600_SST_DFLT 0x00C8
  27. /* XXX are these ok? */
  28. #define R600_TEMP_RANGE_MIN (90 * 1000)
  29. #define R600_TEMP_RANGE_MAX (120 * 1000)
  30. #define FDO_PWM_MODE_STATIC 1
  31. #define FDO_PWM_MODE_STATIC_RPM 5
  32. enum amdgpu_td {
  33. AMDGPU_TD_AUTO,
  34. AMDGPU_TD_UP,
  35. AMDGPU_TD_DOWN,
  36. };
  37. enum amdgpu_display_watermark {
  38. AMDGPU_DISPLAY_WATERMARK_LOW = 0,
  39. AMDGPU_DISPLAY_WATERMARK_HIGH = 1,
  40. };
  41. enum amdgpu_display_gap
  42. {
  43. AMDGPU_PM_DISPLAY_GAP_VBLANK_OR_WM = 0,
  44. AMDGPU_PM_DISPLAY_GAP_VBLANK = 1,
  45. AMDGPU_PM_DISPLAY_GAP_WATERMARK = 2,
  46. AMDGPU_PM_DISPLAY_GAP_IGNORE = 3,
  47. };
  48. void amdgpu_dpm_print_class_info(u32 class, u32 class2);
  49. void amdgpu_dpm_print_cap_info(u32 caps);
  50. void amdgpu_dpm_print_ps_status(struct amdgpu_device *adev,
  51. struct amdgpu_ps *rps);
  52. u32 amdgpu_dpm_get_vblank_time(struct amdgpu_device *adev);
  53. u32 amdgpu_dpm_get_vrefresh(struct amdgpu_device *adev);
  54. bool amdgpu_is_uvd_state(u32 class, u32 class2);
  55. void amdgpu_calculate_u_and_p(u32 i, u32 r_c, u32 p_b,
  56. u32 *p, u32 *u);
  57. int amdgpu_calculate_at(u32 t, u32 h, u32 fh, u32 fl, u32 *tl, u32 *th);
  58. bool amdgpu_is_internal_thermal_sensor(enum amdgpu_int_thermal_type sensor);
  59. int amdgpu_get_platform_caps(struct amdgpu_device *adev);
  60. int amdgpu_parse_extended_power_table(struct amdgpu_device *adev);
  61. void amdgpu_free_extended_power_table(struct amdgpu_device *adev);
  62. void amdgpu_add_thermal_controller(struct amdgpu_device *adev);
  63. enum amdgpu_pcie_gen amdgpu_get_pcie_gen_support(struct amdgpu_device *adev,
  64. u32 sys_mask,
  65. enum amdgpu_pcie_gen asic_gen,
  66. enum amdgpu_pcie_gen default_gen);
  67. u16 amdgpu_get_pcie_lane_support(struct amdgpu_device *adev,
  68. u16 asic_lanes,
  69. u16 default_lanes);
  70. u8 amdgpu_encode_pci_lane_width(u32 lanes);
  71. #endif