| .. | .. |
|---|
| 59 | 59 | struct drr_params { |
|---|
| 60 | 60 | uint32_t vertical_total_min; |
|---|
| 61 | 61 | uint32_t vertical_total_max; |
|---|
| 62 | + uint32_t vertical_total_mid; |
|---|
| 63 | + uint32_t vertical_total_mid_frame_num; |
|---|
| 62 | 64 | bool immediate_flip; |
|---|
| 63 | 65 | }; |
|---|
| 64 | 66 | |
|---|
| .. | .. |
|---|
| 68 | 70 | enum crtc_state { |
|---|
| 69 | 71 | CRTC_STATE_VBLANK = 0, |
|---|
| 70 | 72 | CRTC_STATE_VACTIVE |
|---|
| 71 | | -}; |
|---|
| 72 | | - |
|---|
| 73 | | -struct _dlg_otg_param { |
|---|
| 74 | | - int vstartup_start; |
|---|
| 75 | | - int vupdate_offset; |
|---|
| 76 | | - int vupdate_width; |
|---|
| 77 | | - int vready_offset; |
|---|
| 78 | | - enum signal_type signal; |
|---|
| 79 | 73 | }; |
|---|
| 80 | 74 | |
|---|
| 81 | 75 | struct vupdate_keepout_params { |
|---|
| .. | .. |
|---|
| 104 | 98 | INTERSECT_WINDOW_NOT_A_NOT_B, |
|---|
| 105 | 99 | }; |
|---|
| 106 | 100 | |
|---|
| 101 | +#ifdef CONFIG_DRM_AMD_DC_DCN3_0 |
|---|
| 102 | +enum otg_out_mux_dest { |
|---|
| 103 | + OUT_MUX_DIO = 0, |
|---|
| 104 | +}; |
|---|
| 105 | +#endif |
|---|
| 106 | + |
|---|
| 107 | +enum h_timing_div_mode { |
|---|
| 108 | + H_TIMING_NO_DIV, |
|---|
| 109 | + H_TIMING_DIV_BY2, |
|---|
| 110 | +#if defined(CONFIG_DRM_AMD_DC_DCN3_0) |
|---|
| 111 | + H_TIMING_RESERVED, |
|---|
| 112 | + H_TIMING_DIV_BY4, |
|---|
| 113 | +#endif |
|---|
| 114 | +}; |
|---|
| 115 | + |
|---|
| 107 | 116 | struct crc_params { |
|---|
| 108 | 117 | /* Regions used to calculate CRC*/ |
|---|
| 109 | 118 | uint16_t windowa_x_start; |
|---|
| .. | .. |
|---|
| 118 | 127 | |
|---|
| 119 | 128 | enum crc_selection selection; |
|---|
| 120 | 129 | |
|---|
| 130 | + uint8_t dsc_mode; |
|---|
| 131 | + uint8_t odm_mode; |
|---|
| 132 | + |
|---|
| 121 | 133 | bool continuous_mode; |
|---|
| 122 | 134 | bool enable; |
|---|
| 123 | 135 | }; |
|---|
| .. | .. |
|---|
| 126 | 138 | const struct timing_generator_funcs *funcs; |
|---|
| 127 | 139 | struct dc_bios *bp; |
|---|
| 128 | 140 | struct dc_context *ctx; |
|---|
| 129 | | - struct _dlg_otg_param dlg_otg_param; |
|---|
| 130 | 141 | int inst; |
|---|
| 131 | 142 | }; |
|---|
| 132 | 143 | |
|---|
| .. | .. |
|---|
| 134 | 145 | |
|---|
| 135 | 146 | struct drr_params; |
|---|
| 136 | 147 | |
|---|
| 148 | + |
|---|
| 137 | 149 | struct timing_generator_funcs { |
|---|
| 138 | 150 | bool (*validate_timing)(struct timing_generator *tg, |
|---|
| 139 | 151 | const struct dc_crtc_timing *timing); |
|---|
| 140 | 152 | void (*program_timing)(struct timing_generator *tg, |
|---|
| 141 | 153 | const struct dc_crtc_timing *timing, |
|---|
| 142 | | - bool use_vbios); |
|---|
| 143 | | - void (*program_vline_interrupt)(struct timing_generator *optc, |
|---|
| 144 | | - const struct dc_crtc_timing *dc_crtc_timing, |
|---|
| 145 | | - unsigned long long vsync_delta); |
|---|
| 154 | + int vready_offset, |
|---|
| 155 | + int vstartup_start, |
|---|
| 156 | + int vupdate_offset, |
|---|
| 157 | + int vupdate_width, |
|---|
| 158 | + const enum signal_type signal, |
|---|
| 159 | + bool use_vbios |
|---|
| 160 | + ); |
|---|
| 161 | + void (*setup_vertical_interrupt0)( |
|---|
| 162 | + struct timing_generator *optc, |
|---|
| 163 | + uint32_t start_line, |
|---|
| 164 | + uint32_t end_line); |
|---|
| 165 | + void (*setup_vertical_interrupt1)( |
|---|
| 166 | + struct timing_generator *optc, |
|---|
| 167 | + uint32_t start_line); |
|---|
| 168 | + void (*setup_vertical_interrupt2)( |
|---|
| 169 | + struct timing_generator *optc, |
|---|
| 170 | + uint32_t start_line); |
|---|
| 171 | + |
|---|
| 146 | 172 | bool (*enable_crtc)(struct timing_generator *tg); |
|---|
| 147 | 173 | bool (*disable_crtc)(struct timing_generator *tg); |
|---|
| 148 | 174 | bool (*is_counter_moving)(struct timing_generator *tg); |
|---|
| .. | .. |
|---|
| 159 | 185 | bool (*get_otg_active_size)(struct timing_generator *optc, |
|---|
| 160 | 186 | uint32_t *otg_active_width, |
|---|
| 161 | 187 | uint32_t *otg_active_height); |
|---|
| 188 | + bool (*is_matching_timing)(struct timing_generator *tg, |
|---|
| 189 | + const struct dc_crtc_timing *otg_timing); |
|---|
| 162 | 190 | void (*set_early_control)(struct timing_generator *tg, |
|---|
| 163 | 191 | uint32_t early_cntl); |
|---|
| 164 | 192 | void (*wait_for_state)(struct timing_generator *tg, |
|---|
| .. | .. |
|---|
| 178 | 206 | const struct dcp_gsl_params *gsl_params); |
|---|
| 179 | 207 | void (*unlock)(struct timing_generator *tg); |
|---|
| 180 | 208 | void (*lock)(struct timing_generator *tg); |
|---|
| 209 | + void (*lock_doublebuffer_disable)(struct timing_generator *tg); |
|---|
| 210 | + void (*lock_doublebuffer_enable)(struct timing_generator *tg); |
|---|
| 211 | + void(*triplebuffer_unlock)(struct timing_generator *tg); |
|---|
| 212 | + void(*triplebuffer_lock)(struct timing_generator *tg); |
|---|
| 181 | 213 | void (*enable_reset_trigger)(struct timing_generator *tg, |
|---|
| 182 | 214 | int source_tg_inst); |
|---|
| 183 | 215 | void (*enable_crtc_reset)(struct timing_generator *tg, |
|---|
| .. | .. |
|---|
| 189 | 221 | bool enable, const struct dc_crtc_timing *timing); |
|---|
| 190 | 222 | void (*set_drr)(struct timing_generator *tg, const struct drr_params *params); |
|---|
| 191 | 223 | void (*set_static_screen_control)(struct timing_generator *tg, |
|---|
| 192 | | - uint32_t value); |
|---|
| 224 | + uint32_t event_triggers, |
|---|
| 225 | + uint32_t num_frames); |
|---|
| 193 | 226 | void (*set_test_pattern)( |
|---|
| 194 | 227 | struct timing_generator *tg, |
|---|
| 195 | 228 | enum controller_dp_test_pattern test_pattern, |
|---|
| .. | .. |
|---|
| 197 | 230 | |
|---|
| 198 | 231 | bool (*arm_vert_intr)(struct timing_generator *tg, uint8_t width); |
|---|
| 199 | 232 | |
|---|
| 200 | | - void (*program_global_sync)(struct timing_generator *tg); |
|---|
| 233 | + void (*program_global_sync)(struct timing_generator *tg, |
|---|
| 234 | + int vready_offset, |
|---|
| 235 | + int vstartup_start, |
|---|
| 236 | + int vupdate_offset, |
|---|
| 237 | + int vupdate_width); |
|---|
| 201 | 238 | void (*enable_optc_clock)(struct timing_generator *tg, bool enable); |
|---|
| 202 | 239 | void (*program_stereo)(struct timing_generator *tg, |
|---|
| 203 | 240 | const struct dc_crtc_timing *timing, struct crtc_stereo_flags *flags); |
|---|
| .. | .. |
|---|
| 209 | 246 | bool (*is_tg_enabled)(struct timing_generator *tg); |
|---|
| 210 | 247 | bool (*is_optc_underflow_occurred)(struct timing_generator *tg); |
|---|
| 211 | 248 | void (*clear_optc_underflow)(struct timing_generator *tg); |
|---|
| 249 | + |
|---|
| 250 | + void (*set_dwb_source)(struct timing_generator *optc, |
|---|
| 251 | + uint32_t dwb_pipe_inst); |
|---|
| 252 | + |
|---|
| 253 | + void (*get_optc_source)(struct timing_generator *optc, |
|---|
| 254 | + uint32_t *num_of_input_segments, |
|---|
| 255 | + uint32_t *seg0_src_sel, |
|---|
| 256 | + uint32_t *seg1_src_sel); |
|---|
| 212 | 257 | |
|---|
| 213 | 258 | /** |
|---|
| 214 | 259 | * Configure CRCs for the given timing generator. Return false if TG is |
|---|
| .. | .. |
|---|
| 224 | 269 | bool (*get_crc)(struct timing_generator *tg, |
|---|
| 225 | 270 | uint32_t *r_cr, uint32_t *g_y, uint32_t *b_cb); |
|---|
| 226 | 271 | |
|---|
| 272 | + void (*program_manual_trigger)(struct timing_generator *optc); |
|---|
| 273 | + void (*setup_manual_trigger)(struct timing_generator *optc); |
|---|
| 274 | + bool (*get_hw_timing)(struct timing_generator *optc, |
|---|
| 275 | + struct dc_crtc_timing *hw_crtc_timing); |
|---|
| 276 | + |
|---|
| 277 | + void (*set_vtg_params)(struct timing_generator *optc, |
|---|
| 278 | + const struct dc_crtc_timing *dc_crtc_timing); |
|---|
| 279 | + |
|---|
| 280 | + void (*set_dsc_config)(struct timing_generator *optc, |
|---|
| 281 | + enum optc_dsc_mode dsc_mode, |
|---|
| 282 | + uint32_t dsc_bytes_per_pixel, |
|---|
| 283 | + uint32_t dsc_slice_width); |
|---|
| 284 | + void (*set_odm_bypass)(struct timing_generator *optc, const struct dc_crtc_timing *dc_crtc_timing); |
|---|
| 285 | + void (*set_odm_combine)(struct timing_generator *optc, int *opp_id, int opp_cnt, |
|---|
| 286 | + struct dc_crtc_timing *timing); |
|---|
| 287 | + void (*set_gsl)(struct timing_generator *optc, const struct gsl_params *params); |
|---|
| 288 | + void (*set_gsl_source_select)(struct timing_generator *optc, |
|---|
| 289 | + int group_idx, |
|---|
| 290 | + uint32_t gsl_ready_signal); |
|---|
| 291 | +#if defined(CONFIG_DRM_AMD_DC_DCN3_0) |
|---|
| 292 | + void (*set_out_mux)(struct timing_generator *tg, enum otg_out_mux_dest dest); |
|---|
| 293 | + void (*set_vrr_m_const)(struct timing_generator *optc, |
|---|
| 294 | + double vtotal_avg); |
|---|
| 295 | + void (*set_drr_trigger_window)(struct timing_generator *optc, |
|---|
| 296 | + uint32_t window_start, uint32_t window_end); |
|---|
| 297 | + void (*set_vtotal_change_limit)(struct timing_generator *optc, |
|---|
| 298 | + uint32_t limit); |
|---|
| 299 | +#endif |
|---|
| 227 | 300 | }; |
|---|
| 228 | 301 | |
|---|
| 229 | 302 | #endif |
|---|