hw_sequencer.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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 "core_types.h"
  28. #include "timing_generator.h"
  29. enum pipe_gating_control {
  30. PIPE_GATING_CONTROL_DISABLE = 0,
  31. PIPE_GATING_CONTROL_ENABLE,
  32. PIPE_GATING_CONTROL_INIT
  33. };
  34. struct dce_hwseq_wa {
  35. bool blnd_crtc_trigger;
  36. };
  37. struct dce_hwseq {
  38. struct dc_context *ctx;
  39. const struct dce_hwseq_registers *regs;
  40. const struct dce_hwseq_shift *shifts;
  41. const struct dce_hwseq_mask *masks;
  42. struct dce_hwseq_wa wa;
  43. };
  44. struct hw_sequencer_funcs {
  45. void (*init_hw)(struct core_dc *dc);
  46. enum dc_status (*apply_ctx_to_hw)(
  47. struct core_dc *dc, struct validate_context *context);
  48. void (*reset_hw_ctx_wrap)(
  49. struct core_dc *dc, struct validate_context *context);
  50. void (*apply_ctx_for_surface)(
  51. struct core_dc *dc,
  52. struct core_surface *surface,
  53. struct validate_context *context);
  54. void (*set_plane_config)(
  55. const struct core_dc *dc,
  56. struct pipe_ctx *pipe_ctx,
  57. struct resource_context *res_ctx);
  58. void (*program_gamut_remap)(
  59. struct pipe_ctx *pipe_ctx);
  60. void (*update_plane_addr)(
  61. const struct core_dc *dc,
  62. struct pipe_ctx *pipe_ctx);
  63. void (*update_pending_status)(
  64. struct pipe_ctx *pipe_ctx);
  65. bool (*set_input_transfer_func)(
  66. struct pipe_ctx *pipe_ctx,
  67. const struct core_surface *surface);
  68. bool (*set_output_transfer_func)(
  69. struct pipe_ctx *pipe_ctx,
  70. const struct core_stream *stream);
  71. void (*power_down)(struct core_dc *dc);
  72. void (*enable_accelerated_mode)(struct core_dc *dc);
  73. void (*enable_timing_synchronization)(
  74. struct core_dc *dc,
  75. int group_index,
  76. int group_size,
  77. struct pipe_ctx *grouped_pipes[]);
  78. void (*enable_display_pipe_clock_gating)(
  79. struct dc_context *ctx,
  80. bool clock_gating);
  81. bool (*enable_display_power_gating)(
  82. struct core_dc *dc,
  83. uint8_t controller_id,
  84. struct dc_bios *dcb,
  85. enum pipe_gating_control power_gating);
  86. void (*power_down_front_end)(struct core_dc *dc, struct pipe_ctx *pipe);
  87. void (*power_on_front_end)(struct core_dc *dc,
  88. struct pipe_ctx *pipe,
  89. struct validate_context *context);
  90. void (*update_info_frame)(struct pipe_ctx *pipe_ctx);
  91. void (*enable_stream)(struct pipe_ctx *pipe_ctx);
  92. void (*disable_stream)(struct pipe_ctx *pipe_ctx);
  93. void (*unblank_stream)(struct pipe_ctx *pipe_ctx,
  94. struct dc_link_settings *link_settings);
  95. void (*pipe_control_lock)(
  96. struct core_dc *dc,
  97. struct pipe_ctx *pipe,
  98. bool lock);
  99. void (*set_bandwidth)(
  100. struct core_dc *dc,
  101. struct validate_context *context,
  102. bool decrease_allowed);
  103. void (*set_drr)(struct pipe_ctx **pipe_ctx, int num_pipes,
  104. int vmin, int vmax);
  105. void (*get_position)(struct pipe_ctx **pipe_ctx, int num_pipes,
  106. struct crtc_position *position);
  107. void (*set_static_screen_control)(struct pipe_ctx **pipe_ctx,
  108. int num_pipes, const struct dc_static_screen_events *events);
  109. enum dc_status (*prog_pixclk_crtc_otg)(
  110. struct pipe_ctx *pipe_ctx,
  111. struct validate_context *context,
  112. struct core_dc *dc);
  113. void (*setup_stereo)(
  114. struct pipe_ctx *pipe_ctx,
  115. struct core_dc *dc);
  116. };
  117. void color_space_to_black_color(
  118. const struct core_dc *dc,
  119. enum dc_color_space colorspace,
  120. struct tg_color *black_color);
  121. bool hwss_wait_for_blank_complete(
  122. struct timing_generator *tg);
  123. #endif /* __DC_HW_SEQUENCER_H__ */