Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 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 | |
| 26 | #ifndef __DC_HW_SEQUENCER_H__ |
| 27 | #define __DC_HW_SEQUENCER_H__ |
Bhawanpreet Lakha | fb3466a | 2017-08-01 15:00:25 -0400 | [diff] [blame] | 28 | #include "dc_types.h" |
| 29 | #include "clock_source.h" |
| 30 | #include "inc/hw/timing_generator.h" |
Yue Hin Lau | b51adc77e | 2017-12-04 16:58:11 -0500 | [diff] [blame] | 31 | #include "inc/hw/opp.h" |
Andrew Jiang | 8740196 | 2017-09-25 18:03:14 -0400 | [diff] [blame] | 32 | #include "inc/hw/link_encoder.h" |
Bhawanpreet Lakha | fb3466a | 2017-08-01 15:00:25 -0400 | [diff] [blame] | 33 | #include "core_status.h" |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 34 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 35 | enum pipe_gating_control { |
| 36 | PIPE_GATING_CONTROL_DISABLE = 0, |
| 37 | PIPE_GATING_CONTROL_ENABLE, |
| 38 | PIPE_GATING_CONTROL_INIT |
| 39 | }; |
| 40 | |
Yongqiang Sun | d6001ae | 2019-01-25 14:40:14 -0500 | [diff] [blame] | 41 | enum vline_select { |
| 42 | VLINE0, |
| 43 | VLINE1 |
| 44 | }; |
| 45 | |
Charlene Liu | f082811 | 2017-02-28 15:23:38 -0500 | [diff] [blame] | 46 | struct dce_hwseq_wa { |
| 47 | bool blnd_crtc_trigger; |
Yongqiang Sun | 7f914a6 | 2017-11-06 14:40:31 -0500 | [diff] [blame] | 48 | bool DEGVIDCN10_253; |
Yongqiang Sun | 5cc2687 | 2017-11-15 16:21:34 -0500 | [diff] [blame] | 49 | bool false_optc_underflow; |
Dmytro Laktyushkin | 7144d3c | 2018-06-05 13:14:13 -0400 | [diff] [blame] | 50 | bool DEGVIDCN10_254; |
Bhawanpreet Lakha | aa91916 | 2019-07-26 17:16:47 -0400 | [diff] [blame] | 51 | bool DEGVIDCN21; |
Yongqiang Sun | 7f914a6 | 2017-11-06 14:40:31 -0500 | [diff] [blame] | 52 | }; |
| 53 | |
| 54 | struct hwseq_wa_state { |
| 55 | bool DEGVIDCN10_253_applied; |
Charlene Liu | f082811 | 2017-02-28 15:23:38 -0500 | [diff] [blame] | 56 | }; |
| 57 | |
| 58 | struct dce_hwseq { |
| 59 | struct dc_context *ctx; |
| 60 | const struct dce_hwseq_registers *regs; |
| 61 | const struct dce_hwseq_shift *shifts; |
| 62 | const struct dce_hwseq_mask *masks; |
| 63 | struct dce_hwseq_wa wa; |
Yongqiang Sun | 7f914a6 | 2017-11-06 14:40:31 -0500 | [diff] [blame] | 64 | struct hwseq_wa_state wa_state; |
Charlene Liu | f082811 | 2017-02-28 15:23:38 -0500 | [diff] [blame] | 65 | }; |
| 66 | |
Bhawanpreet Lakha | fb3466a | 2017-08-01 15:00:25 -0400 | [diff] [blame] | 67 | struct pipe_ctx; |
Jerry Zuo | 608ac7b | 2017-08-25 16:16:10 -0400 | [diff] [blame] | 68 | struct dc_state; |
Harry Wentland | 7ed4e63 | 2019-02-22 16:52:08 -0500 | [diff] [blame] | 69 | #if defined(CONFIG_DRM_AMD_DC_DCN2_0) |
| 70 | struct dc_stream_status; |
| 71 | struct dc_writeback_info; |
| 72 | #endif |
Bhawanpreet Lakha | fb3466a | 2017-08-01 15:00:25 -0400 | [diff] [blame] | 73 | struct dchub_init_data; |
| 74 | struct dc_static_screen_events; |
| 75 | struct resource_pool; |
| 76 | struct resource_context; |
Eric Bernstein | 3158223 | 2018-04-09 17:19:27 -0400 | [diff] [blame] | 77 | struct stream_resource; |
Harry Wentland | 7ed4e63 | 2019-02-22 16:52:08 -0500 | [diff] [blame] | 78 | #ifdef CONFIG_DRM_AMD_DC_DCN2_0 |
Dmytro Laktyushkin | bda9afd | 2019-05-22 18:05:41 -0400 | [diff] [blame] | 79 | struct dc_phy_addr_space_config; |
| 80 | struct dc_virtual_addr_space_config; |
Harry Wentland | 7ed4e63 | 2019-02-22 16:52:08 -0500 | [diff] [blame] | 81 | #endif |
Martin Leung | 8a31820 | 2019-07-09 15:15:17 -0400 | [diff] [blame] | 82 | struct hubp; |
| 83 | struct dpp; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 84 | |
| 85 | struct hw_sequencer_funcs { |
| 86 | |
Gary Kattan | 240d09d | 2019-01-25 15:04:14 -0800 | [diff] [blame] | 87 | void (*disable_stream_gating)(struct dc *dc, struct pipe_ctx *pipe_ctx); |
| 88 | |
| 89 | void (*enable_stream_gating)(struct dc *dc, struct pipe_ctx *pipe_ctx); |
| 90 | |
Bhawanpreet Lakha | fb3466a | 2017-08-01 15:00:25 -0400 | [diff] [blame] | 91 | void (*init_hw)(struct dc *dc); |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 92 | |
Anthony Koo | fb55546 | 2019-01-20 01:23:07 -0500 | [diff] [blame] | 93 | void (*init_pipes)(struct dc *dc, struct dc_state *context); |
| 94 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 95 | enum dc_status (*apply_ctx_to_hw)( |
Jerry Zuo | 608ac7b | 2017-08-25 16:16:10 -0400 | [diff] [blame] | 96 | struct dc *dc, struct dc_state *context); |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 97 | |
| 98 | void (*reset_hw_ctx_wrap)( |
Jerry Zuo | 608ac7b | 2017-08-25 16:16:10 -0400 | [diff] [blame] | 99 | struct dc *dc, struct dc_state *context); |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 100 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 101 | void (*apply_ctx_for_surface)( |
Bhawanpreet Lakha | fb3466a | 2017-08-01 15:00:25 -0400 | [diff] [blame] | 102 | struct dc *dc, |
Eric Yang | 3e9ad616 | 2017-08-03 00:22:25 -0400 | [diff] [blame] | 103 | const struct dc_stream_state *stream, |
| 104 | int num_planes, |
Jerry Zuo | 608ac7b | 2017-08-25 16:16:10 -0400 | [diff] [blame] | 105 | struct dc_state *context); |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 106 | |
Zeyu Fan | 1bf56e6 | 2017-06-02 17:25:49 -0400 | [diff] [blame] | 107 | void (*program_gamut_remap)( |
| 108 | struct pipe_ctx *pipe_ctx); |
| 109 | |
Eric Bernstein | 8e35761 | 2018-04-09 15:47:42 -0400 | [diff] [blame] | 110 | void (*program_output_csc)(struct dc *dc, |
| 111 | struct pipe_ctx *pipe_ctx, |
| 112 | enum dc_color_space colorspace, |
| 113 | uint16_t *matrix, |
| 114 | int opp_id); |
| 115 | |
Harry Wentland | 7ed4e63 | 2019-02-22 16:52:08 -0500 | [diff] [blame] | 116 | #if defined(CONFIG_DRM_AMD_DC_DCN2_0) |
Dmytro Laktyushkin | b6e881c | 2019-09-13 18:00:28 -0500 | [diff] [blame] | 117 | void (*program_front_end_for_ctx)( |
| 118 | struct dc *dc, |
| 119 | struct dc_state *context); |
Harry Wentland | 7ed4e63 | 2019-02-22 16:52:08 -0500 | [diff] [blame] | 120 | void (*program_triplebuffer)( |
| 121 | const struct dc *dc, |
| 122 | struct pipe_ctx *pipe_ctx, |
| 123 | bool enableTripleBuffer); |
| 124 | void (*set_flip_control_gsl)( |
| 125 | struct pipe_ctx *pipe_ctx, |
| 126 | bool flip_immediate); |
| 127 | #endif |
| 128 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 129 | void (*update_plane_addr)( |
Bhawanpreet Lakha | fb3466a | 2017-08-01 15:00:25 -0400 | [diff] [blame] | 130 | const struct dc *dc, |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 131 | struct pipe_ctx *pipe_ctx); |
| 132 | |
Eric Bernstein | c2437b1 | 2018-05-16 16:19:50 -0400 | [diff] [blame] | 133 | void (*plane_atomic_disconnect)( |
| 134 | struct dc *dc, |
| 135 | struct pipe_ctx *pipe_ctx); |
| 136 | |
Zeyu Fan | 08b1688 | 2017-07-23 18:30:15 -0400 | [diff] [blame] | 137 | void (*update_dchub)( |
| 138 | struct dce_hwseq *hws, |
| 139 | struct dchub_init_data *dh_data); |
| 140 | |
Harry Wentland | 7ed4e63 | 2019-02-22 16:52:08 -0500 | [diff] [blame] | 141 | #ifdef CONFIG_DRM_AMD_DC_DCN2_0 |
Dmytro Laktyushkin | bda9afd | 2019-05-22 18:05:41 -0400 | [diff] [blame] | 142 | int (*init_sys_ctx)( |
| 143 | struct dce_hwseq *hws, |
| 144 | struct dc *dc, |
| 145 | struct dc_phy_addr_space_config *pa_config); |
| 146 | void (*init_vm_ctx)( |
| 147 | struct dce_hwseq *hws, |
| 148 | struct dc *dc, |
| 149 | struct dc_virtual_addr_space_config *va_config, |
| 150 | int vmid); |
Harry Wentland | 7ed4e63 | 2019-02-22 16:52:08 -0500 | [diff] [blame] | 151 | #endif |
Eric Bernstein | c2437b1 | 2018-05-16 16:19:50 -0400 | [diff] [blame] | 152 | void (*update_mpcc)( |
| 153 | struct dc *dc, |
| 154 | struct pipe_ctx *pipe_ctx); |
| 155 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 156 | void (*update_pending_status)( |
| 157 | struct pipe_ctx *pipe_ctx); |
| 158 | |
Anthony Koo | 90e508b | 2016-12-15 12:09:46 -0500 | [diff] [blame] | 159 | bool (*set_input_transfer_func)( |
Anthony Koo | fb735a9 | 2016-12-13 13:59:41 -0500 | [diff] [blame] | 160 | struct pipe_ctx *pipe_ctx, |
Harry Wentland | 3be5262e | 2017-07-27 09:55:38 -0400 | [diff] [blame] | 161 | const struct dc_plane_state *plane_state); |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 162 | |
Anthony Koo | 90e508b | 2016-12-15 12:09:46 -0500 | [diff] [blame] | 163 | bool (*set_output_transfer_func)( |
| 164 | struct pipe_ctx *pipe_ctx, |
Harry Wentland | 0971c40 | 2017-07-27 09:33:33 -0400 | [diff] [blame] | 165 | const struct dc_stream_state *stream); |
Anthony Koo | 90e508b | 2016-12-15 12:09:46 -0500 | [diff] [blame] | 166 | |
Bhawanpreet Lakha | fb3466a | 2017-08-01 15:00:25 -0400 | [diff] [blame] | 167 | void (*power_down)(struct dc *dc); |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 168 | |
Yongqiang Sun | 2529202 | 2017-12-19 11:51:40 -0500 | [diff] [blame] | 169 | void (*enable_accelerated_mode)(struct dc *dc, struct dc_state *context); |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 170 | |
| 171 | void (*enable_timing_synchronization)( |
Bhawanpreet Lakha | fb3466a | 2017-08-01 15:00:25 -0400 | [diff] [blame] | 172 | struct dc *dc, |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 173 | int group_index, |
| 174 | int group_size, |
| 175 | struct pipe_ctx *grouped_pipes[]); |
| 176 | |
Mikita Lipski | fa2123d | 2017-10-17 15:29:22 -0400 | [diff] [blame] | 177 | void (*enable_per_frame_crtc_position_reset)( |
| 178 | struct dc *dc, |
| 179 | int group_size, |
| 180 | struct pipe_ctx *grouped_pipes[]); |
| 181 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 182 | void (*enable_display_pipe_clock_gating)( |
| 183 | struct dc_context *ctx, |
| 184 | bool clock_gating); |
| 185 | |
| 186 | bool (*enable_display_power_gating)( |
Bhawanpreet Lakha | fb3466a | 2017-08-01 15:00:25 -0400 | [diff] [blame] | 187 | struct dc *dc, |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 188 | uint8_t controller_id, |
| 189 | struct dc_bios *dcb, |
| 190 | enum pipe_gating_control power_gating); |
| 191 | |
Yongqiang Sun | 7f914a6 | 2017-11-06 14:40:31 -0500 | [diff] [blame] | 192 | void (*disable_plane)(struct dc *dc, struct pipe_ctx *pipe_ctx); |
Yongqiang Sun | 18f7a1e | 2017-03-23 10:34:06 -0400 | [diff] [blame] | 193 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 194 | void (*update_info_frame)(struct pipe_ctx *pipe_ctx); |
| 195 | |
Leo (Hanghong) Ma | 88ccdf1 | 2019-04-16 11:07:22 -0400 | [diff] [blame] | 196 | void (*send_immediate_sdp_message)( |
| 197 | struct pipe_ctx *pipe_ctx, |
| 198 | const uint8_t *custom_sdp_message, |
| 199 | unsigned int sdp_message_size); |
| 200 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 201 | void (*enable_stream)(struct pipe_ctx *pipe_ctx); |
| 202 | |
Su Sung Chung | 5743040 | 2019-07-25 14:43:55 -0400 | [diff] [blame] | 203 | void (*disable_stream)(struct pipe_ctx *pipe_ctx); |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 204 | |
| 205 | void (*unblank_stream)(struct pipe_ctx *pipe_ctx, |
| 206 | struct dc_link_settings *link_settings); |
| 207 | |
Charlene Liu | 41b4974 | 2018-01-11 15:31:26 -0500 | [diff] [blame] | 208 | void (*blank_stream)(struct pipe_ctx *pipe_ctx); |
Anthony Koo | 1a05873 | 2018-05-10 14:21:47 -0400 | [diff] [blame] | 209 | |
| 210 | void (*enable_audio_stream)(struct pipe_ctx *pipe_ctx); |
| 211 | |
Su Sung Chung | 5743040 | 2019-07-25 14:43:55 -0400 | [diff] [blame] | 212 | void (*disable_audio_stream)(struct pipe_ctx *pipe_ctx); |
Anthony Koo | 1a05873 | 2018-05-10 14:21:47 -0400 | [diff] [blame] | 213 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 214 | void (*pipe_control_lock)( |
Bhawanpreet Lakha | fb3466a | 2017-08-01 15:00:25 -0400 | [diff] [blame] | 215 | struct dc *dc, |
Charlene Liu | f082811 | 2017-02-28 15:23:38 -0500 | [diff] [blame] | 216 | struct pipe_ctx *pipe, |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 217 | bool lock); |
Wenjing Liu | 6c5be4a | 2019-03-05 19:28:10 -0500 | [diff] [blame] | 218 | |
Wenjing Liu | c23f95a | 2019-03-05 19:28:10 -0500 | [diff] [blame] | 219 | void (*pipe_control_lock_global)( |
| 220 | struct dc *dc, |
| 221 | struct pipe_ctx *pipe, |
| 222 | bool lock); |
Eric Bernstein | 3158223 | 2018-04-09 17:19:27 -0400 | [diff] [blame] | 223 | void (*blank_pixel_data)( |
| 224 | struct dc *dc, |
Eric Bernstein | ea4a202 | 2018-05-01 15:21:42 -0400 | [diff] [blame] | 225 | struct pipe_ctx *pipe_ctx, |
Eric Bernstein | 3158223 | 2018-04-09 17:19:27 -0400 | [diff] [blame] | 226 | bool blank); |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 227 | |
Dmytro Laktyushkin | 9566b67 | 2018-09-18 15:00:49 -0400 | [diff] [blame] | 228 | void (*prepare_bandwidth)( |
Bhawanpreet Lakha | fb3466a | 2017-08-01 15:00:25 -0400 | [diff] [blame] | 229 | struct dc *dc, |
Dmytro Laktyushkin | 9566b67 | 2018-09-18 15:00:49 -0400 | [diff] [blame] | 230 | struct dc_state *context); |
| 231 | void (*optimize_bandwidth)( |
| 232 | struct dc *dc, |
| 233 | struct dc_state *context); |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 234 | |
Joseph Gravenor | 9ae1b27 | 2019-09-04 12:43:05 -0400 | [diff] [blame] | 235 | void (*exit_optimized_pwr_state)( |
| 236 | const struct dc *dc, |
| 237 | struct dc_state *context); |
| 238 | void (*optimize_pwr_state)( |
| 239 | const struct dc *dc, |
| 240 | struct dc_state *context); |
| 241 | |
Harry Wentland | 7ed4e63 | 2019-02-22 16:52:08 -0500 | [diff] [blame] | 242 | #if defined(CONFIG_DRM_AMD_DC_DCN2_0) |
| 243 | bool (*update_bandwidth)( |
| 244 | struct dc *dc, |
| 245 | struct dc_state *context); |
Julian Parkin | f591344 | 2019-07-03 13:59:26 -0400 | [diff] [blame] | 246 | void (*program_dmdata_engine)(struct pipe_ctx *pipe_ctx); |
Harry Wentland | 7ed4e63 | 2019-02-22 16:52:08 -0500 | [diff] [blame] | 247 | bool (*dmdata_status_done)(struct pipe_ctx *pipe_ctx); |
| 248 | #endif |
| 249 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 250 | void (*set_drr)(struct pipe_ctx **pipe_ctx, int num_pipes, |
Bayan Zabihiyan | 470e2ca | 2019-08-08 11:08:52 -0400 | [diff] [blame] | 251 | unsigned int vmin, unsigned int vmax, |
| 252 | unsigned int vmid, unsigned int vmid_frame_number); |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 253 | |
Eric Cook | 72ada5f | 2017-04-18 15:24:50 -0400 | [diff] [blame] | 254 | void (*get_position)(struct pipe_ctx **pipe_ctx, int num_pipes, |
| 255 | struct crtc_position *position); |
| 256 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 257 | void (*set_static_screen_control)(struct pipe_ctx **pipe_ctx, |
Sylvia Tsai | 94267b3 | 2017-04-21 15:29:55 -0400 | [diff] [blame] | 258 | int num_pipes, const struct dc_static_screen_events *events); |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 259 | |
Eric Bernstein | 3158223 | 2018-04-09 17:19:27 -0400 | [diff] [blame] | 260 | enum dc_status (*enable_stream_timing)( |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 261 | struct pipe_ctx *pipe_ctx, |
Jerry Zuo | 608ac7b | 2017-08-25 16:16:10 -0400 | [diff] [blame] | 262 | struct dc_state *context, |
Bhawanpreet Lakha | fb3466a | 2017-08-01 15:00:25 -0400 | [diff] [blame] | 263 | struct dc *dc); |
Vitaly Prosyak | 9edba55 | 2017-06-07 12:23:59 -0500 | [diff] [blame] | 264 | |
| 265 | void (*setup_stereo)( |
| 266 | struct pipe_ctx *pipe_ctx, |
Bhawanpreet Lakha | fb3466a | 2017-08-01 15:00:25 -0400 | [diff] [blame] | 267 | struct dc *dc); |
Charlene Liu | 15e1733 | 2017-07-17 16:04:02 -0400 | [diff] [blame] | 268 | |
| 269 | void (*set_avmute)(struct pipe_ctx *pipe_ctx, bool enable); |
Tony Cheng | 6d244be | 2017-07-20 00:12:20 -0400 | [diff] [blame] | 270 | |
Nicholas Kazlauskas | 46659a8 | 2018-08-15 12:00:23 -0400 | [diff] [blame] | 271 | void (*log_hw_state)(struct dc *dc, |
| 272 | struct dc_log_buffer_ctx *log_ctx); |
Jun Lei | dd73043 | 2018-08-08 11:53:39 -0400 | [diff] [blame] | 273 | void (*get_hw_state)(struct dc *dc, char *pBuf, unsigned int bufSize, unsigned int mask); |
Jun Lei | eb6b29d | 2018-10-23 12:12:50 -0400 | [diff] [blame] | 274 | void (*clear_status_bits)(struct dc *dc, unsigned int mask); |
Eric Yang | 8748068 | 2017-07-23 15:18:57 -0400 | [diff] [blame] | 275 | |
Bhawanpreet Lakha | fb3466a | 2017-08-01 15:00:25 -0400 | [diff] [blame] | 276 | void (*wait_for_mpcc_disconnect)(struct dc *dc, |
Eric Yang | 6be425f | 2017-07-24 10:47:02 -0400 | [diff] [blame] | 277 | struct resource_pool *res_pool, |
| 278 | struct pipe_ctx *pipe_ctx); |
Hersen Wu | 41f97c0 | 2017-08-24 17:40:00 -0400 | [diff] [blame] | 279 | |
Andrew Jiang | 8740196 | 2017-09-25 18:03:14 -0400 | [diff] [blame] | 280 | void (*edp_power_control)( |
Andrew Jiang | 069d418 | 2017-09-26 19:45:43 -0400 | [diff] [blame] | 281 | struct dc_link *link, |
Andrew Jiang | 8740196 | 2017-09-25 18:03:14 -0400 | [diff] [blame] | 282 | bool enable); |
| 283 | void (*edp_backlight_control)( |
Yue Hin Lau | 5eefbc4 | 2017-09-15 17:42:20 -0400 | [diff] [blame] | 284 | struct dc_link *link, |
| 285 | bool enable); |
Yongqiang Sun | 904623e | 2017-11-24 16:31:03 -0500 | [diff] [blame] | 286 | void (*edp_wait_for_hpd_ready)(struct dc_link *link, bool power_up); |
Hersen Wu | 631aaa0 | 2017-10-31 15:55:15 -0400 | [diff] [blame] | 287 | |
Eric Yang | 33fd17d9 | 2018-01-18 19:07:54 -0500 | [diff] [blame] | 288 | void (*set_cursor_position)(struct pipe_ctx *pipe); |
| 289 | void (*set_cursor_attribute)(struct pipe_ctx *pipe); |
Krunoslav Kovac | 6d92b5c | 2018-06-27 18:23:37 -0400 | [diff] [blame] | 290 | void (*set_cursor_sdr_white_level)(struct pipe_ctx *pipe); |
Eric Bernstein | 8e35761 | 2018-04-09 15:47:42 -0400 | [diff] [blame] | 291 | |
Yongqiang Sun | d6001ae | 2019-01-25 14:40:14 -0500 | [diff] [blame] | 292 | void (*setup_periodic_interrupt)(struct pipe_ctx *pipe_ctx, enum vline_select vline); |
| 293 | void (*setup_vupdate_interrupt)(struct pipe_ctx *pipe_ctx); |
Thomas Lim | 1a7d296 | 2019-04-29 16:05:42 -0400 | [diff] [blame] | 294 | bool (*did_underflow_occur)(struct dc *dc, struct pipe_ctx *pipe_ctx); |
Yongqiang Sun | d6001ae | 2019-01-25 14:40:14 -0500 | [diff] [blame] | 295 | |
Martin Leung | 8a31820 | 2019-07-09 15:15:17 -0400 | [diff] [blame] | 296 | void (*init_blank)(struct dc *dc, struct timing_generator *tg); |
| 297 | void (*disable_vga)(struct dce_hwseq *hws); |
| 298 | void (*bios_golden_init)(struct dc *dc); |
| 299 | void (*plane_atomic_power_down)(struct dc *dc, |
| 300 | struct dpp *dpp, |
| 301 | struct hubp *hubp); |
| 302 | |
| 303 | void (*plane_atomic_disable)( |
| 304 | struct dc *dc, struct pipe_ctx *pipe_ctx); |
| 305 | |
| 306 | void (*enable_power_gating_plane)( |
| 307 | struct dce_hwseq *hws, |
| 308 | bool enable); |
| 309 | |
| 310 | void (*dpp_pg_control)( |
| 311 | struct dce_hwseq *hws, |
| 312 | unsigned int dpp_inst, |
| 313 | bool power_on); |
| 314 | |
| 315 | void (*hubp_pg_control)( |
| 316 | struct dce_hwseq *hws, |
| 317 | unsigned int hubp_inst, |
| 318 | bool power_on); |
| 319 | |
| 320 | void (*dsc_pg_control)( |
| 321 | struct dce_hwseq *hws, |
| 322 | unsigned int dsc_inst, |
| 323 | bool power_on); |
| 324 | |
| 325 | |
Harry Wentland | 7ed4e63 | 2019-02-22 16:52:08 -0500 | [diff] [blame] | 326 | #if defined(CONFIG_DRM_AMD_DC_DCN2_0) |
| 327 | void (*update_odm)(struct dc *dc, struct dc_state *context, struct pipe_ctx *pipe_ctx); |
| 328 | void (*program_all_writeback_pipes_in_tree)( |
| 329 | struct dc *dc, |
| 330 | const struct dc_stream_state *stream, |
| 331 | struct dc_state *context); |
| 332 | void (*update_writeback)(struct dc *dc, |
| 333 | const struct dc_stream_status *stream_status, |
Julian Parkin | edb922b0 | 2019-08-29 17:06:05 -0400 | [diff] [blame^] | 334 | struct dc_writeback_info *wb_info, |
| 335 | struct dc_state *context); |
Harry Wentland | 7ed4e63 | 2019-02-22 16:52:08 -0500 | [diff] [blame] | 336 | void (*enable_writeback)(struct dc *dc, |
| 337 | const struct dc_stream_status *stream_status, |
Julian Parkin | edb922b0 | 2019-08-29 17:06:05 -0400 | [diff] [blame^] | 338 | struct dc_writeback_info *wb_info, |
| 339 | struct dc_state *context); |
Harry Wentland | 7ed4e63 | 2019-02-22 16:52:08 -0500 | [diff] [blame] | 340 | void (*disable_writeback)(struct dc *dc, |
| 341 | unsigned int dwb_pipe_inst); |
| 342 | #endif |
Charlene Liu | 925f566 | 2019-06-27 18:16:21 -0400 | [diff] [blame] | 343 | enum dc_status (*set_clock)(struct dc *dc, |
| 344 | enum dc_clock_type clock_type, |
| 345 | uint32_t clk_khz, |
| 346 | uint32_t stepping); |
| 347 | |
| 348 | void (*get_clock)(struct dc *dc, |
| 349 | enum dc_clock_type clock_type, |
| 350 | struct dc_clock_config *clock_cfg); |
| 351 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 352 | }; |
| 353 | |
| 354 | void color_space_to_black_color( |
Bhawanpreet Lakha | fb3466a | 2017-08-01 15:00:25 -0400 | [diff] [blame] | 355 | const struct dc *dc, |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 356 | enum dc_color_space colorspace, |
| 357 | struct tg_color *black_color); |
| 358 | |
Hersen Wu | 4b5e7d6 | 2017-01-06 16:23:18 -0500 | [diff] [blame] | 359 | bool hwss_wait_for_blank_complete( |
| 360 | struct timing_generator *tg); |
| 361 | |
Vitaly Prosyak | 38cb3e9 | 2017-12-01 11:42:18 -0600 | [diff] [blame] | 362 | const uint16_t *find_color_matrix( |
| 363 | enum dc_color_space color_space, |
| 364 | uint32_t *array_size); |
| 365 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 366 | #endif /* __DC_HW_SEQUENCER_H__ */ |