hw_sequencer.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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_SURFACE = 1 << 3,
  40. PIPE_LOCK_CONTROL_MODE = 1 << 4
  41. };
  42. struct dce_hwseq;
  43. struct hw_sequencer_funcs {
  44. void (*init_hw)(struct core_dc *dc);
  45. enum dc_status (*apply_ctx_to_hw)(
  46. struct core_dc *dc, struct validate_context *context);
  47. void (*reset_hw_ctx_wrap)(
  48. struct core_dc *dc, struct validate_context *context);
  49. void (*prepare_pipe_for_context)(
  50. struct core_dc *dc,
  51. struct pipe_ctx *pipe_ctx,
  52. struct validate_context *context);
  53. void (*apply_ctx_for_surface)(
  54. struct core_dc *dc,
  55. struct core_surface *surface,
  56. struct validate_context *context);
  57. void (*set_plane_config)(
  58. const struct core_dc *dc,
  59. struct pipe_ctx *pipe_ctx,
  60. struct resource_context *res_ctx);
  61. void (*update_plane_addr)(
  62. const struct core_dc *dc,
  63. struct pipe_ctx *pipe_ctx);
  64. void (*update_pending_status)(
  65. struct pipe_ctx *pipe_ctx);
  66. bool (*set_gamma_correction)(
  67. struct input_pixel_processor *ipp,
  68. struct output_pixel_processor *opp,
  69. const struct core_gamma *ramp,
  70. const struct core_surface *surface);
  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. /* backlight control */
  79. void (*encoder_set_lcd_backlight_level)(
  80. struct link_encoder *enc, uint32_t level);
  81. void (*enable_display_pipe_clock_gating)(
  82. struct dc_context *ctx,
  83. bool clock_gating);
  84. bool (*enable_display_power_gating)(
  85. struct core_dc *dc,
  86. uint8_t controller_id,
  87. struct dc_bios *dcb,
  88. enum pipe_gating_control power_gating);
  89. void (*power_down_front_end)(struct core_dc *dc, struct pipe_ctx *pipe);
  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 dce_hwseq *hwseq,
  97. unsigned int blnd_inst,
  98. enum pipe_lock_control control_mask,
  99. bool lock);
  100. void (*set_displaymarks)(
  101. const struct core_dc *dc,
  102. struct validate_context *context);
  103. void (*increase_watermarks_for_pipe)(struct core_dc *dc,
  104. struct pipe_ctx *pipe_ctx,
  105. struct validate_context *context);
  106. void (*set_bandwidth)(struct core_dc *dc);
  107. void (*set_drr)(struct pipe_ctx **pipe_ctx, int num_pipes,
  108. int vmin, int vmax);
  109. void (*set_static_screen_control)(struct pipe_ctx **pipe_ctx,
  110. int num_pipes, int value);
  111. enum dc_status (*prog_pixclk_crtc_otg)(
  112. struct pipe_ctx *pipe_ctx,
  113. struct validate_context *context,
  114. struct core_dc *dc);
  115. };
  116. void color_space_to_black_color(
  117. const struct core_dc *dc,
  118. enum dc_color_space colorspace,
  119. struct tg_color *black_color);
  120. #endif /* __DC_HW_SEQUENCER_H__ */