dm_helpers.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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. /**
  26. * This file defines helper functions provided by the Display Manager to
  27. * Display Core.
  28. */
  29. #ifndef __DM_HELPERS__
  30. #define __DM_HELPERS__
  31. #include "dc_types.h"
  32. #include "dc.h"
  33. struct dp_mst_stream_allocation_table;
  34. enum dc_edid_status dm_helpers_parse_edid_caps(
  35. struct dc_context *ctx,
  36. const struct dc_edid *edid,
  37. struct dc_edid_caps *edid_caps);
  38. /*
  39. * Update DP branch info
  40. */
  41. void dm_helpers_dp_update_branch_info(
  42. struct dc_context *ctx,
  43. const struct dc_link *link);
  44. /*
  45. * Writes payload allocation table in immediate downstream device.
  46. */
  47. bool dm_helpers_dp_mst_write_payload_allocation_table(
  48. struct dc_context *ctx,
  49. const struct dc_stream_state *stream,
  50. struct dp_mst_stream_allocation_table *proposed_table,
  51. bool enable);
  52. /*
  53. * Clear payload allocation table before enable MST DP link.
  54. */
  55. void dm_helpers_dp_mst_clear_payload_allocation_table(
  56. struct dc_context *ctx,
  57. const struct dc_link *link);
  58. /*
  59. * Polls for ACT (allocation change trigger) handled and
  60. */
  61. bool dm_helpers_dp_mst_poll_for_allocation_change_trigger(
  62. struct dc_context *ctx,
  63. const struct dc_stream_state *stream);
  64. /*
  65. * Sends ALLOCATE_PAYLOAD message.
  66. */
  67. bool dm_helpers_dp_mst_send_payload_allocation(
  68. struct dc_context *ctx,
  69. const struct dc_stream_state *stream,
  70. bool enable);
  71. bool dm_helpers_dp_mst_start_top_mgr(
  72. struct dc_context *ctx,
  73. const struct dc_link *link,
  74. bool boot);
  75. void dm_helpers_dp_mst_stop_top_mgr(
  76. struct dc_context *ctx,
  77. const struct dc_link *link);
  78. /**
  79. * OS specific aux read callback.
  80. */
  81. bool dm_helpers_dp_read_dpcd(
  82. struct dc_context *ctx,
  83. const struct dc_link *link,
  84. uint32_t address,
  85. uint8_t *data,
  86. uint32_t size);
  87. /**
  88. * OS specific aux write callback.
  89. */
  90. bool dm_helpers_dp_write_dpcd(
  91. struct dc_context *ctx,
  92. const struct dc_link *link,
  93. uint32_t address,
  94. const uint8_t *data,
  95. uint32_t size);
  96. bool dm_helpers_submit_i2c(
  97. struct dc_context *ctx,
  98. const struct dc_link *link,
  99. struct i2c_command *cmd);
  100. bool dm_helpers_is_dp_sink_present(
  101. struct dc_link *link);
  102. enum dc_edid_status dm_helpers_read_local_edid(
  103. struct dc_context *ctx,
  104. struct dc_link *link,
  105. struct dc_sink *sink);
  106. void dm_set_dcn_clocks(
  107. struct dc_context *ctx,
  108. struct dc_clocks *clks);
  109. #endif /* __DM_HELPERS__ */