Lines Matching full:encoder
98 static void wait_for_cmds_dispatched_to_panel(struct intel_encoder *encoder) in wait_for_cmds_dispatched_to_panel() argument
100 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in wait_for_cmds_dispatched_to_panel()
101 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()
276 static void configure_dual_link_mode(struct intel_encoder *encoder, in configure_dual_link_mode() argument
279 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in configure_dual_link_mode()
280 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in configure_dual_link_mode()
326 static int afe_clk(struct intel_encoder *encoder, in afe_clk() argument
329 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in afe_clk()
340 static void gen11_dsi_program_esc_clk_div(struct intel_encoder *encoder, in gen11_dsi_program_esc_clk_div() argument
343 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_program_esc_clk_div()
344 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_program_esc_clk_div()
350 afe_clk_khz = afe_clk(encoder, crtc_state); in gen11_dsi_program_esc_clk_div()
397 static void gen11_dsi_enable_io_power(struct intel_encoder *encoder) in gen11_dsi_enable_io_power() argument
399 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_enable_io_power()
400 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_enable_io_power()
410 static void gen11_dsi_power_up_lanes(struct intel_encoder *encoder) in gen11_dsi_power_up_lanes() argument
412 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_power_up_lanes()
413 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_power_up_lanes()
421 static void gen11_dsi_config_phy_lanes_sequence(struct intel_encoder *encoder) in gen11_dsi_config_phy_lanes_sequence() argument
423 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_config_phy_lanes_sequence()
424 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_config_phy_lanes_sequence()
463 static void gen11_dsi_voltage_swing_program_seq(struct intel_encoder *encoder) in gen11_dsi_voltage_swing_program_seq() argument
465 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_voltage_swing_program_seq()
466 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_voltage_swing_program_seq()
495 dsi_program_swing_and_deemphasis(encoder); in gen11_dsi_voltage_swing_program_seq()
506 static void gen11_dsi_enable_ddi_buffer(struct intel_encoder *encoder) in gen11_dsi_enable_ddi_buffer() argument
508 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_enable_ddi_buffer()
509 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_enable_ddi_buffer()
524 gen11_dsi_setup_dphy_timings(struct intel_encoder *encoder, in gen11_dsi_setup_dphy_timings() argument
527 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_setup_dphy_timings()
528 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_setup_dphy_timings()
549 if (afe_clk(encoder, crtc_state) <= 800000) { in gen11_dsi_setup_dphy_timings()
565 gen11_dsi_setup_timings(struct intel_encoder *encoder, in gen11_dsi_setup_timings() argument
568 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_setup_timings()
569 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_setup_timings()
589 if (afe_clk(encoder, crtc_state) <= 800000) { in gen11_dsi_setup_timings()
599 static void gen11_dsi_gate_clocks(struct intel_encoder *encoder) in gen11_dsi_gate_clocks() argument
601 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_gate_clocks()
602 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_gate_clocks()
615 static void gen11_dsi_ungate_clocks(struct intel_encoder *encoder) in gen11_dsi_ungate_clocks() argument
617 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_ungate_clocks()
618 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_ungate_clocks()
631 static bool gen11_dsi_is_clock_enabled(struct intel_encoder *encoder) in gen11_dsi_is_clock_enabled() argument
633 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_is_clock_enabled()
634 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_is_clock_enabled()
649 static void gen11_dsi_map_pll(struct intel_encoder *encoder, in gen11_dsi_map_pll() argument
652 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_map_pll()
653 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_map_pll()
678 gen11_dsi_configure_transcoder(struct intel_encoder *encoder, in gen11_dsi_configure_transcoder() argument
681 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_configure_transcoder()
682 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_configure_transcoder()
699 if (afe_clk(encoder, pipe_config) >= 1500 * 1000) { in gen11_dsi_configure_transcoder()
792 configure_dual_link_mode(encoder, pipe_config); in gen11_dsi_configure_transcoder()
838 gen11_dsi_set_transcoder_timings(struct intel_encoder *encoder, in gen11_dsi_set_transcoder_timings() argument
841 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_set_transcoder_timings()
842 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_set_transcoder_timings()
891 byte_clk_period_ns = 1000000 / afe_clk(encoder, crtc_state); in gen11_dsi_set_transcoder_timings()
1003 static void gen11_dsi_enable_transcoder(struct intel_encoder *encoder) in gen11_dsi_enable_transcoder() argument
1005 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_enable_transcoder()
1006 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_enable_transcoder()
1022 static void gen11_dsi_setup_timeouts(struct intel_encoder *encoder, in gen11_dsi_setup_timeouts() argument
1025 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_setup_timeouts()
1026 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_setup_timeouts()
1038 divisor = intel_dsi_tlpx_ns(intel_dsi) * afe_clk(encoder, crtc_state) * 1000; in gen11_dsi_setup_timeouts()
1069 static void gen11_dsi_config_util_pin(struct intel_encoder *encoder, in gen11_dsi_config_util_pin() argument
1072 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_config_util_pin()
1073 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_config_util_pin()
1096 gen11_dsi_enable_port_and_phy(struct intel_encoder *encoder, in gen11_dsi_enable_port_and_phy() argument
1100 gen11_dsi_power_up_lanes(encoder); in gen11_dsi_enable_port_and_phy()
1103 gen11_dsi_config_phy_lanes_sequence(encoder); in gen11_dsi_enable_port_and_phy()
1106 gen11_dsi_voltage_swing_program_seq(encoder); in gen11_dsi_enable_port_and_phy()
1109 gen11_dsi_setup_dphy_timings(encoder, crtc_state); in gen11_dsi_enable_port_and_phy()
1112 gen11_dsi_enable_ddi_buffer(encoder); in gen11_dsi_enable_port_and_phy()
1114 gen11_dsi_gate_clocks(encoder); in gen11_dsi_enable_port_and_phy()
1116 gen11_dsi_setup_timings(encoder, crtc_state); in gen11_dsi_enable_port_and_phy()
1119 gen11_dsi_config_util_pin(encoder, true); in gen11_dsi_enable_port_and_phy()
1122 gen11_dsi_setup_timeouts(encoder, crtc_state); in gen11_dsi_enable_port_and_phy()
1125 gen11_dsi_configure_transcoder(encoder, crtc_state); in gen11_dsi_enable_port_and_phy()
1128 static void gen11_dsi_powerup_panel(struct intel_encoder *encoder) in gen11_dsi_powerup_panel() argument
1130 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_powerup_panel()
1131 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_powerup_panel()
1160 wait_for_cmds_dispatched_to_panel(encoder); in gen11_dsi_powerup_panel()
1164 struct intel_encoder *encoder, in gen11_dsi_pre_pll_enable() argument
1168 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_pre_pll_enable()
1177 gen11_dsi_enable_io_power(encoder); in gen11_dsi_pre_pll_enable()
1180 gen11_dsi_program_esc_clk_div(encoder, crtc_state); in gen11_dsi_pre_pll_enable()
1184 struct intel_encoder *encoder, in gen11_dsi_pre_enable() argument
1189 gen11_dsi_map_pll(encoder, pipe_config); in gen11_dsi_pre_enable()
1192 gen11_dsi_enable_port_and_phy(encoder, pipe_config); in gen11_dsi_pre_enable()
1195 gen11_dsi_powerup_panel(encoder); in gen11_dsi_pre_enable()
1197 intel_dsc_dsi_pps_write(encoder, pipe_config); in gen11_dsi_pre_enable()
1200 gen11_dsi_set_transcoder_timings(encoder, pipe_config); in gen11_dsi_pre_enable()
1210 static void icl_apply_kvmr_pipe_a_wa(struct intel_encoder *encoder, in icl_apply_kvmr_pipe_a_wa() argument
1213 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in icl_apply_kvmr_pipe_a_wa()
1227 static void adlp_set_lp_hs_wakeup_gb(struct intel_encoder *encoder) in adlp_set_lp_hs_wakeup_gb() argument
1229 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in adlp_set_lp_hs_wakeup_gb()
1230 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in adlp_set_lp_hs_wakeup_gb()
1242 struct intel_encoder *encoder, in gen11_dsi_enable() argument
1246 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_enable()
1250 icl_apply_kvmr_pipe_a_wa(encoder, crtc->pipe, true); in gen11_dsi_enable()
1253 adlp_set_lp_hs_wakeup_gb(encoder); in gen11_dsi_enable()
1256 gen11_dsi_enable_transcoder(encoder); in gen11_dsi_enable()
1267 static void gen11_dsi_disable_transcoder(struct intel_encoder *encoder) in gen11_dsi_disable_transcoder() argument
1269 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_disable_transcoder()
1270 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_disable_transcoder()
1288 static void gen11_dsi_powerdown_panel(struct intel_encoder *encoder) in gen11_dsi_powerdown_panel() argument
1290 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_powerdown_panel()
1295 wait_for_cmds_dispatched_to_panel(encoder); in gen11_dsi_powerdown_panel()
1298 static void gen11_dsi_deconfigure_trancoder(struct intel_encoder *encoder) in gen11_dsi_deconfigure_trancoder() argument
1300 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_deconfigure_trancoder()
1301 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_deconfigure_trancoder()
1344 static void gen11_dsi_disable_port(struct intel_encoder *encoder) in gen11_dsi_disable_port() argument
1346 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_disable_port()
1347 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_disable_port()
1350 gen11_dsi_ungate_clocks(encoder); in gen11_dsi_disable_port()
1361 gen11_dsi_gate_clocks(encoder); in gen11_dsi_disable_port()
1364 static void gen11_dsi_disable_io_power(struct intel_encoder *encoder) in gen11_dsi_disable_io_power() argument
1366 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_disable_io_power()
1367 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_disable_io_power()
1388 struct intel_encoder *encoder, in gen11_dsi_disable() argument
1392 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_disable()
1400 struct intel_encoder *encoder, in gen11_dsi_post_disable() argument
1404 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_post_disable()
1410 gen11_dsi_disable_transcoder(encoder); in gen11_dsi_post_disable()
1413 icl_apply_kvmr_pipe_a_wa(encoder, crtc->pipe, false); in gen11_dsi_post_disable()
1416 gen11_dsi_powerdown_panel(encoder); in gen11_dsi_post_disable()
1419 gen11_dsi_deconfigure_trancoder(encoder); in gen11_dsi_post_disable()
1425 gen11_dsi_disable_port(encoder); in gen11_dsi_post_disable()
1427 gen11_dsi_config_util_pin(encoder, false); in gen11_dsi_post_disable()
1430 gen11_dsi_disable_io_power(encoder); in gen11_dsi_post_disable()
1454 static void gen11_dsi_get_timings(struct intel_encoder *encoder, in gen11_dsi_get_timings() argument
1457 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_get_timings()
1521 static void gen11_dsi_get_config(struct intel_encoder *encoder, in gen11_dsi_get_config() argument
1525 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_get_config()
1527 intel_ddi_get_clock(encoder, pipe_config, icl_ddi_combo_get_pll(encoder)); in gen11_dsi_get_config()
1533 gen11_dsi_get_timings(encoder, pipe_config); in gen11_dsi_get_config()
1545 static void gen11_dsi_sync_state(struct intel_encoder *encoder, in gen11_dsi_sync_state() argument
1548 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_sync_state()
1562 "[ENCODER:%d:%s] BIOS left IGNORE_KVMR_PIPE_A cleared with pipe B enabled\n", in gen11_dsi_sync_state()
1563 encoder->base.base.id, in gen11_dsi_sync_state()
1564 encoder->base.name); in gen11_dsi_sync_state()
1567 static int gen11_dsi_dsc_compute_config(struct intel_encoder *encoder, in gen11_dsi_dsc_compute_config() argument
1570 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_dsc_compute_config()
1576 use_dsc = intel_bios_get_dsc_params(encoder, crtc_state, dsc_max_bpc); in gen11_dsi_dsc_compute_config()
1614 static int gen11_dsi_compute_config(struct intel_encoder *encoder, in gen11_dsi_compute_config() argument
1618 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in gen11_dsi_compute_config()
1619 struct intel_dsi *intel_dsi = container_of(encoder, struct intel_dsi, in gen11_dsi_compute_config()
1652 if (gen11_dsi_dsc_compute_config(encoder, pipe_config)) in gen11_dsi_compute_config()
1655 pipe_config->port_clock = afe_clk(encoder, pipe_config) / 5; in gen11_dsi_compute_config()
1668 static void gen11_dsi_get_power_domains(struct intel_encoder *encoder, in gen11_dsi_get_power_domains() argument
1671 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in gen11_dsi_get_power_domains()
1674 enc_to_intel_dsi(encoder)); in gen11_dsi_get_power_domains()
1677 static bool gen11_dsi_get_hw_state(struct intel_encoder *encoder, in gen11_dsi_get_hw_state() argument
1680 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_get_hw_state()
1681 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_get_hw_state()
1689 encoder->power_domain); in gen11_dsi_get_hw_state()
1718 intel_display_power_put(dev_priv, encoder->power_domain, wakeref); in gen11_dsi_get_hw_state()
1722 static bool gen11_dsi_initial_fastset_check(struct intel_encoder *encoder, in gen11_dsi_initial_fastset_check() argument
1726 drm_dbg_kms(encoder->base.dev, "Forcing full modeset due to DSC being enabled\n"); in gen11_dsi_initial_fastset_check()
1735 static void gen11_dsi_encoder_destroy(struct drm_encoder *encoder) in gen11_dsi_encoder_destroy() argument
1737 intel_encoder_destroy(encoder); in gen11_dsi_encoder_destroy()
1948 struct intel_encoder *encoder; in icl_dsi_init() local
1967 encoder = &intel_dsi->base; in icl_dsi_init()
1971 encoder->devdata = devdata; in icl_dsi_init()
1973 /* register DSI encoder with DRM subsystem */ in icl_dsi_init()
1974 drm_encoder_init(&dev_priv->drm, &encoder->base, &gen11_dsi_encoder_funcs, in icl_dsi_init()
1977 encoder->pre_pll_enable = gen11_dsi_pre_pll_enable; in icl_dsi_init()
1978 encoder->pre_enable = gen11_dsi_pre_enable; in icl_dsi_init()
1979 encoder->enable = gen11_dsi_enable; in icl_dsi_init()
1980 encoder->disable = gen11_dsi_disable; in icl_dsi_init()
1981 encoder->post_disable = gen11_dsi_post_disable; in icl_dsi_init()
1982 encoder->port = port; in icl_dsi_init()
1983 encoder->get_config = gen11_dsi_get_config; in icl_dsi_init()
1984 encoder->sync_state = gen11_dsi_sync_state; in icl_dsi_init()
1985 encoder->update_pipe = intel_backlight_update; in icl_dsi_init()
1986 encoder->compute_config = gen11_dsi_compute_config; in icl_dsi_init()
1987 encoder->get_hw_state = gen11_dsi_get_hw_state; in icl_dsi_init()
1988 encoder->initial_fastset_check = gen11_dsi_initial_fastset_check; in icl_dsi_init()
1989 encoder->type = INTEL_OUTPUT_DSI; in icl_dsi_init()
1990 encoder->cloneable = 0; in icl_dsi_init()
1991 encoder->pipe_mask = ~0; in icl_dsi_init()
1992 encoder->power_domain = POWER_DOMAIN_PORT_DSI; in icl_dsi_init()
1993 encoder->get_power_domains = gen11_dsi_get_power_domains; in icl_dsi_init()
1994 encoder->disable_clock = gen11_dsi_gate_clocks; in icl_dsi_init()
1995 encoder->is_clock_enabled = gen11_dsi_is_clock_enabled; in icl_dsi_init()
1996 encoder->shutdown = intel_dsi_shutdown; in icl_dsi_init()
2005 /* attach connector to encoder */ in icl_dsi_init()
2006 intel_connector_attach_encoder(intel_connector, encoder); in icl_dsi_init()
2010 intel_bios_init_panel_late(dev_priv, &intel_connector->panel, encoder->devdata, NULL); in icl_dsi_init()
2058 drm_encoder_cleanup(&encoder->base); in icl_dsi_init()