display_clock_interface.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * Copyright 2012-15 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. * Authors: AMD
  23. *
  24. */
  25. #ifndef __DISPLAY_CLOCK_INTERFACE_H__
  26. #define __DISPLAY_CLOCK_INTERFACE_H__
  27. #include "hw_sequencer_types.h"
  28. #include "grph_object_defs.h"
  29. #include "signal_types.h"
  30. /* Enumeration of all clocks states */
  31. enum clocks_state {
  32. CLOCKS_STATE_INVALID = 0,
  33. CLOCKS_STATE_ULTRA_LOW,
  34. CLOCKS_STATE_LOW,
  35. CLOCKS_STATE_NOMINAL,
  36. CLOCKS_STATE_PERFORMANCE,
  37. /* Starting from DCE11, Max 8 level DPM state supported */
  38. CLOCKS_DPM_STATE_LEVEL_INVALID = CLOCKS_STATE_INVALID,
  39. CLOCKS_DPM_STATE_LEVEL_0 = CLOCKS_STATE_ULTRA_LOW,
  40. CLOCKS_DPM_STATE_LEVEL_1 = CLOCKS_STATE_LOW,
  41. CLOCKS_DPM_STATE_LEVEL_2 = CLOCKS_STATE_NOMINAL,
  42. CLOCKS_DPM_STATE_LEVEL_3 = CLOCKS_STATE_PERFORMANCE,
  43. CLOCKS_DPM_STATE_LEVEL_4 = CLOCKS_DPM_STATE_LEVEL_3 + 1,
  44. CLOCKS_DPM_STATE_LEVEL_5 = CLOCKS_DPM_STATE_LEVEL_4 + 1,
  45. CLOCKS_DPM_STATE_LEVEL_6 = CLOCKS_DPM_STATE_LEVEL_5 + 1,
  46. CLOCKS_DPM_STATE_LEVEL_7 = CLOCKS_DPM_STATE_LEVEL_6 + 1,
  47. };
  48. /* Structure containing all state-dependent clocks
  49. * (dependent on "enum clocks_state") */
  50. struct state_dependent_clocks {
  51. uint32_t display_clk_khz;
  52. uint32_t pixel_clk_khz;
  53. };
  54. struct display_clock;
  55. struct display_clock *dal_display_clock_dce112_create(
  56. struct dc_context *ctx);
  57. struct display_clock *dal_display_clock_dce110_create(
  58. struct dc_context *ctx);
  59. struct display_clock *dal_display_clock_dce80_create(
  60. struct dc_context *ctx);
  61. void dal_display_clock_destroy(struct display_clock **to_destroy);
  62. void dal_display_clock_set_clock(
  63. struct display_clock *disp_clk,
  64. uint32_t requested_clock_khz);
  65. bool dal_display_clock_get_min_clocks_state(
  66. struct display_clock *disp_clk,
  67. enum clocks_state *clocks_state);
  68. bool dal_display_clock_get_required_clocks_state(
  69. struct display_clock *disp_clk,
  70. struct state_dependent_clocks *req_clocks,
  71. enum clocks_state *clocks_state);
  72. bool dal_display_clock_set_min_clocks_state(
  73. struct display_clock *disp_clk,
  74. enum clocks_state clocks_state);
  75. uint32_t dal_display_clock_get_dp_ref_clk_frequency(
  76. struct display_clock *disp_clk);
  77. void dal_display_clock_store_max_clocks_state(
  78. struct display_clock *disp_clk,
  79. enum clocks_state max_clocks_state);
  80. #endif /* __DISPLAY_CLOCK_INTERFACE_H__ */