display_clock_interface.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 "dm_services_types.h"
  28. #include "hw_sequencer_types.h"
  29. #include "grph_object_defs.h"
  30. #include "signal_types.h"
  31. /* Structure containing all state-dependent clocks
  32. * (dependent on "enum clocks_state") */
  33. struct state_dependent_clocks {
  34. uint32_t display_clk_khz;
  35. uint32_t pixel_clk_khz;
  36. };
  37. struct display_clock {
  38. struct dc_context *ctx;
  39. const struct display_clock_funcs *funcs;
  40. int min_display_clk_threshold_khz;
  41. enum dm_pp_clocks_state max_clks_state;
  42. enum dm_pp_clocks_state cur_min_clks_state;
  43. };
  44. struct display_clock_funcs {
  45. void (*destroy)(struct display_clock **to_destroy);
  46. void (*set_clock)(struct display_clock *disp_clk,
  47. uint32_t requested_clock_khz);
  48. enum dm_pp_clocks_state (*get_required_clocks_state)(
  49. struct display_clock *disp_clk,
  50. struct state_dependent_clocks *req_clocks);
  51. bool (*set_min_clocks_state)(struct display_clock *disp_clk,
  52. enum dm_pp_clocks_state dm_pp_clocks_state);
  53. uint32_t (*get_dp_ref_clk_frequency)(struct display_clock *disp_clk);
  54. };
  55. void dal_display_clock_destroy(struct display_clock **to_destroy);
  56. #endif /* __DISPLAY_CLOCK_INTERFACE_H__ */