hw_sequencer.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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_gamma_correction)(
  66. struct pipe_ctx *pipe_ctx,
  67. const struct core_surface *surface);
  68. void (*power_down)(struct core_dc *dc);
  69. void (*enable_accelerated_mode)(struct core_dc *dc);
  70. void (*enable_timing_synchronization)(
  71. struct core_dc *dc,
  72. int group_index,
  73. int group_size,
  74. struct pipe_ctx *grouped_pipes[]);
  75. /* backlight control */
  76. void (*encoder_set_lcd_backlight_level)(
  77. struct link_encoder *enc, uint32_t level);
  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 (*update_info_frame)(struct pipe_ctx *pipe_ctx);
  88. void (*enable_stream)(struct pipe_ctx *pipe_ctx);
  89. void (*disable_stream)(struct pipe_ctx *pipe_ctx);
  90. void (*unblank_stream)(struct pipe_ctx *pipe_ctx,
  91. struct dc_link_settings *link_settings);
  92. void (*pipe_control_lock)(
  93. struct dce_hwseq *hwseq,
  94. unsigned int blnd_inst,
  95. enum pipe_lock_control control_mask,
  96. bool lock);
  97. void (*set_displaymarks)(
  98. const struct core_dc *dc,
  99. struct validate_context *context);
  100. void (*increase_watermarks_for_pipe)(struct core_dc *dc,
  101. struct pipe_ctx *pipe_ctx,
  102. struct validate_context *context);
  103. void (*set_bandwidth)(struct core_dc *dc);
  104. void (*set_drr)(struct pipe_ctx **pipe_ctx, int num_pipes,
  105. int vmin, int vmax);
  106. void (*set_static_screen_control)(struct pipe_ctx **pipe_ctx,
  107. int num_pipes, int value);
  108. enum dc_status (*prog_pixclk_crtc_otg)(
  109. struct pipe_ctx *pipe_ctx,
  110. struct validate_context *context,
  111. struct core_dc *dc);
  112. };
  113. void color_space_to_black_color(
  114. const struct core_dc *dc,
  115. enum dc_color_space colorspace,
  116. struct tg_color *black_color);
  117. #endif /* __DC_HW_SEQUENCER_H__ */