hw_sequencer.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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 (*update_plane_addr)(
  59. const struct core_dc *dc,
  60. struct pipe_ctx *pipe_ctx);
  61. void (*update_pending_status)(
  62. struct pipe_ctx *pipe_ctx);
  63. bool (*set_input_transfer_func)(
  64. struct pipe_ctx *pipe_ctx,
  65. const struct core_surface *surface);
  66. bool (*set_output_transfer_func)(
  67. struct pipe_ctx *pipe_ctx,
  68. const struct core_surface *surface,
  69. const struct core_stream *stream);
  70. void (*power_down)(struct core_dc *dc);
  71. void (*enable_accelerated_mode)(struct core_dc *dc);
  72. void (*enable_timing_synchronization)(
  73. struct core_dc *dc,
  74. int group_index,
  75. int group_size,
  76. struct pipe_ctx *grouped_pipes[]);
  77. void (*enable_display_pipe_clock_gating)(
  78. struct dc_context *ctx,
  79. bool clock_gating);
  80. bool (*enable_display_power_gating)(
  81. struct core_dc *dc,
  82. uint8_t controller_id,
  83. struct dc_bios *dcb,
  84. enum pipe_gating_control power_gating);
  85. void (*power_down_front_end)(struct core_dc *dc, struct pipe_ctx *pipe);
  86. void (*power_on_front_end)(struct core_dc *dc,
  87. struct pipe_ctx *pipe,
  88. struct validate_context *context);
  89. void (*update_info_frame)(struct pipe_ctx *pipe_ctx);
  90. void (*enable_stream)(struct pipe_ctx *pipe_ctx);
  91. void (*disable_stream)(struct pipe_ctx *pipe_ctx);
  92. void (*unblank_stream)(struct pipe_ctx *pipe_ctx,
  93. struct dc_link_settings *link_settings);
  94. void (*pipe_control_lock)(
  95. struct core_dc *dc,
  96. struct pipe_ctx *pipe,
  97. bool lock);
  98. void (*set_displaymarks)(
  99. const struct core_dc *dc,
  100. struct validate_context *context);
  101. void (*set_bandwidth)(
  102. struct core_dc *dc,
  103. struct validate_context *context,
  104. bool decrease_allowed);
  105. void (*set_drr)(struct pipe_ctx **pipe_ctx, int num_pipes,
  106. int vmin, int vmax);
  107. void (*set_static_screen_control)(struct pipe_ctx **pipe_ctx,
  108. int num_pipes, int value);
  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. };
  114. void color_space_to_black_color(
  115. const struct core_dc *dc,
  116. enum dc_color_space colorspace,
  117. struct tg_color *black_color);
  118. bool hwss_wait_for_blank_complete(
  119. struct timing_generator *tg);
  120. #endif /* __DC_HW_SEQUENCER_H__ */