hw_sequencer.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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. struct gamma_parameters;
  30. enum pipe_gating_control {
  31. PIPE_GATING_CONTROL_DISABLE = 0,
  32. PIPE_GATING_CONTROL_ENABLE,
  33. PIPE_GATING_CONTROL_INIT
  34. };
  35. enum pipe_lock_control {
  36. PIPE_LOCK_CONTROL_GRAPHICS = 1 << 0,
  37. PIPE_LOCK_CONTROL_BLENDER = 1 << 1,
  38. PIPE_LOCK_CONTROL_SCL = 1 << 2,
  39. PIPE_LOCK_CONTROL_MODE = 1 << 3
  40. };
  41. struct dce_hwseq;
  42. struct hw_sequencer_funcs {
  43. void (*init_hw)(struct core_dc *dc);
  44. enum dc_status (*apply_ctx_to_hw)(
  45. struct core_dc *dc, struct validate_context *context);
  46. void (*reset_hw_ctx_wrap)(
  47. struct core_dc *dc, struct validate_context *context);
  48. void (*prepare_pipe_for_context)(
  49. struct core_dc *dc,
  50. struct pipe_ctx *pipe_ctx,
  51. struct validate_context *context);
  52. void (*apply_ctx_for_surface)(
  53. struct core_dc *dc,
  54. struct core_surface *surface,
  55. struct validate_context *context);
  56. void (*set_plane_config)(
  57. const struct core_dc *dc,
  58. struct pipe_ctx *pipe_ctx,
  59. struct resource_context *res_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_surface *surface,
  71. const struct core_stream *stream);
  72. void (*power_down)(struct core_dc *dc);
  73. void (*enable_accelerated_mode)(struct core_dc *dc);
  74. void (*enable_timing_synchronization)(
  75. struct core_dc *dc,
  76. int group_index,
  77. int group_size,
  78. struct pipe_ctx *grouped_pipes[]);
  79. /* backlight control */
  80. void (*encoder_set_lcd_backlight_level)(
  81. struct link_encoder *enc, uint32_t level);
  82. void (*enable_display_pipe_clock_gating)(
  83. struct dc_context *ctx,
  84. bool clock_gating);
  85. bool (*enable_display_power_gating)(
  86. struct core_dc *dc,
  87. uint8_t controller_id,
  88. struct dc_bios *dcb,
  89. enum pipe_gating_control power_gating);
  90. void (*power_down_front_end)(struct core_dc *dc, struct pipe_ctx *pipe);
  91. void (*update_info_frame)(struct pipe_ctx *pipe_ctx);
  92. void (*enable_stream)(struct pipe_ctx *pipe_ctx);
  93. void (*disable_stream)(struct pipe_ctx *pipe_ctx);
  94. void (*unblank_stream)(struct pipe_ctx *pipe_ctx,
  95. struct dc_link_settings *link_settings);
  96. void (*pipe_control_lock)(
  97. struct dce_hwseq *hwseq,
  98. unsigned int blnd_inst,
  99. enum pipe_lock_control control_mask,
  100. bool lock);
  101. void (*set_displaymarks)(
  102. const struct core_dc *dc,
  103. struct validate_context *context);
  104. void (*increase_watermarks_for_pipe)(struct core_dc *dc,
  105. struct pipe_ctx *pipe_ctx,
  106. struct validate_context *context);
  107. void (*set_bandwidth)(struct core_dc *dc);
  108. void (*set_drr)(struct pipe_ctx **pipe_ctx, int num_pipes,
  109. int vmin, int vmax);
  110. void (*set_static_screen_control)(struct pipe_ctx **pipe_ctx,
  111. int num_pipes, int value);
  112. enum dc_status (*prog_pixclk_crtc_otg)(
  113. struct pipe_ctx *pipe_ctx,
  114. struct validate_context *context,
  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. #endif /* __DC_HW_SEQUENCER_H__ */