Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2012-14 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_INTERFACE_H_ |
| 27 | #define DC_INTERFACE_H_ |
| 28 | |
| 29 | #include "dc_types.h" |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 30 | #include "grph_object_defs.h" |
| 31 | #include "logger_types.h" |
| 32 | #include "gpio_types.h" |
| 33 | #include "link_service_types.h" |
Harry Wentland | d0778eb | 2017-07-22 20:05:20 -0400 | [diff] [blame] | 34 | #include "grph_object_ctrl_defs.h" |
Leo (Sunpeng) Li | 4fa086b9 | 2017-07-25 20:51:26 -0400 | [diff] [blame] | 35 | #include <inc/hw/opp.h> |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 36 | |
Harry Wentland | 091a97e | 2016-12-06 12:25:52 -0500 | [diff] [blame] | 37 | #define MAX_SURFACES 3 |
Aric Cyr | ab2541b | 2016-12-29 15:27:12 -0500 | [diff] [blame] | 38 | #define MAX_STREAMS 6 |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 39 | #define MAX_SINKS_PER_LINK 4 |
| 40 | |
| 41 | /******************************************************************************* |
| 42 | * Display Core Interfaces |
| 43 | ******************************************************************************/ |
| 44 | |
| 45 | struct dc_caps { |
Aric Cyr | ab2541b | 2016-12-29 15:27:12 -0500 | [diff] [blame] | 46 | uint32_t max_streams; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 47 | uint32_t max_links; |
| 48 | uint32_t max_audios; |
| 49 | uint32_t max_slave_planes; |
Alex Deucher | d4e13b0 | 2017-06-15 16:24:01 -0400 | [diff] [blame] | 50 | uint32_t max_surfaces; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 51 | uint32_t max_downscale_ratio; |
| 52 | uint32_t i2c_speed_in_khz; |
Tony Cheng | a37656b | 2017-02-08 22:13:52 -0500 | [diff] [blame] | 53 | |
| 54 | unsigned int max_cursor_size; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 55 | }; |
| 56 | |
| 57 | |
| 58 | struct dc_dcc_surface_param { |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 59 | struct dc_size surface_size; |
Anthony Koo | ebf055f | 2017-06-14 10:19:57 -0400 | [diff] [blame] | 60 | enum surface_pixel_format format; |
Alex Deucher | 2c8ad2d | 2017-06-15 16:20:24 -0400 | [diff] [blame] | 61 | enum swizzle_mode_values swizzle_mode; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 62 | enum dc_scan_direction scan; |
| 63 | }; |
| 64 | |
| 65 | struct dc_dcc_setting { |
| 66 | unsigned int max_compressed_blk_size; |
| 67 | unsigned int max_uncompressed_blk_size; |
| 68 | bool independent_64b_blks; |
| 69 | }; |
| 70 | |
| 71 | struct dc_surface_dcc_cap { |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 72 | union { |
| 73 | struct { |
| 74 | struct dc_dcc_setting rgb; |
| 75 | } grph; |
| 76 | |
| 77 | struct { |
| 78 | struct dc_dcc_setting luma; |
| 79 | struct dc_dcc_setting chroma; |
| 80 | } video; |
| 81 | }; |
Anthony Koo | ebf055f | 2017-06-14 10:19:57 -0400 | [diff] [blame] | 82 | |
| 83 | bool capable; |
| 84 | bool const_color_support; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 85 | }; |
| 86 | |
Sylvia Tsai | 94267b3 | 2017-04-21 15:29:55 -0400 | [diff] [blame] | 87 | struct dc_static_screen_events { |
| 88 | bool cursor_update; |
| 89 | bool surface_update; |
| 90 | bool overlay_update; |
| 91 | }; |
| 92 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 93 | /* Forward declaration*/ |
| 94 | struct dc; |
| 95 | struct dc_surface; |
| 96 | struct validate_context; |
| 97 | |
| 98 | struct dc_cap_funcs { |
Alex Deucher | ff5ef99 | 2017-06-15 16:27:42 -0400 | [diff] [blame] | 99 | #if defined(CONFIG_DRM_AMD_DC_DCN1_0) |
| 100 | bool (*get_dcc_compression_cap)(const struct dc *dc, |
| 101 | const struct dc_dcc_surface_param *input, |
| 102 | struct dc_surface_dcc_cap *output); |
| 103 | #else |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 104 | int i; |
Alex Deucher | ff5ef99 | 2017-06-15 16:27:42 -0400 | [diff] [blame] | 105 | #endif |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 106 | }; |
| 107 | |
| 108 | struct dc_stream_funcs { |
| 109 | bool (*adjust_vmin_vmax)(struct dc *dc, |
Leo (Sunpeng) Li | 4fa086b9 | 2017-07-25 20:51:26 -0400 | [diff] [blame] | 110 | struct dc_stream **stream, |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 111 | int num_streams, |
| 112 | int vmin, |
| 113 | int vmax); |
Eric Cook | 72ada5f | 2017-04-18 15:24:50 -0400 | [diff] [blame] | 114 | bool (*get_crtc_position)(struct dc *dc, |
Leo (Sunpeng) Li | 4fa086b9 | 2017-07-25 20:51:26 -0400 | [diff] [blame] | 115 | struct dc_stream **stream, |
Eric Cook | 72ada5f | 2017-04-18 15:24:50 -0400 | [diff] [blame] | 116 | int num_streams, |
| 117 | unsigned int *v_pos, |
| 118 | unsigned int *nom_v_pos); |
| 119 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 120 | bool (*set_gamut_remap)(struct dc *dc, |
Amy Zhang | f46661d | 2017-05-09 14:45:54 -0400 | [diff] [blame] | 121 | const struct dc_stream *stream); |
Sylvia Tsai | 94267b3 | 2017-04-21 15:29:55 -0400 | [diff] [blame] | 122 | |
Yue Hin Lau | abe07e8 | 2017-06-28 17:21:42 -0400 | [diff] [blame] | 123 | bool (*program_csc_matrix)(struct dc *dc, |
Leo (Sunpeng) Li | 4fa086b9 | 2017-07-25 20:51:26 -0400 | [diff] [blame] | 124 | struct dc_stream *stream); |
Yue Hin Lau | abe07e8 | 2017-06-28 17:21:42 -0400 | [diff] [blame] | 125 | |
Sylvia Tsai | 94267b3 | 2017-04-21 15:29:55 -0400 | [diff] [blame] | 126 | void (*set_static_screen_events)(struct dc *dc, |
Leo (Sunpeng) Li | 4fa086b9 | 2017-07-25 20:51:26 -0400 | [diff] [blame] | 127 | struct dc_stream **stream, |
Sylvia Tsai | 94267b3 | 2017-04-21 15:29:55 -0400 | [diff] [blame] | 128 | int num_streams, |
| 129 | const struct dc_static_screen_events *events); |
Ding Wang | 529cad0 | 2017-04-25 10:03:27 -0400 | [diff] [blame] | 130 | |
Leo (Sunpeng) Li | 4fa086b9 | 2017-07-25 20:51:26 -0400 | [diff] [blame] | 131 | void (*set_dither_option)(struct dc_stream *stream, |
Ding Wang | 529cad0 | 2017-04-25 10:03:27 -0400 | [diff] [blame] | 132 | enum dc_dither_option option); |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 133 | }; |
| 134 | |
| 135 | struct link_training_settings; |
| 136 | |
| 137 | struct dc_link_funcs { |
| 138 | void (*set_drive_settings)(struct dc *dc, |
Hersen Wu | bf5cda3 | 2017-01-04 10:22:35 -0500 | [diff] [blame] | 139 | struct link_training_settings *lt_settings, |
| 140 | const struct dc_link *link); |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 141 | void (*perform_link_training)(struct dc *dc, |
| 142 | struct dc_link_settings *link_setting, |
| 143 | bool skip_video_pattern); |
| 144 | void (*set_preferred_link_settings)(struct dc *dc, |
Zeyu Fan | 8863916 | 2016-12-23 16:53:12 -0500 | [diff] [blame] | 145 | struct dc_link_settings *link_setting, |
Harry Wentland | d0778eb | 2017-07-22 20:05:20 -0400 | [diff] [blame] | 146 | struct dc_link *link); |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 147 | void (*enable_hpd)(const struct dc_link *link); |
| 148 | void (*disable_hpd)(const struct dc_link *link); |
| 149 | void (*set_test_pattern)( |
Harry Wentland | d0778eb | 2017-07-22 20:05:20 -0400 | [diff] [blame] | 150 | struct dc_link *link, |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 151 | enum dp_test_pattern test_pattern, |
| 152 | const struct link_training_settings *p_link_settings, |
| 153 | const unsigned char *p_custom_pattern, |
| 154 | unsigned int cust_pattern_size); |
| 155 | }; |
| 156 | |
| 157 | /* Structure to hold configuration flags set by dm at dc creation. */ |
| 158 | struct dc_config { |
| 159 | bool gpu_vm_support; |
| 160 | bool disable_disp_pll_sharing; |
| 161 | }; |
| 162 | |
| 163 | struct dc_debug { |
| 164 | bool surface_visual_confirm; |
Tony Cheng | 2b13d7d | 2017-07-14 14:07:16 -0400 | [diff] [blame] | 165 | bool sanity_checks; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 166 | bool max_disp_clk; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 167 | bool surface_trace; |
Yongqiang Sun | 9474980 | 2016-12-08 09:47:11 -0500 | [diff] [blame] | 168 | bool timing_trace; |
Dmytro Laktyushkin | c974268 | 2017-06-07 13:53:30 -0400 | [diff] [blame] | 169 | bool clock_trace; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 170 | bool validation_trace; |
| 171 | bool disable_stutter; |
| 172 | bool disable_dcc; |
| 173 | bool disable_dfs_bypass; |
Alex Deucher | ff5ef99 | 2017-06-15 16:27:42 -0400 | [diff] [blame] | 174 | #if defined(CONFIG_DRM_AMD_DC_DCN1_0) |
| 175 | bool disable_dpp_power_gate; |
| 176 | bool disable_hubp_power_gate; |
| 177 | bool disable_pplib_wm_range; |
| 178 | bool use_dml_wm; |
Dmytro Laktyushkin | 90f095c | 2017-06-16 11:27:59 -0400 | [diff] [blame] | 179 | bool disable_pipe_split; |
Dmytro Laktyushkin | 139cb65 | 2017-06-21 09:35:35 -0400 | [diff] [blame] | 180 | int sr_exit_time_dpm0_ns; |
| 181 | int sr_enter_plus_exit_time_dpm0_ns; |
Alex Deucher | ff5ef99 | 2017-06-15 16:27:42 -0400 | [diff] [blame] | 182 | int sr_exit_time_ns; |
| 183 | int sr_enter_plus_exit_time_ns; |
| 184 | int urgent_latency_ns; |
| 185 | int percent_of_ideal_drambw; |
| 186 | int dram_clock_change_latency_ns; |
Dmytro Laktyushkin | e73b59b | 2017-05-19 13:01:35 -0400 | [diff] [blame] | 187 | int always_scale; |
Alex Deucher | ff5ef99 | 2017-06-15 16:27:42 -0400 | [diff] [blame] | 188 | #endif |
Alex Deucher | 2c8ad2d | 2017-06-15 16:20:24 -0400 | [diff] [blame] | 189 | bool disable_pplib_clock_request; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 190 | bool disable_clock_gate; |
Yongqiang Sun | aa66df5 | 2016-12-15 10:50:48 -0500 | [diff] [blame] | 191 | bool disable_dmcu; |
Charlene Liu | 29eba8e | 2017-05-23 17:15:54 -0400 | [diff] [blame] | 192 | bool disable_psr; |
Anthony Koo | 70814f6 | 2017-01-27 17:50:03 -0500 | [diff] [blame] | 193 | bool force_abm_enable; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 194 | }; |
| 195 | |
| 196 | struct dc { |
| 197 | struct dc_caps caps; |
| 198 | struct dc_cap_funcs cap_funcs; |
| 199 | struct dc_stream_funcs stream_funcs; |
| 200 | struct dc_link_funcs link_funcs; |
| 201 | struct dc_config config; |
| 202 | struct dc_debug debug; |
| 203 | }; |
| 204 | |
Alex Deucher | 2c8ad2d | 2017-06-15 16:20:24 -0400 | [diff] [blame] | 205 | enum frame_buffer_mode { |
| 206 | FRAME_BUFFER_MODE_LOCAL_ONLY = 0, |
| 207 | FRAME_BUFFER_MODE_ZFB_ONLY, |
| 208 | FRAME_BUFFER_MODE_MIXED_ZFB_AND_LOCAL, |
| 209 | } ; |
| 210 | |
| 211 | struct dchub_init_data { |
Alex Deucher | 2c8ad2d | 2017-06-15 16:20:24 -0400 | [diff] [blame] | 212 | int64_t zfb_phys_addr_base; |
| 213 | int64_t zfb_mc_base_addr; |
| 214 | uint64_t zfb_size_in_byte; |
| 215 | enum frame_buffer_mode fb_mode; |
Anthony Koo | ebf055f | 2017-06-14 10:19:57 -0400 | [diff] [blame] | 216 | bool dchub_initialzied; |
| 217 | bool dchub_info_valid; |
Alex Deucher | 2c8ad2d | 2017-06-15 16:20:24 -0400 | [diff] [blame] | 218 | }; |
Alex Deucher | 2c8ad2d | 2017-06-15 16:20:24 -0400 | [diff] [blame] | 219 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 220 | struct dc_init_data { |
| 221 | struct hw_asic_id asic_id; |
| 222 | void *driver; /* ctx */ |
| 223 | struct cgs_device *cgs_device; |
| 224 | |
| 225 | int num_virtual_links; |
| 226 | /* |
| 227 | * If 'vbios_override' not NULL, it will be called instead |
| 228 | * of the real VBIOS. Intended use is Diagnostics on FPGA. |
| 229 | */ |
| 230 | struct dc_bios *vbios_override; |
| 231 | enum dce_environment dce_environment; |
| 232 | |
| 233 | struct dc_config flags; |
Roman Li | 690b5e3 | 2017-07-27 20:00:06 -0400 | [diff] [blame] | 234 | #ifdef ENABLE_FBC |
| 235 | uint64_t fbc_gpu_addr; |
| 236 | #endif |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 237 | }; |
| 238 | |
| 239 | struct dc *dc_create(const struct dc_init_data *init_params); |
| 240 | |
| 241 | void dc_destroy(struct dc **dc); |
| 242 | |
Alex Deucher | 2c8ad2d | 2017-06-15 16:20:24 -0400 | [diff] [blame] | 243 | bool dc_init_dchub(struct dc *dc, struct dchub_init_data *dh_data); |
Alex Deucher | 2c8ad2d | 2017-06-15 16:20:24 -0400 | [diff] [blame] | 244 | |
Tony Cheng | 6d244be | 2017-07-20 00:12:20 -0400 | [diff] [blame] | 245 | void dc_log_hw_state(struct dc *dc); |
| 246 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 247 | /******************************************************************************* |
| 248 | * Surface Interfaces |
| 249 | ******************************************************************************/ |
| 250 | |
| 251 | enum { |
Anthony Koo | fb735a9 | 2016-12-13 13:59:41 -0500 | [diff] [blame] | 252 | TRANSFER_FUNC_POINTS = 1025 |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 253 | }; |
| 254 | |
Andrew Wong | 1646a6fe | 2016-12-22 15:41:30 -0500 | [diff] [blame] | 255 | struct dc_hdr_static_metadata { |
Andrew Wong | 1646a6fe | 2016-12-22 15:41:30 -0500 | [diff] [blame] | 256 | /* display chromaticities and white point in units of 0.00001 */ |
| 257 | unsigned int chromaticity_green_x; |
| 258 | unsigned int chromaticity_green_y; |
| 259 | unsigned int chromaticity_blue_x; |
| 260 | unsigned int chromaticity_blue_y; |
| 261 | unsigned int chromaticity_red_x; |
| 262 | unsigned int chromaticity_red_y; |
| 263 | unsigned int chromaticity_white_point_x; |
| 264 | unsigned int chromaticity_white_point_y; |
| 265 | |
| 266 | uint32_t min_luminance; |
| 267 | uint32_t max_luminance; |
| 268 | uint32_t maximum_content_light_level; |
| 269 | uint32_t maximum_frame_average_light_level; |
Anthony Koo | ebf055f | 2017-06-14 10:19:57 -0400 | [diff] [blame] | 270 | |
| 271 | bool hdr_supported; |
| 272 | bool is_hdr; |
Andrew Wong | 1646a6fe | 2016-12-22 15:41:30 -0500 | [diff] [blame] | 273 | }; |
| 274 | |
Anthony Koo | fb735a9 | 2016-12-13 13:59:41 -0500 | [diff] [blame] | 275 | enum dc_transfer_func_type { |
| 276 | TF_TYPE_PREDEFINED, |
| 277 | TF_TYPE_DISTRIBUTED_POINTS, |
Dmytro Laktyushkin | 7950f0f | 2017-06-13 17:08:22 -0400 | [diff] [blame] | 278 | TF_TYPE_BYPASS |
Anthony Koo | fb735a9 | 2016-12-13 13:59:41 -0500 | [diff] [blame] | 279 | }; |
| 280 | |
| 281 | struct dc_transfer_func_distributed_points { |
Amy Zhang | fcd2f4b | 2017-01-05 17:12:20 -0500 | [diff] [blame] | 282 | struct fixed31_32 red[TRANSFER_FUNC_POINTS]; |
| 283 | struct fixed31_32 green[TRANSFER_FUNC_POINTS]; |
| 284 | struct fixed31_32 blue[TRANSFER_FUNC_POINTS]; |
| 285 | |
Anthony Koo | fb735a9 | 2016-12-13 13:59:41 -0500 | [diff] [blame] | 286 | uint16_t end_exponent; |
Amy Zhang | fcd2f4b | 2017-01-05 17:12:20 -0500 | [diff] [blame] | 287 | uint16_t x_point_at_y1_red; |
| 288 | uint16_t x_point_at_y1_green; |
| 289 | uint16_t x_point_at_y1_blue; |
Anthony Koo | fb735a9 | 2016-12-13 13:59:41 -0500 | [diff] [blame] | 290 | }; |
| 291 | |
| 292 | enum dc_transfer_func_predefined { |
| 293 | TRANSFER_FUNCTION_SRGB, |
| 294 | TRANSFER_FUNCTION_BT709, |
Anthony Koo | 90e508b | 2016-12-15 12:09:46 -0500 | [diff] [blame] | 295 | TRANSFER_FUNCTION_PQ, |
Anthony Koo | fb735a9 | 2016-12-13 13:59:41 -0500 | [diff] [blame] | 296 | TRANSFER_FUNCTION_LINEAR, |
| 297 | }; |
| 298 | |
| 299 | struct dc_transfer_func { |
Anthony Koo | ebf055f | 2017-06-14 10:19:57 -0400 | [diff] [blame] | 300 | struct dc_transfer_func_distributed_points tf_pts; |
Anthony Koo | fb735a9 | 2016-12-13 13:59:41 -0500 | [diff] [blame] | 301 | enum dc_transfer_func_type type; |
| 302 | enum dc_transfer_func_predefined tf; |
Leo (Sunpeng) Li | 7b0c470 | 2017-07-10 14:04:21 -0400 | [diff] [blame] | 303 | struct dc_context *ctx; |
| 304 | int ref_count; |
Anthony Koo | fb735a9 | 2016-12-13 13:59:41 -0500 | [diff] [blame] | 305 | }; |
| 306 | |
Harry Wentland | e12cfcb | 2017-07-20 11:43:32 -0400 | [diff] [blame] | 307 | /* |
| 308 | * This structure is filled in by dc_surface_get_status and contains |
| 309 | * the last requested address and the currently active address so the called |
| 310 | * can determine if there are any outstanding flips |
| 311 | */ |
| 312 | struct dc_surface_status { |
| 313 | struct dc_plane_address requested_address; |
| 314 | struct dc_plane_address current_address; |
| 315 | bool is_flip_pending; |
| 316 | bool is_right_eye; |
| 317 | }; |
| 318 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 319 | struct dc_surface { |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 320 | struct dc_plane_address address; |
| 321 | |
| 322 | struct scaling_taps scaling_quality; |
| 323 | struct rect src_rect; |
| 324 | struct rect dst_rect; |
| 325 | struct rect clip_rect; |
| 326 | |
| 327 | union plane_size plane_size; |
| 328 | union dc_tiling_info tiling_info; |
Anthony Koo | ebf055f | 2017-06-14 10:19:57 -0400 | [diff] [blame] | 329 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 330 | struct dc_plane_dcc_param dcc; |
Andrew Wong | 1646a6fe | 2016-12-22 15:41:30 -0500 | [diff] [blame] | 331 | struct dc_hdr_static_metadata hdr_static_ctx; |
| 332 | |
Harry Wentland | 7a6c4af6 | 2017-07-24 15:30:17 -0400 | [diff] [blame] | 333 | struct dc_gamma *gamma_correction; |
Leo (Sunpeng) Li | 7b0c470 | 2017-07-10 14:04:21 -0400 | [diff] [blame] | 334 | struct dc_transfer_func *in_transfer_func; |
Anthony Koo | ebf055f | 2017-06-14 10:19:57 -0400 | [diff] [blame] | 335 | |
| 336 | enum dc_color_space color_space; |
| 337 | enum surface_pixel_format format; |
| 338 | enum dc_rotation_angle rotation; |
| 339 | enum plane_stereo_format stereo_format; |
| 340 | |
| 341 | bool per_pixel_alpha; |
| 342 | bool visible; |
| 343 | bool flip_immediate; |
| 344 | bool horizontal_mirror; |
Harry Wentland | e12cfcb | 2017-07-20 11:43:32 -0400 | [diff] [blame] | 345 | |
| 346 | /* private to DC core */ |
| 347 | struct dc_surface_status status; |
| 348 | struct dc_context *ctx; |
| 349 | |
| 350 | /* private to dc_surface.c */ |
| 351 | enum dc_irq_source irq_source; |
| 352 | int ref_count; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 353 | }; |
| 354 | |
| 355 | struct dc_plane_info { |
| 356 | union plane_size plane_size; |
| 357 | union dc_tiling_info tiling_info; |
Leon Elazar | 9cd09bf | 2016-12-19 12:00:05 -0500 | [diff] [blame] | 358 | struct dc_plane_dcc_param dcc; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 359 | enum surface_pixel_format format; |
| 360 | enum dc_rotation_angle rotation; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 361 | enum plane_stereo_format stereo_format; |
| 362 | enum dc_color_space color_space; /*todo: wrong place, fits in scaling info*/ |
Anthony Koo | ebf055f | 2017-06-14 10:19:57 -0400 | [diff] [blame] | 363 | bool horizontal_mirror; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 364 | bool visible; |
Anthony Koo | ebf055f | 2017-06-14 10:19:57 -0400 | [diff] [blame] | 365 | bool per_pixel_alpha; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 366 | }; |
| 367 | |
| 368 | struct dc_scaling_info { |
Anthony Koo | ebf055f | 2017-06-14 10:19:57 -0400 | [diff] [blame] | 369 | struct rect src_rect; |
| 370 | struct rect dst_rect; |
| 371 | struct rect clip_rect; |
| 372 | struct scaling_taps scaling_quality; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 373 | }; |
| 374 | |
| 375 | struct dc_surface_update { |
Harry Wentland | e12cfcb | 2017-07-20 11:43:32 -0400 | [diff] [blame] | 376 | struct dc_surface *surface; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 377 | |
| 378 | /* isr safe update parameters. null means no updates */ |
| 379 | struct dc_flip_addrs *flip_addr; |
| 380 | struct dc_plane_info *plane_info; |
| 381 | struct dc_scaling_info *scaling_info; |
| 382 | /* following updates require alloc/sleep/spin that is not isr safe, |
| 383 | * null means no updates |
| 384 | */ |
Anthony Koo | fb735a9 | 2016-12-13 13:59:41 -0500 | [diff] [blame] | 385 | /* gamma TO BE REMOVED */ |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 386 | struct dc_gamma *gamma; |
Anthony Koo | fb735a9 | 2016-12-13 13:59:41 -0500 | [diff] [blame] | 387 | struct dc_transfer_func *in_transfer_func; |
Amy Zhang | f46661d | 2017-05-09 14:45:54 -0400 | [diff] [blame] | 388 | struct dc_hdr_static_metadata *hdr_static_metadata; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 389 | }; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 390 | |
| 391 | /* |
| 392 | * Create a new surface with default parameters; |
| 393 | */ |
| 394 | struct dc_surface *dc_create_surface(const struct dc *dc); |
| 395 | const struct dc_surface_status *dc_surface_get_status( |
| 396 | const struct dc_surface *dc_surface); |
| 397 | |
Harry Wentland | e12cfcb | 2017-07-20 11:43:32 -0400 | [diff] [blame] | 398 | void dc_surface_retain(struct dc_surface *dc_surface); |
| 399 | void dc_surface_release(struct dc_surface *dc_surface); |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 400 | |
Harry Wentland | 7a6c4af6 | 2017-07-24 15:30:17 -0400 | [diff] [blame] | 401 | void dc_gamma_retain(struct dc_gamma *dc_gamma); |
| 402 | void dc_gamma_release(struct dc_gamma **dc_gamma); |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 403 | struct dc_gamma *dc_create_gamma(void); |
| 404 | |
Leo (Sunpeng) Li | 7b0c470 | 2017-07-10 14:04:21 -0400 | [diff] [blame] | 405 | void dc_transfer_func_retain(struct dc_transfer_func *dc_tf); |
| 406 | void dc_transfer_func_release(struct dc_transfer_func *dc_tf); |
Anthony Koo | 90e508b | 2016-12-15 12:09:46 -0500 | [diff] [blame] | 407 | struct dc_transfer_func *dc_create_transfer_func(void); |
Anthony Koo | fb735a9 | 2016-12-13 13:59:41 -0500 | [diff] [blame] | 408 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 409 | /* |
| 410 | * This structure holds a surface address. There could be multiple addresses |
| 411 | * in cases such as Stereo 3D, Planar YUV, etc. Other per-flip attributes such |
| 412 | * as frame durations and DCC format can also be set. |
| 413 | */ |
| 414 | struct dc_flip_addrs { |
| 415 | struct dc_plane_address address; |
| 416 | bool flip_immediate; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 417 | /* TODO: add flip duration for FreeSync */ |
| 418 | }; |
| 419 | |
| 420 | /* |
Aric Cyr | ab2541b | 2016-12-29 15:27:12 -0500 | [diff] [blame] | 421 | * Set up surface attributes and associate to a stream |
| 422 | * The surfaces parameter is an absolute set of all surface active for the stream. |
| 423 | * If no surfaces are provided, the stream will be blanked; no memory read. |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 424 | * Any flip related attribute changes must be done through this interface. |
| 425 | * |
| 426 | * After this call: |
Aric Cyr | ab2541b | 2016-12-29 15:27:12 -0500 | [diff] [blame] | 427 | * Surfaces attributes are programmed and configured to be composed into stream. |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 428 | * This does not trigger a flip. No surface address is programmed. |
| 429 | */ |
| 430 | |
Aric Cyr | ab2541b | 2016-12-29 15:27:12 -0500 | [diff] [blame] | 431 | bool dc_commit_surfaces_to_stream( |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 432 | struct dc *dc, |
Harry Wentland | e12cfcb | 2017-07-20 11:43:32 -0400 | [diff] [blame] | 433 | struct dc_surface **dc_surfaces, |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 434 | uint8_t surface_count, |
Leo (Sunpeng) Li | 4fa086b9 | 2017-07-25 20:51:26 -0400 | [diff] [blame] | 435 | struct dc_stream *stream); |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 436 | |
Aric Cyr | ab2541b | 2016-12-29 15:27:12 -0500 | [diff] [blame] | 437 | bool dc_post_update_surfaces_to_stream( |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 438 | struct dc *dc); |
| 439 | |
Dmytro Laktyushkin | 81e2b2d | 2017-05-10 18:24:24 -0400 | [diff] [blame] | 440 | /* Surface update type is used by dc_update_surfaces_and_stream |
| 441 | * The update type is determined at the very beginning of the function based |
| 442 | * on parameters passed in and decides how much programming (or updating) is |
| 443 | * going to be done during the call. |
| 444 | * |
| 445 | * UPDATE_TYPE_FAST is used for really fast updates that do not require much |
| 446 | * logical calculations or hardware register programming. This update MUST be |
| 447 | * ISR safe on windows. Currently fast update will only be used to flip surface |
| 448 | * address. |
| 449 | * |
| 450 | * UPDATE_TYPE_MED is used for slower updates which require significant hw |
| 451 | * re-programming however do not affect bandwidth consumption or clock |
| 452 | * requirements. At present, this is the level at which front end updates |
| 453 | * that do not require us to run bw_calcs happen. These are in/out transfer func |
| 454 | * updates, viewport offset changes, recout size changes and pixel depth changes. |
| 455 | * This update can be done at ISR, but we want to minimize how often this happens. |
| 456 | * |
| 457 | * UPDATE_TYPE_FULL is slow. Really slow. This requires us to recalculate our |
| 458 | * bandwidth and clocks, possibly rearrange some pipes and reprogram anything front |
| 459 | * end related. Any time viewport dimensions, recout dimensions, scaling ratios or |
| 460 | * gamma need to be adjusted or pipe needs to be turned on (or disconnected) we do |
| 461 | * a full update. This cannot be done at ISR level and should be a rare event. |
| 462 | * Unless someone is stress testing mpo enter/exit, playing with colour or adjusting |
| 463 | * underscan we don't expect to see this call at all. |
| 464 | */ |
| 465 | |
Leon Elazar | 5869b0f | 2017-03-01 12:30:11 -0500 | [diff] [blame] | 466 | enum surface_update_type { |
| 467 | UPDATE_TYPE_FAST, /* super fast, safe to execute in isr */ |
Dmytro Laktyushkin | 81e2b2d | 2017-05-10 18:24:24 -0400 | [diff] [blame] | 468 | UPDATE_TYPE_MED, /* ISR safe, most of programming needed, no bw/clk change*/ |
Leon Elazar | 5869b0f | 2017-03-01 12:30:11 -0500 | [diff] [blame] | 469 | UPDATE_TYPE_FULL, /* may need to shuffle resources */ |
| 470 | }; |
| 471 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 472 | /******************************************************************************* |
| 473 | * Stream Interfaces |
| 474 | ******************************************************************************/ |
Leo (Sunpeng) Li | 4fa086b9 | 2017-07-25 20:51:26 -0400 | [diff] [blame] | 475 | |
| 476 | struct dc_stream_status { |
| 477 | int primary_otg_inst; |
| 478 | int surface_count; |
| 479 | struct dc_surface *surfaces[MAX_SURFACE_NUM]; |
| 480 | |
| 481 | /* |
| 482 | * link this stream passes through |
| 483 | */ |
| 484 | struct dc_link *link; |
| 485 | }; |
| 486 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 487 | struct dc_stream { |
Harry Wentland | b3d6c3f | 2017-07-24 14:04:27 -0400 | [diff] [blame] | 488 | struct dc_sink *sink; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 489 | struct dc_crtc_timing timing; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 490 | |
Aric Cyr | ab2541b | 2016-12-29 15:27:12 -0500 | [diff] [blame] | 491 | struct rect src; /* composition area */ |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 492 | struct rect dst; /* stream addressable area */ |
| 493 | |
| 494 | struct audio_info audio_info; |
| 495 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 496 | struct freesync_context freesync_ctx; |
| 497 | |
Leo (Sunpeng) Li | 7b0c470 | 2017-07-10 14:04:21 -0400 | [diff] [blame] | 498 | struct dc_transfer_func *out_transfer_func; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 499 | struct colorspace_transform gamut_remap_matrix; |
| 500 | struct csc_transform csc_color_matrix; |
Anthony Koo | ebf055f | 2017-06-14 10:19:57 -0400 | [diff] [blame] | 501 | |
| 502 | enum signal_type output_signal; |
| 503 | |
| 504 | enum dc_color_space output_color_space; |
| 505 | enum dc_dither_option dither_option; |
| 506 | |
Vitaly Prosyak | 9edba55 | 2017-06-07 12:23:59 -0500 | [diff] [blame] | 507 | enum view_3d_format view_format; |
Anthony Koo | ebf055f | 2017-06-14 10:19:57 -0400 | [diff] [blame] | 508 | |
| 509 | bool ignore_msa_timing_param; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 510 | /* TODO: custom INFO packets */ |
| 511 | /* TODO: ABM info (DMCU) */ |
| 512 | /* TODO: PSR info */ |
| 513 | /* TODO: CEA VIC */ |
Leo (Sunpeng) Li | 4fa086b9 | 2017-07-25 20:51:26 -0400 | [diff] [blame] | 514 | |
| 515 | /* from core_stream struct */ |
| 516 | struct dc_context *ctx; |
| 517 | |
| 518 | /* used by DCP and FMT */ |
| 519 | struct bit_depth_reduction_params bit_depth_params; |
| 520 | struct clamping_and_pixel_encoding_params clamping; |
| 521 | |
| 522 | int phy_pix_clk; |
| 523 | enum signal_type signal; |
| 524 | |
| 525 | struct dc_stream_status status; |
| 526 | |
| 527 | /* from stream struct */ |
| 528 | int ref_count; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 529 | }; |
| 530 | |
Leon Elazar | a783e7b | 2017-03-09 14:38:15 -0500 | [diff] [blame] | 531 | struct dc_stream_update { |
Leon Elazar | a783e7b | 2017-03-09 14:38:15 -0500 | [diff] [blame] | 532 | struct rect src; |
Leon Elazar | a783e7b | 2017-03-09 14:38:15 -0500 | [diff] [blame] | 533 | struct rect dst; |
Amy Zhang | f46661d | 2017-05-09 14:45:54 -0400 | [diff] [blame] | 534 | struct dc_transfer_func *out_transfer_func; |
Leon Elazar | a783e7b | 2017-03-09 14:38:15 -0500 | [diff] [blame] | 535 | }; |
| 536 | |
| 537 | |
| 538 | /* |
| 539 | * Setup stream attributes if no stream updates are provided |
| 540 | * there will be no impact on the stream parameters |
| 541 | * |
| 542 | * Set up surface attributes and associate to a stream |
| 543 | * The surfaces parameter is an absolute set of all surface active for the stream. |
| 544 | * If no surfaces are provided, the stream will be blanked; no memory read. |
| 545 | * Any flip related attribute changes must be done through this interface. |
| 546 | * |
| 547 | * After this call: |
| 548 | * Surfaces attributes are programmed and configured to be composed into stream. |
| 549 | * This does not trigger a flip. No surface address is programmed. |
| 550 | * |
| 551 | */ |
| 552 | |
| 553 | void dc_update_surfaces_and_stream(struct dc *dc, |
| 554 | struct dc_surface_update *surface_updates, int surface_count, |
Leo (Sunpeng) Li | 4fa086b9 | 2017-07-25 20:51:26 -0400 | [diff] [blame] | 555 | struct dc_stream *dc_stream, |
Leon Elazar | a783e7b | 2017-03-09 14:38:15 -0500 | [diff] [blame] | 556 | struct dc_stream_update *stream_update); |
| 557 | |
Aric Cyr | ab2541b | 2016-12-29 15:27:12 -0500 | [diff] [blame] | 558 | /* |
| 559 | * Log the current stream state. |
| 560 | */ |
| 561 | void dc_stream_log( |
| 562 | const struct dc_stream *stream, |
| 563 | struct dal_logger *dc_logger, |
| 564 | enum dc_log_type log_type); |
| 565 | |
| 566 | uint8_t dc_get_current_stream_count(const struct dc *dc); |
| 567 | struct dc_stream *dc_get_stream_at_index(const struct dc *dc, uint8_t i); |
| 568 | |
| 569 | /* |
| 570 | * Return the current frame counter. |
| 571 | */ |
| 572 | uint32_t dc_stream_get_vblank_counter(const struct dc_stream *stream); |
| 573 | |
| 574 | /* TODO: Return parsed values rather than direct register read |
| 575 | * This has a dependency on the caller (amdgpu_get_crtc_scanoutpos) |
| 576 | * being refactored properly to be dce-specific |
| 577 | */ |
Sylvia Tsai | 81c5096 | 2017-04-11 15:15:28 -0400 | [diff] [blame] | 578 | bool dc_stream_get_scanoutpos(const struct dc_stream *stream, |
| 579 | uint32_t *v_blank_start, |
| 580 | uint32_t *v_blank_end, |
| 581 | uint32_t *h_position, |
| 582 | uint32_t *v_position); |
Aric Cyr | ab2541b | 2016-12-29 15:27:12 -0500 | [diff] [blame] | 583 | |
| 584 | /* |
| 585 | * Structure to store surface/stream associations for validation |
| 586 | */ |
| 587 | struct dc_validation_set { |
Leo (Sunpeng) Li | 4fa086b9 | 2017-07-25 20:51:26 -0400 | [diff] [blame] | 588 | struct dc_stream *stream; |
Harry Wentland | e12cfcb | 2017-07-20 11:43:32 -0400 | [diff] [blame] | 589 | struct dc_surface *surfaces[MAX_SURFACES]; |
Aric Cyr | ab2541b | 2016-12-29 15:27:12 -0500 | [diff] [blame] | 590 | uint8_t surface_count; |
| 591 | }; |
| 592 | |
Leo (Sunpeng) Li | 4fa086b9 | 2017-07-25 20:51:26 -0400 | [diff] [blame] | 593 | bool dc_validate_stream(const struct dc *dc, struct dc_stream *stream); |
Andrey Grodzovsky | 9345d98 | 2017-07-21 16:34:36 -0400 | [diff] [blame] | 594 | |
Andrey Grodzovsky | 792671d | 2017-07-26 15:51:31 -0400 | [diff] [blame] | 595 | bool dc_validate_surface(const struct dc *dc, const struct dc_surface *surface); |
Aric Cyr | ab2541b | 2016-12-29 15:27:12 -0500 | [diff] [blame] | 596 | /* |
| 597 | * This function takes a set of resources and checks that they are cofunctional. |
| 598 | * |
| 599 | * After this call: |
| 600 | * No hardware is programmed for call. Only validation is done. |
| 601 | */ |
Harry Wentland | 07d72b3 | 2017-03-29 11:22:05 -0400 | [diff] [blame] | 602 | struct validate_context *dc_get_validate_context( |
| 603 | const struct dc *dc, |
| 604 | const struct dc_validation_set set[], |
| 605 | uint8_t set_count); |
| 606 | |
Aric Cyr | ab2541b | 2016-12-29 15:27:12 -0500 | [diff] [blame] | 607 | bool dc_validate_resources( |
| 608 | const struct dc *dc, |
| 609 | const struct dc_validation_set set[], |
| 610 | uint8_t set_count); |
| 611 | |
| 612 | /* |
| 613 | * This function takes a stream and checks if it is guaranteed to be supported. |
| 614 | * Guaranteed means that MAX_COFUNC similar streams are supported. |
| 615 | * |
| 616 | * After this call: |
| 617 | * No hardware is programmed for call. Only validation is done. |
| 618 | */ |
| 619 | |
| 620 | bool dc_validate_guaranteed( |
| 621 | const struct dc *dc, |
Leo (Sunpeng) Li | 4fa086b9 | 2017-07-25 20:51:26 -0400 | [diff] [blame] | 622 | struct dc_stream *stream); |
Aric Cyr | ab2541b | 2016-12-29 15:27:12 -0500 | [diff] [blame] | 623 | |
Harry Wentland | 8122a25 | 2017-03-29 11:15:14 -0400 | [diff] [blame] | 624 | void dc_resource_validate_ctx_copy_construct( |
| 625 | const struct validate_context *src_ctx, |
| 626 | struct validate_context *dst_ctx); |
| 627 | |
| 628 | void dc_resource_validate_ctx_destruct(struct validate_context *context); |
| 629 | |
Aric Cyr | ab2541b | 2016-12-29 15:27:12 -0500 | [diff] [blame] | 630 | /* |
Harry Wentland | 7cf2c84 | 2017-03-06 09:43:30 -0500 | [diff] [blame] | 631 | * TODO update to make it about validation sets |
| 632 | * Set up streams and links associated to drive sinks |
| 633 | * The streams parameter is an absolute set of all active streams. |
| 634 | * |
| 635 | * After this call: |
| 636 | * Phy, Encoder, Timing Generator are programmed and enabled. |
| 637 | * New streams are enabled with blank stream; no memory read. |
| 638 | */ |
Harry Wentland | e2c7bb1 | 2017-06-28 13:23:04 -0400 | [diff] [blame] | 639 | bool dc_commit_context(struct dc *dc, struct validate_context *context); |
Harry Wentland | 7cf2c84 | 2017-03-06 09:43:30 -0500 | [diff] [blame] | 640 | |
| 641 | /* |
Aric Cyr | ab2541b | 2016-12-29 15:27:12 -0500 | [diff] [blame] | 642 | * Set up streams and links associated to drive sinks |
| 643 | * The streams parameter is an absolute set of all active streams. |
| 644 | * |
| 645 | * After this call: |
| 646 | * Phy, Encoder, Timing Generator are programmed and enabled. |
| 647 | * New streams are enabled with blank stream; no memory read. |
| 648 | */ |
| 649 | bool dc_commit_streams( |
| 650 | struct dc *dc, |
Leo (Sunpeng) Li | 4fa086b9 | 2017-07-25 20:51:26 -0400 | [diff] [blame] | 651 | struct dc_stream *streams[], |
Aric Cyr | ab2541b | 2016-12-29 15:27:12 -0500 | [diff] [blame] | 652 | uint8_t stream_count); |
Vitaly Prosyak | 9edba55 | 2017-06-07 12:23:59 -0500 | [diff] [blame] | 653 | /* |
| 654 | * Enable stereo when commit_streams is not required, |
| 655 | * for example, frame alternate. |
| 656 | */ |
| 657 | bool dc_enable_stereo( |
| 658 | struct dc *dc, |
| 659 | struct validate_context *context, |
Leo (Sunpeng) Li | 4fa086b9 | 2017-07-25 20:51:26 -0400 | [diff] [blame] | 660 | struct dc_stream *streams[], |
Vitaly Prosyak | 9edba55 | 2017-06-07 12:23:59 -0500 | [diff] [blame] | 661 | uint8_t stream_count); |
Aric Cyr | ab2541b | 2016-12-29 15:27:12 -0500 | [diff] [blame] | 662 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 663 | /** |
| 664 | * Create a new default stream for the requested sink |
| 665 | */ |
Harry Wentland | b73a22d | 2017-07-24 14:04:27 -0400 | [diff] [blame] | 666 | struct dc_stream *dc_create_stream_for_sink(struct dc_sink *dc_sink); |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 667 | |
Leo (Sunpeng) Li | 4fa086b9 | 2017-07-25 20:51:26 -0400 | [diff] [blame] | 668 | void dc_stream_retain(struct dc_stream *dc_stream); |
| 669 | void dc_stream_release(struct dc_stream *dc_stream); |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 670 | |
Harry Wentland | e12cfcb | 2017-07-20 11:43:32 -0400 | [diff] [blame] | 671 | struct dc_stream_status *dc_stream_get_status( |
Leo (Sunpeng) Li | 4fa086b9 | 2017-07-25 20:51:26 -0400 | [diff] [blame] | 672 | struct dc_stream *dc_stream); |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 673 | |
Leon Elazar | 5869b0f | 2017-03-01 12:30:11 -0500 | [diff] [blame] | 674 | enum surface_update_type dc_check_update_surfaces_for_stream( |
| 675 | struct dc *dc, |
| 676 | struct dc_surface_update *updates, |
| 677 | int surface_count, |
Leon Elazar | ee8f63e | 2017-03-14 11:54:31 -0400 | [diff] [blame] | 678 | struct dc_stream_update *stream_update, |
Leon Elazar | 5869b0f | 2017-03-01 12:30:11 -0500 | [diff] [blame] | 679 | const struct dc_stream_status *stream_status); |
| 680 | |
Andrey Grodzovsky | 8a76708 | 2017-07-11 14:41:51 -0400 | [diff] [blame] | 681 | |
| 682 | void dc_retain_validate_context(struct validate_context *context); |
| 683 | void dc_release_validate_context(struct validate_context *context); |
| 684 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 685 | /******************************************************************************* |
| 686 | * Link Interfaces |
| 687 | ******************************************************************************/ |
| 688 | |
Harry Wentland | d0778eb | 2017-07-22 20:05:20 -0400 | [diff] [blame] | 689 | struct dpcd_caps { |
| 690 | union dpcd_rev dpcd_rev; |
| 691 | union max_lane_count max_ln_count; |
| 692 | union max_down_spread max_down_spread; |
| 693 | |
| 694 | /* dongle type (DP converter, CV smart dongle) */ |
| 695 | enum display_dongle_type dongle_type; |
| 696 | /* Dongle's downstream count. */ |
| 697 | union sink_count sink_count; |
| 698 | /* If dongle_type == DISPLAY_DONGLE_DP_HDMI_CONVERTER, |
| 699 | indicates 'Frame Sequential-to-lllFrame Pack' conversion capability.*/ |
| 700 | struct dc_dongle_caps dongle_caps; |
| 701 | |
| 702 | uint32_t sink_dev_id; |
| 703 | uint32_t branch_dev_id; |
| 704 | int8_t branch_dev_name[6]; |
| 705 | int8_t branch_hw_revision; |
| 706 | |
| 707 | bool allow_invalid_MSA_timing_param; |
| 708 | bool panel_mode_edp; |
| 709 | }; |
| 710 | |
| 711 | struct dc_link_status { |
| 712 | struct dpcd_caps *dpcd_caps; |
| 713 | }; |
| 714 | |
| 715 | /* DP MST stream allocation (payload bandwidth number) */ |
| 716 | struct link_mst_stream_allocation { |
| 717 | /* DIG front */ |
| 718 | const struct stream_encoder *stream_enc; |
| 719 | /* associate DRM payload table with DC stream encoder */ |
| 720 | uint8_t vcp_id; |
| 721 | /* number of slots required for the DP stream in transport packet */ |
| 722 | uint8_t slot_count; |
| 723 | }; |
| 724 | |
| 725 | /* DP MST stream allocation table */ |
| 726 | struct link_mst_stream_allocation_table { |
| 727 | /* number of DP video streams */ |
| 728 | int stream_count; |
| 729 | /* array of stream allocations */ |
| 730 | struct link_mst_stream_allocation stream_allocations[MAX_CONTROLLER_NUM]; |
| 731 | }; |
| 732 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 733 | /* |
| 734 | * A link contains one or more sinks and their connected status. |
| 735 | * The currently active signal type (HDMI, DP-SST, DP-MST) is also reported. |
| 736 | */ |
| 737 | struct dc_link { |
Harry Wentland | b73a22d | 2017-07-24 14:04:27 -0400 | [diff] [blame] | 738 | struct dc_sink *remote_sinks[MAX_SINKS_PER_LINK]; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 739 | unsigned int sink_count; |
Harry Wentland | b73a22d | 2017-07-24 14:04:27 -0400 | [diff] [blame] | 740 | struct dc_sink *local_sink; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 741 | unsigned int link_index; |
| 742 | enum dc_connection_type type; |
| 743 | enum signal_type connector_signal; |
| 744 | enum dc_irq_source irq_source_hpd; |
| 745 | enum dc_irq_source irq_source_hpd_rx;/* aka DP Short Pulse */ |
| 746 | /* caps is the same as reported_link_cap. link_traing use |
| 747 | * reported_link_cap. Will clean up. TODO |
| 748 | */ |
| 749 | struct dc_link_settings reported_link_cap; |
| 750 | struct dc_link_settings verified_link_cap; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 751 | struct dc_link_settings cur_link_settings; |
| 752 | struct dc_lane_settings cur_lane_setting; |
Ding Wang | 8c4abe0 | 2017-07-18 17:18:11 -0400 | [diff] [blame] | 753 | struct dc_link_settings preferred_link_setting; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 754 | |
| 755 | uint8_t ddc_hw_inst; |
Zeyu Fan | 7a09633 | 2017-06-13 11:54:10 -0400 | [diff] [blame] | 756 | |
| 757 | uint8_t hpd_src; |
| 758 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 759 | uint8_t link_enc_hw_inst; |
| 760 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 761 | bool test_pattern_enabled; |
| 762 | union compliance_test_state compliance_test_state; |
Andrey Grodzovsky | 9fb8de7 | 2017-02-14 13:50:17 -0500 | [diff] [blame] | 763 | |
| 764 | void *priv; |
Andrey Grodzovsky | 46df790 | 2017-04-30 09:20:55 -0400 | [diff] [blame] | 765 | |
| 766 | struct ddc_service *ddc; |
Anthony Koo | ebf055f | 2017-06-14 10:19:57 -0400 | [diff] [blame] | 767 | |
| 768 | bool aux_mode; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 769 | |
Harry Wentland | d0778eb | 2017-07-22 20:05:20 -0400 | [diff] [blame] | 770 | /* Private to DC core */ |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 771 | |
Harry Wentland | d0778eb | 2017-07-22 20:05:20 -0400 | [diff] [blame] | 772 | const struct core_dc *dc; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 773 | |
Harry Wentland | d0778eb | 2017-07-22 20:05:20 -0400 | [diff] [blame] | 774 | struct dc_context *ctx; |
Anthony Koo | ebf055f | 2017-06-14 10:19:57 -0400 | [diff] [blame] | 775 | |
Harry Wentland | d0778eb | 2017-07-22 20:05:20 -0400 | [diff] [blame] | 776 | struct link_encoder *link_enc; |
| 777 | struct graphics_object_id link_id; |
| 778 | union ddi_channel_mapping ddi_channel_mapping; |
| 779 | struct connector_device_tag_info device_tag; |
| 780 | struct dpcd_caps dpcd_caps; |
| 781 | unsigned int dpcd_sink_count; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 782 | |
Harry Wentland | d0778eb | 2017-07-22 20:05:20 -0400 | [diff] [blame] | 783 | enum edp_revision edp_revision; |
| 784 | bool psr_enabled; |
| 785 | |
| 786 | /* MST record stream using this link */ |
| 787 | struct link_flags { |
| 788 | bool dp_keep_receiver_powered; |
| 789 | } wa_flags; |
| 790 | struct link_mst_stream_allocation_table mst_stream_alloc_table; |
| 791 | |
| 792 | struct dc_link_status link_status; |
| 793 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 794 | }; |
| 795 | |
| 796 | const struct dc_link_status *dc_link_get_status(const struct dc_link *dc_link); |
| 797 | |
| 798 | /* |
| 799 | * Return an enumerated dc_link. dc_link order is constant and determined at |
| 800 | * boot time. They cannot be created or destroyed. |
| 801 | * Use dc_get_caps() to get number of links. |
| 802 | */ |
Harry Wentland | d0778eb | 2017-07-22 20:05:20 -0400 | [diff] [blame] | 803 | struct dc_link *dc_get_link_at_index(const struct dc *dc, uint32_t link_index); |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 804 | |
| 805 | /* Return id of physical connector represented by a dc_link at link_index.*/ |
| 806 | const struct graphics_object_id dc_get_link_id_at_index( |
| 807 | struct dc *dc, uint32_t link_index); |
| 808 | |
| 809 | /* Set backlight level of an embedded panel (eDP, LVDS). */ |
| 810 | bool dc_link_set_backlight_level(const struct dc_link *dc_link, uint32_t level, |
| 811 | uint32_t frame_ramp, const struct dc_stream *stream); |
| 812 | |
Amy Zhang | aa7397d | 2017-05-12 15:54:29 -0400 | [diff] [blame] | 813 | bool dc_link_set_abm_disable(const struct dc_link *dc_link); |
| 814 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 815 | bool dc_link_set_psr_enable(const struct dc_link *dc_link, bool enable); |
| 816 | |
Amy Zhang | 7db4ded | 2017-05-30 16:16:57 -0400 | [diff] [blame] | 817 | bool dc_link_get_psr_state(const struct dc_link *dc_link, uint32_t *psr_state); |
| 818 | |
Harry Wentland | d0778eb | 2017-07-22 20:05:20 -0400 | [diff] [blame] | 819 | bool dc_link_setup_psr(struct dc_link *dc_link, |
Amy Zhang | 9f72f51 | 2017-05-31 16:53:01 -0400 | [diff] [blame] | 820 | const struct dc_stream *stream, struct psr_config *psr_config, |
| 821 | struct psr_context *psr_context); |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 822 | |
| 823 | /* Request DC to detect if there is a Panel connected. |
| 824 | * boot - If this call is during initial boot. |
| 825 | * Return false for any type of detection failure or MST detection |
| 826 | * true otherwise. True meaning further action is required (status update |
| 827 | * and OS notification). |
| 828 | */ |
Harry Wentland | d0778eb | 2017-07-22 20:05:20 -0400 | [diff] [blame] | 829 | bool dc_link_detect(struct dc_link *dc_link, bool boot); |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 830 | |
| 831 | /* Notify DC about DP RX Interrupt (aka Short Pulse Interrupt). |
| 832 | * Return: |
| 833 | * true - Downstream port status changed. DM should call DC to do the |
| 834 | * detection. |
| 835 | * false - no change in Downstream port status. No further action required |
| 836 | * from DM. */ |
Harry Wentland | d0778eb | 2017-07-22 20:05:20 -0400 | [diff] [blame] | 837 | bool dc_link_handle_hpd_rx_irq(struct dc_link *dc_link, |
Wenjing Liu | 8ee65d7 | 2017-07-19 13:18:26 -0400 | [diff] [blame] | 838 | union hpd_irq_data *hpd_irq_dpcd_data); |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 839 | |
| 840 | struct dc_sink_init_data; |
| 841 | |
| 842 | struct dc_sink *dc_link_add_remote_sink( |
Harry Wentland | d0778eb | 2017-07-22 20:05:20 -0400 | [diff] [blame] | 843 | struct dc_link *dc_link, |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 844 | const uint8_t *edid, |
| 845 | int len, |
| 846 | struct dc_sink_init_data *init_data); |
| 847 | |
| 848 | void dc_link_remove_remote_sink( |
Harry Wentland | d0778eb | 2017-07-22 20:05:20 -0400 | [diff] [blame] | 849 | struct dc_link *link, |
Harry Wentland | b73a22d | 2017-07-24 14:04:27 -0400 | [diff] [blame] | 850 | struct dc_sink *sink); |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 851 | |
| 852 | /* Used by diagnostics for virtual link at the moment */ |
Harry Wentland | d0778eb | 2017-07-22 20:05:20 -0400 | [diff] [blame] | 853 | void dc_link_set_sink(struct dc_link *link, struct dc_sink *sink); |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 854 | |
| 855 | void dc_link_dp_set_drive_settings( |
Harry Wentland | d0778eb | 2017-07-22 20:05:20 -0400 | [diff] [blame] | 856 | struct dc_link *link, |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 857 | struct link_training_settings *lt_settings); |
| 858 | |
Ding Wang | 820e393 | 2017-07-13 12:09:57 -0400 | [diff] [blame] | 859 | enum link_training_result dc_link_dp_perform_link_training( |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 860 | struct dc_link *link, |
| 861 | const struct dc_link_settings *link_setting, |
| 862 | bool skip_video_pattern); |
| 863 | |
| 864 | void dc_link_dp_enable_hpd(const struct dc_link *link); |
| 865 | |
| 866 | void dc_link_dp_disable_hpd(const struct dc_link *link); |
| 867 | |
| 868 | bool dc_link_dp_set_test_pattern( |
Harry Wentland | d0778eb | 2017-07-22 20:05:20 -0400 | [diff] [blame] | 869 | struct dc_link *link, |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 870 | enum dp_test_pattern test_pattern, |
| 871 | const struct link_training_settings *p_link_settings, |
| 872 | const unsigned char *p_custom_pattern, |
| 873 | unsigned int cust_pattern_size); |
| 874 | |
| 875 | /******************************************************************************* |
| 876 | * Sink Interfaces - A sink corresponds to a display output device |
| 877 | ******************************************************************************/ |
| 878 | |
xhdu | 8c89531 | 2017-03-21 11:05:32 -0400 | [diff] [blame] | 879 | struct dc_container_id { |
| 880 | // 128bit GUID in binary form |
| 881 | unsigned char guid[16]; |
| 882 | // 8 byte port ID -> ELD.PortID |
| 883 | unsigned int portId[2]; |
| 884 | // 128bit GUID in binary formufacturer name -> ELD.ManufacturerName |
| 885 | unsigned short manufacturerName; |
| 886 | // 2 byte product code -> ELD.ProductCode |
| 887 | unsigned short productCode; |
| 888 | }; |
| 889 | |
Vitaly Prosyak | b6d6103 | 2017-06-12 11:03:26 -0500 | [diff] [blame] | 890 | |
Vitaly Prosyak | 9edba55 | 2017-06-07 12:23:59 -0500 | [diff] [blame] | 891 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 892 | /* |
| 893 | * The sink structure contains EDID and other display device properties |
| 894 | */ |
| 895 | struct dc_sink { |
| 896 | enum signal_type sink_signal; |
| 897 | struct dc_edid dc_edid; /* raw edid */ |
| 898 | struct dc_edid_caps edid_caps; /* parse display caps */ |
xhdu | 8c89531 | 2017-03-21 11:05:32 -0400 | [diff] [blame] | 899 | struct dc_container_id *dc_container_id; |
Zeyu Fan | 4a9a5d6 | 2017-03-07 11:48:50 -0500 | [diff] [blame] | 900 | uint32_t dongle_max_pix_clk; |
Andrey Grodzovsky | 5c4e98064 | 2017-02-14 15:47:24 -0500 | [diff] [blame] | 901 | void *priv; |
Vitaly Prosyak | 9edba55 | 2017-06-07 12:23:59 -0500 | [diff] [blame] | 902 | struct stereo_3d_features features_3d[TIMING_3D_FORMAT_MAX]; |
Anthony Koo | ebf055f | 2017-06-14 10:19:57 -0400 | [diff] [blame] | 903 | bool converter_disable_audio; |
Harry Wentland | b73a22d | 2017-07-24 14:04:27 -0400 | [diff] [blame] | 904 | |
| 905 | /* private to DC core */ |
| 906 | struct dc_link *link; |
| 907 | struct dc_context *ctx; |
| 908 | |
| 909 | /* private to dc_sink.c */ |
| 910 | int ref_count; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 911 | }; |
| 912 | |
Harry Wentland | b73a22d | 2017-07-24 14:04:27 -0400 | [diff] [blame] | 913 | void dc_sink_retain(struct dc_sink *sink); |
| 914 | void dc_sink_release(struct dc_sink *sink); |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 915 | |
| 916 | const struct audio **dc_get_audios(struct dc *dc); |
| 917 | |
| 918 | struct dc_sink_init_data { |
| 919 | enum signal_type sink_signal; |
Harry Wentland | d0778eb | 2017-07-22 20:05:20 -0400 | [diff] [blame] | 920 | struct dc_link *link; |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 921 | uint32_t dongle_max_pix_clk; |
| 922 | bool converter_disable_audio; |
| 923 | }; |
| 924 | |
| 925 | struct dc_sink *dc_sink_create(const struct dc_sink_init_data *init_params); |
xhdu | 8c89531 | 2017-03-21 11:05:32 -0400 | [diff] [blame] | 926 | bool dc_sink_get_container_id(struct dc_sink *dc_sink, struct dc_container_id *container_id); |
| 927 | bool dc_sink_set_container_id(struct dc_sink *dc_sink, const struct dc_container_id *container_id); |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 928 | |
| 929 | /******************************************************************************* |
Aric Cyr | ab2541b | 2016-12-29 15:27:12 -0500 | [diff] [blame] | 930 | * Cursor interfaces - To manages the cursor within a stream |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 931 | ******************************************************************************/ |
| 932 | /* TODO: Deprecated once we switch to dc_set_cursor_position */ |
Aric Cyr | ab2541b | 2016-12-29 15:27:12 -0500 | [diff] [blame] | 933 | bool dc_stream_set_cursor_attributes( |
| 934 | const struct dc_stream *stream, |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 935 | const struct dc_cursor_attributes *attributes); |
| 936 | |
Aric Cyr | ab2541b | 2016-12-29 15:27:12 -0500 | [diff] [blame] | 937 | bool dc_stream_set_cursor_position( |
Leo (Sunpeng) Li | 4fa086b9 | 2017-07-25 20:51:26 -0400 | [diff] [blame] | 938 | struct dc_stream *stream, |
Dmytro Laktyushkin | beb16b6 | 2017-04-21 09:34:09 -0400 | [diff] [blame] | 939 | const struct dc_cursor_position *position); |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 940 | |
| 941 | /* Newer interfaces */ |
| 942 | struct dc_cursor { |
| 943 | struct dc_plane_address address; |
| 944 | struct dc_cursor_attributes attributes; |
| 945 | }; |
| 946 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 947 | /******************************************************************************* |
| 948 | * Interrupt interfaces |
| 949 | ******************************************************************************/ |
| 950 | enum dc_irq_source dc_interrupt_to_irq_source( |
| 951 | struct dc *dc, |
| 952 | uint32_t src_id, |
| 953 | uint32_t ext_id); |
| 954 | void dc_interrupt_set(const struct dc *dc, enum dc_irq_source src, bool enable); |
| 955 | void dc_interrupt_ack(struct dc *dc, enum dc_irq_source src); |
| 956 | enum dc_irq_source dc_get_hpd_irq_source_at_index( |
| 957 | struct dc *dc, uint32_t link_index); |
| 958 | |
| 959 | /******************************************************************************* |
| 960 | * Power Interfaces |
| 961 | ******************************************************************************/ |
| 962 | |
| 963 | void dc_set_power_state( |
| 964 | struct dc *dc, |
Andrey Grodzovsky | a362148 | 2017-04-20 15:59:25 -0400 | [diff] [blame] | 965 | enum dc_acpi_cm_power_state power_state); |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 966 | void dc_resume(const struct dc *dc); |
| 967 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 968 | /* |
| 969 | * DPCD access interfaces |
| 970 | */ |
| 971 | |
Andrey Grodzovsky | 7c7f5b1 | 2017-03-28 16:57:52 -0400 | [diff] [blame] | 972 | bool dc_read_aux_dpcd( |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 973 | struct dc *dc, |
| 974 | uint32_t link_index, |
| 975 | uint32_t address, |
| 976 | uint8_t *data, |
| 977 | uint32_t size); |
| 978 | |
Andrey Grodzovsky | 7c7f5b1 | 2017-03-28 16:57:52 -0400 | [diff] [blame] | 979 | bool dc_write_aux_dpcd( |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 980 | struct dc *dc, |
| 981 | uint32_t link_index, |
| 982 | uint32_t address, |
| 983 | const uint8_t *data, |
Zeyu Fan | 2b230ea | 2017-02-16 16:15:30 -0500 | [diff] [blame] | 984 | uint32_t size); |
| 985 | |
Andrey Grodzovsky | 7c7f5b1 | 2017-03-28 16:57:52 -0400 | [diff] [blame] | 986 | bool dc_read_aux_i2c( |
| 987 | struct dc *dc, |
| 988 | uint32_t link_index, |
| 989 | enum i2c_mot_mode mot, |
| 990 | uint32_t address, |
| 991 | uint8_t *data, |
| 992 | uint32_t size); |
| 993 | |
| 994 | bool dc_write_aux_i2c( |
| 995 | struct dc *dc, |
| 996 | uint32_t link_index, |
| 997 | enum i2c_mot_mode mot, |
| 998 | uint32_t address, |
| 999 | const uint8_t *data, |
| 1000 | uint32_t size); |
| 1001 | |
Zeyu Fan | 2b230ea | 2017-02-16 16:15:30 -0500 | [diff] [blame] | 1002 | bool dc_query_ddc_data( |
| 1003 | struct dc *dc, |
| 1004 | uint32_t link_index, |
| 1005 | uint32_t address, |
| 1006 | uint8_t *write_buf, |
| 1007 | uint32_t write_size, |
| 1008 | uint8_t *read_buf, |
| 1009 | uint32_t read_size); |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 1010 | |
| 1011 | bool dc_submit_i2c( |
| 1012 | struct dc *dc, |
| 1013 | uint32_t link_index, |
| 1014 | struct i2c_command *cmd); |
| 1015 | |
Anthony Koo | 5e7773a | 2017-01-23 16:55:20 -0500 | [diff] [blame] | 1016 | |
Harry Wentland | 4562236 | 2017-09-12 15:58:20 -0400 | [diff] [blame] | 1017 | #endif /* DC_INTERFACE_H_ */ |