hw_sequencer.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. /*
  2. * Copyright 2015 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 __DC_HW_SEQUENCER_H__
  26. #define __DC_HW_SEQUENCER_H__
  27. #include "dc_types.h"
  28. #include "clock_source.h"
  29. #include "inc/hw/timing_generator.h"
  30. #include "inc/hw/link_encoder.h"
  31. #include "core_status.h"
  32. enum pipe_gating_control {
  33. PIPE_GATING_CONTROL_DISABLE = 0,
  34. PIPE_GATING_CONTROL_ENABLE,
  35. PIPE_GATING_CONTROL_INIT
  36. };
  37. struct dce_hwseq_wa {
  38. bool blnd_crtc_trigger;
  39. bool DEGVIDCN10_253;
  40. };
  41. struct hwseq_wa_state {
  42. bool DEGVIDCN10_253_applied;
  43. };
  44. struct dce_hwseq {
  45. struct dc_context *ctx;
  46. const struct dce_hwseq_registers *regs;
  47. const struct dce_hwseq_shift *shifts;
  48. const struct dce_hwseq_mask *masks;
  49. struct dce_hwseq_wa wa;
  50. struct hwseq_wa_state wa_state;
  51. };
  52. struct pipe_ctx;
  53. struct dc_state;
  54. struct dchub_init_data;
  55. struct dc_static_screen_events;
  56. struct resource_pool;
  57. struct resource_context;
  58. struct hw_sequencer_funcs {
  59. void (*init_hw)(struct dc *dc);
  60. enum dc_status (*apply_ctx_to_hw)(
  61. struct dc *dc, struct dc_state *context);
  62. void (*reset_hw_ctx_wrap)(
  63. struct dc *dc, struct dc_state *context);
  64. void (*apply_ctx_for_surface)(
  65. struct dc *dc,
  66. const struct dc_stream_state *stream,
  67. int num_planes,
  68. struct dc_state *context);
  69. void (*set_plane_config)(
  70. const struct dc *dc,
  71. struct pipe_ctx *pipe_ctx,
  72. struct resource_context *res_ctx);
  73. void (*program_gamut_remap)(
  74. struct pipe_ctx *pipe_ctx);
  75. void (*program_csc_matrix)(
  76. struct pipe_ctx *pipe_ctx,
  77. enum dc_color_space colorspace,
  78. uint16_t *matrix);
  79. void (*update_plane_addr)(
  80. const struct dc *dc,
  81. struct pipe_ctx *pipe_ctx);
  82. void (*update_dchub)(
  83. struct dce_hwseq *hws,
  84. struct dchub_init_data *dh_data);
  85. void (*update_pending_status)(
  86. struct pipe_ctx *pipe_ctx);
  87. bool (*set_input_transfer_func)(
  88. struct pipe_ctx *pipe_ctx,
  89. const struct dc_plane_state *plane_state);
  90. bool (*set_output_transfer_func)(
  91. struct pipe_ctx *pipe_ctx,
  92. const struct dc_stream_state *stream);
  93. void (*power_down)(struct dc *dc);
  94. void (*enable_accelerated_mode)(struct dc *dc);
  95. void (*enable_timing_synchronization)(
  96. struct dc *dc,
  97. int group_index,
  98. int group_size,
  99. struct pipe_ctx *grouped_pipes[]);
  100. void (*enable_per_frame_crtc_position_reset)(
  101. struct dc *dc,
  102. int group_size,
  103. struct pipe_ctx *grouped_pipes[]);
  104. void (*enable_display_pipe_clock_gating)(
  105. struct dc_context *ctx,
  106. bool clock_gating);
  107. bool (*enable_display_power_gating)(
  108. struct dc *dc,
  109. uint8_t controller_id,
  110. struct dc_bios *dcb,
  111. enum pipe_gating_control power_gating);
  112. void (*disable_plane)(struct dc *dc, struct pipe_ctx *pipe_ctx);
  113. void (*enable_plane)(struct dc *dc,
  114. struct pipe_ctx *pipe,
  115. struct dc_state *context);
  116. void (*update_info_frame)(struct pipe_ctx *pipe_ctx);
  117. void (*enable_stream)(struct pipe_ctx *pipe_ctx);
  118. void (*disable_stream)(struct pipe_ctx *pipe_ctx,
  119. int option);
  120. void (*unblank_stream)(struct pipe_ctx *pipe_ctx,
  121. struct dc_link_settings *link_settings);
  122. void (*pipe_control_lock)(
  123. struct dc *dc,
  124. struct pipe_ctx *pipe,
  125. bool lock);
  126. void (*set_bandwidth)(
  127. struct dc *dc,
  128. struct dc_state *context,
  129. bool decrease_allowed);
  130. void (*set_drr)(struct pipe_ctx **pipe_ctx, int num_pipes,
  131. int vmin, int vmax);
  132. void (*get_position)(struct pipe_ctx **pipe_ctx, int num_pipes,
  133. struct crtc_position *position);
  134. void (*set_static_screen_control)(struct pipe_ctx **pipe_ctx,
  135. int num_pipes, const struct dc_static_screen_events *events);
  136. enum dc_status (*prog_pixclk_crtc_otg)(
  137. struct pipe_ctx *pipe_ctx,
  138. struct dc_state *context,
  139. struct dc *dc);
  140. void (*setup_stereo)(
  141. struct pipe_ctx *pipe_ctx,
  142. struct dc *dc);
  143. void (*set_avmute)(struct pipe_ctx *pipe_ctx, bool enable);
  144. void (*log_hw_state)(struct dc *dc);
  145. void (*wait_for_mpcc_disconnect)(struct dc *dc,
  146. struct resource_pool *res_pool,
  147. struct pipe_ctx *pipe_ctx);
  148. void (*ready_shared_resources)(struct dc *dc, struct dc_state *context);
  149. void (*optimize_shared_resources)(struct dc *dc);
  150. void (*pplib_apply_display_requirements)(
  151. struct dc *dc,
  152. struct dc_state *context);
  153. void (*edp_power_control)(
  154. struct dc_link *link,
  155. bool enable);
  156. void (*edp_backlight_control)(
  157. struct dc_link *link,
  158. bool enable);
  159. };
  160. void color_space_to_black_color(
  161. const struct dc *dc,
  162. enum dc_color_space colorspace,
  163. struct tg_color *black_color);
  164. bool hwss_wait_for_blank_complete(
  165. struct timing_generator *tg);
  166. #endif /* __DC_HW_SEQUENCER_H__ */