Lines Matching full:encoder

96 static void wait_for_cmds_dispatched_to_panel(struct intel_encoder *encoder)  in wait_for_cmds_dispatched_to_panel()  argument
98 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in wait_for_cmds_dispatched_to_panel()
99 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in wait_for_cmds_dispatched_to_panel()
231 static void dsi_program_swing_and_deemphasis(struct intel_encoder *encoder) in dsi_program_swing_and_deemphasis() argument
233 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in dsi_program_swing_and_deemphasis()
234 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in dsi_program_swing_and_deemphasis()
297 static void configure_dual_link_mode(struct intel_encoder *encoder, in configure_dual_link_mode() argument
300 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in configure_dual_link_mode()
301 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in configure_dual_link_mode()
338 static int afe_clk(struct intel_encoder *encoder, in afe_clk() argument
341 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in afe_clk()
352 static void gen11_dsi_program_esc_clk_div(struct intel_encoder *encoder, in gen11_dsi_program_esc_clk_div() argument
355 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_program_esc_clk_div()
356 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_program_esc_clk_div()
362 afe_clk_khz = afe_clk(encoder, crtc_state); in gen11_dsi_program_esc_clk_div()
409 static void gen11_dsi_enable_io_power(struct intel_encoder *encoder) in gen11_dsi_enable_io_power() argument
411 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_enable_io_power()
412 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_enable_io_power()
425 static void gen11_dsi_power_up_lanes(struct intel_encoder *encoder) in gen11_dsi_power_up_lanes() argument
427 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_power_up_lanes()
428 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_power_up_lanes()
436 static void gen11_dsi_config_phy_lanes_sequence(struct intel_encoder *encoder) in gen11_dsi_config_phy_lanes_sequence() argument
438 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_config_phy_lanes_sequence()
439 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_config_phy_lanes_sequence()
491 static void gen11_dsi_voltage_swing_program_seq(struct intel_encoder *encoder) in gen11_dsi_voltage_swing_program_seq() argument
493 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_voltage_swing_program_seq()
494 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_voltage_swing_program_seq()
530 dsi_program_swing_and_deemphasis(encoder); in gen11_dsi_voltage_swing_program_seq()
543 static void gen11_dsi_enable_ddi_buffer(struct intel_encoder *encoder) in gen11_dsi_enable_ddi_buffer() argument
545 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_enable_ddi_buffer()
546 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_enable_ddi_buffer()
564 gen11_dsi_setup_dphy_timings(struct intel_encoder *encoder, in gen11_dsi_setup_dphy_timings() argument
567 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_setup_dphy_timings()
568 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_setup_dphy_timings()
608 if (afe_clk(encoder, crtc_state) <= 800000) { in gen11_dsi_setup_dphy_timings()
638 static void gen11_dsi_gate_clocks(struct intel_encoder *encoder) in gen11_dsi_gate_clocks() argument
640 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_gate_clocks()
641 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_gate_clocks()
654 static void gen11_dsi_ungate_clocks(struct intel_encoder *encoder) in gen11_dsi_ungate_clocks() argument
656 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_ungate_clocks()
657 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_ungate_clocks()
670 static bool gen11_dsi_is_clock_enabled(struct intel_encoder *encoder) in gen11_dsi_is_clock_enabled() argument
672 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_is_clock_enabled()
673 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_is_clock_enabled()
688 static void gen11_dsi_map_pll(struct intel_encoder *encoder, in gen11_dsi_map_pll() argument
691 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_map_pll()
692 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_map_pll()
717 gen11_dsi_configure_transcoder(struct intel_encoder *encoder, in gen11_dsi_configure_transcoder() argument
720 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_configure_transcoder()
721 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_configure_transcoder()
738 if (afe_clk(encoder, pipe_config) >= 1500 * 1000) { in gen11_dsi_configure_transcoder()
834 configure_dual_link_mode(encoder, pipe_config); in gen11_dsi_configure_transcoder()
880 gen11_dsi_set_transcoder_timings(struct intel_encoder *encoder, in gen11_dsi_set_transcoder_timings() argument
883 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_set_transcoder_timings()
884 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_set_transcoder_timings()
933 byte_clk_period_ns = 1000000 / afe_clk(encoder, crtc_state); in gen11_dsi_set_transcoder_timings()
1040 static void gen11_dsi_enable_transcoder(struct intel_encoder *encoder) in gen11_dsi_enable_transcoder() argument
1042 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_enable_transcoder()
1043 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_enable_transcoder()
1062 static void gen11_dsi_setup_timeouts(struct intel_encoder *encoder, in gen11_dsi_setup_timeouts() argument
1065 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_setup_timeouts()
1066 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_setup_timeouts()
1078 divisor = intel_dsi_tlpx_ns(intel_dsi) * afe_clk(encoder, crtc_state) * 1000; in gen11_dsi_setup_timeouts()
1112 static void gen11_dsi_config_util_pin(struct intel_encoder *encoder, in gen11_dsi_config_util_pin() argument
1115 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_config_util_pin()
1116 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_config_util_pin()
1139 gen11_dsi_enable_port_and_phy(struct intel_encoder *encoder, in gen11_dsi_enable_port_and_phy() argument
1143 gen11_dsi_power_up_lanes(encoder); in gen11_dsi_enable_port_and_phy()
1146 gen11_dsi_config_phy_lanes_sequence(encoder); in gen11_dsi_enable_port_and_phy()
1149 gen11_dsi_voltage_swing_program_seq(encoder); in gen11_dsi_enable_port_and_phy()
1152 gen11_dsi_enable_ddi_buffer(encoder); in gen11_dsi_enable_port_and_phy()
1155 gen11_dsi_setup_dphy_timings(encoder, crtc_state); in gen11_dsi_enable_port_and_phy()
1158 gen11_dsi_config_util_pin(encoder, true); in gen11_dsi_enable_port_and_phy()
1161 gen11_dsi_setup_timeouts(encoder, crtc_state); in gen11_dsi_enable_port_and_phy()
1164 gen11_dsi_configure_transcoder(encoder, crtc_state); in gen11_dsi_enable_port_and_phy()
1167 gen11_dsi_gate_clocks(encoder); in gen11_dsi_enable_port_and_phy()
1170 static void gen11_dsi_powerup_panel(struct intel_encoder *encoder) in gen11_dsi_powerup_panel() argument
1172 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_powerup_panel()
1173 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_powerup_panel()
1207 wait_for_cmds_dispatched_to_panel(encoder); in gen11_dsi_powerup_panel()
1211 struct intel_encoder *encoder, in gen11_dsi_pre_pll_enable() argument
1216 gen11_dsi_enable_io_power(encoder); in gen11_dsi_pre_pll_enable()
1219 gen11_dsi_program_esc_clk_div(encoder, crtc_state); in gen11_dsi_pre_pll_enable()
1223 struct intel_encoder *encoder, in gen11_dsi_pre_enable() argument
1228 gen11_dsi_map_pll(encoder, pipe_config); in gen11_dsi_pre_enable()
1231 gen11_dsi_enable_port_and_phy(encoder, pipe_config); in gen11_dsi_pre_enable()
1234 gen11_dsi_powerup_panel(encoder); in gen11_dsi_pre_enable()
1236 intel_dsc_dsi_pps_write(encoder, pipe_config); in gen11_dsi_pre_enable()
1239 gen11_dsi_set_transcoder_timings(encoder, pipe_config); in gen11_dsi_pre_enable()
1249 static void icl_apply_kvmr_pipe_a_wa(struct intel_encoder *encoder, in icl_apply_kvmr_pipe_a_wa() argument
1252 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in icl_apply_kvmr_pipe_a_wa()
1266 static void adlp_set_lp_hs_wakeup_gb(struct intel_encoder *encoder) in adlp_set_lp_hs_wakeup_gb() argument
1268 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in adlp_set_lp_hs_wakeup_gb()
1269 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in adlp_set_lp_hs_wakeup_gb()
1281 struct intel_encoder *encoder, in gen11_dsi_enable() argument
1285 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_enable()
1291 icl_apply_kvmr_pipe_a_wa(encoder, crtc->pipe, true); in gen11_dsi_enable()
1294 adlp_set_lp_hs_wakeup_gb(encoder); in gen11_dsi_enable()
1297 gen11_dsi_enable_transcoder(encoder); in gen11_dsi_enable()
1306 static void gen11_dsi_disable_transcoder(struct intel_encoder *encoder) in gen11_dsi_disable_transcoder() argument
1308 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_disable_transcoder()
1309 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_disable_transcoder()
1330 static void gen11_dsi_powerdown_panel(struct intel_encoder *encoder) in gen11_dsi_powerdown_panel() argument
1332 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_powerdown_panel()
1339 wait_for_cmds_dispatched_to_panel(encoder); in gen11_dsi_powerdown_panel()
1342 static void gen11_dsi_deconfigure_trancoder(struct intel_encoder *encoder) in gen11_dsi_deconfigure_trancoder() argument
1344 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_deconfigure_trancoder()
1345 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_deconfigure_trancoder()
1394 static void gen11_dsi_disable_port(struct intel_encoder *encoder) in gen11_dsi_disable_port() argument
1396 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_disable_port()
1397 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_disable_port()
1401 gen11_dsi_ungate_clocks(encoder); in gen11_dsi_disable_port()
1414 gen11_dsi_gate_clocks(encoder); in gen11_dsi_disable_port()
1417 static void gen11_dsi_disable_io_power(struct intel_encoder *encoder) in gen11_dsi_disable_io_power() argument
1419 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_disable_io_power()
1420 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_disable_io_power()
1444 struct intel_encoder *encoder, in gen11_dsi_disable() argument
1448 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_disable()
1456 gen11_dsi_disable_transcoder(encoder); in gen11_dsi_disable()
1459 icl_apply_kvmr_pipe_a_wa(encoder, crtc->pipe, false); in gen11_dsi_disable()
1462 gen11_dsi_powerdown_panel(encoder); in gen11_dsi_disable()
1465 gen11_dsi_deconfigure_trancoder(encoder); in gen11_dsi_disable()
1468 gen11_dsi_disable_port(encoder); in gen11_dsi_disable()
1470 gen11_dsi_config_util_pin(encoder, false); in gen11_dsi_disable()
1473 gen11_dsi_disable_io_power(encoder); in gen11_dsi_disable()
1477 struct intel_encoder *encoder, in gen11_dsi_post_disable() argument
1495 static void gen11_dsi_get_timings(struct intel_encoder *encoder, in gen11_dsi_get_timings() argument
1498 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_get_timings()
1562 static void gen11_dsi_get_config(struct intel_encoder *encoder, in gen11_dsi_get_config() argument
1566 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_get_config()
1568 intel_ddi_get_clock(encoder, pipe_config, icl_ddi_combo_get_pll(encoder)); in gen11_dsi_get_config()
1574 gen11_dsi_get_timings(encoder, pipe_config); in gen11_dsi_get_config()
1586 static void gen11_dsi_sync_state(struct intel_encoder *encoder, in gen11_dsi_sync_state() argument
1589 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_sync_state()
1603 "[ENCODER:%d:%s] BIOS left IGNORE_KVMR_PIPE_A cleared with pipe B enabled\n", in gen11_dsi_sync_state()
1604 encoder->base.base.id, in gen11_dsi_sync_state()
1605 encoder->base.name); in gen11_dsi_sync_state()
1608 static int gen11_dsi_dsc_compute_config(struct intel_encoder *encoder, in gen11_dsi_dsc_compute_config() argument
1611 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_dsc_compute_config()
1617 use_dsc = intel_bios_get_dsc_params(encoder, crtc_state, dsc_max_bpc); in gen11_dsi_dsc_compute_config()
1657 static int gen11_dsi_compute_config(struct intel_encoder *encoder, in gen11_dsi_compute_config() argument
1661 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in gen11_dsi_compute_config()
1662 struct intel_dsi *intel_dsi = container_of(encoder, struct intel_dsi, in gen11_dsi_compute_config()
1694 if (gen11_dsi_dsc_compute_config(encoder, pipe_config)) in gen11_dsi_compute_config()
1697 pipe_config->port_clock = afe_clk(encoder, pipe_config) / 5; in gen11_dsi_compute_config()
1710 static void gen11_dsi_get_power_domains(struct intel_encoder *encoder, in gen11_dsi_get_power_domains() argument
1713 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in gen11_dsi_get_power_domains()
1716 enc_to_intel_dsi(encoder)); in gen11_dsi_get_power_domains()
1719 static bool gen11_dsi_get_hw_state(struct intel_encoder *encoder, in gen11_dsi_get_hw_state() argument
1722 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_get_hw_state()
1723 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_get_hw_state()
1731 encoder->power_domain); in gen11_dsi_get_hw_state()
1760 intel_display_power_put(dev_priv, encoder->power_domain, wakeref); in gen11_dsi_get_hw_state()
1764 static bool gen11_dsi_initial_fastset_check(struct intel_encoder *encoder, in gen11_dsi_initial_fastset_check() argument
1768 drm_dbg_kms(encoder->base.dev, "Forcing full modeset due to DSC being enabled\n"); in gen11_dsi_initial_fastset_check()
1777 static void gen11_dsi_encoder_destroy(struct drm_encoder *encoder) in gen11_dsi_encoder_destroy() argument
1779 intel_encoder_destroy(encoder); in gen11_dsi_encoder_destroy()
1998 struct intel_encoder *encoder; in icl_dsi_init() local
2016 encoder = &intel_dsi->base; in icl_dsi_init()
2020 /* register DSI encoder with DRM subsystem */ in icl_dsi_init()
2021 drm_encoder_init(dev, &encoder->base, &gen11_dsi_encoder_funcs, in icl_dsi_init()
2024 encoder->pre_pll_enable = gen11_dsi_pre_pll_enable; in icl_dsi_init()
2025 encoder->pre_enable = gen11_dsi_pre_enable; in icl_dsi_init()
2026 encoder->enable = gen11_dsi_enable; in icl_dsi_init()
2027 encoder->disable = gen11_dsi_disable; in icl_dsi_init()
2028 encoder->post_disable = gen11_dsi_post_disable; in icl_dsi_init()
2029 encoder->port = port; in icl_dsi_init()
2030 encoder->get_config = gen11_dsi_get_config; in icl_dsi_init()
2031 encoder->sync_state = gen11_dsi_sync_state; in icl_dsi_init()
2032 encoder->update_pipe = intel_backlight_update; in icl_dsi_init()
2033 encoder->compute_config = gen11_dsi_compute_config; in icl_dsi_init()
2034 encoder->get_hw_state = gen11_dsi_get_hw_state; in icl_dsi_init()
2035 encoder->initial_fastset_check = gen11_dsi_initial_fastset_check; in icl_dsi_init()
2036 encoder->type = INTEL_OUTPUT_DSI; in icl_dsi_init()
2037 encoder->cloneable = 0; in icl_dsi_init()
2038 encoder->pipe_mask = ~0; in icl_dsi_init()
2039 encoder->power_domain = POWER_DOMAIN_PORT_DSI; in icl_dsi_init()
2040 encoder->get_power_domains = gen11_dsi_get_power_domains; in icl_dsi_init()
2041 encoder->disable_clock = gen11_dsi_gate_clocks; in icl_dsi_init()
2042 encoder->is_clock_enabled = gen11_dsi_is_clock_enabled; in icl_dsi_init()
2053 /* attach connector to encoder */ in icl_dsi_init()
2054 intel_connector_attach_encoder(intel_connector, encoder); in icl_dsi_init()
2104 drm_encoder_cleanup(&encoder->base); in icl_dsi_init()