Lines Matching full:encoder

99 static void wait_for_cmds_dispatched_to_panel(struct intel_encoder *encoder)  in wait_for_cmds_dispatched_to_panel()  argument
101 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in wait_for_cmds_dispatched_to_panel()
102 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in wait_for_cmds_dispatched_to_panel()
232 static void dsi_program_swing_and_deemphasis(struct intel_encoder *encoder) in dsi_program_swing_and_deemphasis() argument
234 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in dsi_program_swing_and_deemphasis()
235 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in dsi_program_swing_and_deemphasis()
277 static void configure_dual_link_mode(struct intel_encoder *encoder, in configure_dual_link_mode() argument
280 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in configure_dual_link_mode()
281 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in configure_dual_link_mode()
327 static int afe_clk(struct intel_encoder *encoder, in afe_clk() argument
330 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in afe_clk()
341 static void gen11_dsi_program_esc_clk_div(struct intel_encoder *encoder, in gen11_dsi_program_esc_clk_div() argument
344 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_program_esc_clk_div()
345 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_program_esc_clk_div()
351 afe_clk_khz = afe_clk(encoder, crtc_state); in gen11_dsi_program_esc_clk_div()
398 static void gen11_dsi_enable_io_power(struct intel_encoder *encoder) in gen11_dsi_enable_io_power() argument
400 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_enable_io_power()
401 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_enable_io_power()
411 static void gen11_dsi_power_up_lanes(struct intel_encoder *encoder) in gen11_dsi_power_up_lanes() argument
413 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_power_up_lanes()
414 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_power_up_lanes()
422 static void gen11_dsi_config_phy_lanes_sequence(struct intel_encoder *encoder) in gen11_dsi_config_phy_lanes_sequence() argument
424 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_config_phy_lanes_sequence()
425 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_config_phy_lanes_sequence()
464 static void gen11_dsi_voltage_swing_program_seq(struct intel_encoder *encoder) in gen11_dsi_voltage_swing_program_seq() argument
466 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_voltage_swing_program_seq()
467 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_voltage_swing_program_seq()
496 dsi_program_swing_and_deemphasis(encoder); in gen11_dsi_voltage_swing_program_seq()
507 static void gen11_dsi_enable_ddi_buffer(struct intel_encoder *encoder) in gen11_dsi_enable_ddi_buffer() argument
509 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_enable_ddi_buffer()
510 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_enable_ddi_buffer()
525 gen11_dsi_setup_dphy_timings(struct intel_encoder *encoder, in gen11_dsi_setup_dphy_timings() argument
528 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_setup_dphy_timings()
529 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_setup_dphy_timings()
550 if (afe_clk(encoder, crtc_state) <= 800000) { in gen11_dsi_setup_dphy_timings()
566 gen11_dsi_setup_timings(struct intel_encoder *encoder, in gen11_dsi_setup_timings() argument
569 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_setup_timings()
570 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_setup_timings()
590 if (afe_clk(encoder, crtc_state) <= 800000) { in gen11_dsi_setup_timings()
600 static void gen11_dsi_gate_clocks(struct intel_encoder *encoder) in gen11_dsi_gate_clocks() argument
602 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_gate_clocks()
603 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_gate_clocks()
616 static void gen11_dsi_ungate_clocks(struct intel_encoder *encoder) in gen11_dsi_ungate_clocks() argument
618 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_ungate_clocks()
619 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_ungate_clocks()
632 static bool gen11_dsi_is_clock_enabled(struct intel_encoder *encoder) in gen11_dsi_is_clock_enabled() argument
634 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_is_clock_enabled()
635 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_is_clock_enabled()
650 static void gen11_dsi_map_pll(struct intel_encoder *encoder, in gen11_dsi_map_pll() argument
653 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_map_pll()
654 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_map_pll()
679 gen11_dsi_configure_transcoder(struct intel_encoder *encoder, in gen11_dsi_configure_transcoder() argument
682 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_configure_transcoder()
683 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_configure_transcoder()
700 if (afe_clk(encoder, pipe_config) >= 1500 * 1000) { in gen11_dsi_configure_transcoder()
794 configure_dual_link_mode(encoder, pipe_config); in gen11_dsi_configure_transcoder()
842 gen11_dsi_set_transcoder_timings(struct intel_encoder *encoder, in gen11_dsi_set_transcoder_timings() argument
845 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_set_transcoder_timings()
846 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_set_transcoder_timings()
895 byte_clk_period_ns = 1000000 / afe_clk(encoder, crtc_state); in gen11_dsi_set_transcoder_timings()
1011 static void gen11_dsi_enable_transcoder(struct intel_encoder *encoder) in gen11_dsi_enable_transcoder() argument
1013 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_enable_transcoder()
1014 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_enable_transcoder()
1031 static void gen11_dsi_setup_timeouts(struct intel_encoder *encoder, in gen11_dsi_setup_timeouts() argument
1034 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_setup_timeouts()
1035 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_setup_timeouts()
1047 divisor = intel_dsi_tlpx_ns(intel_dsi) * afe_clk(encoder, crtc_state) * 1000; in gen11_dsi_setup_timeouts()
1078 static void gen11_dsi_config_util_pin(struct intel_encoder *encoder, in gen11_dsi_config_util_pin() argument
1081 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_config_util_pin()
1082 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_config_util_pin()
1105 gen11_dsi_enable_port_and_phy(struct intel_encoder *encoder, in gen11_dsi_enable_port_and_phy() argument
1109 gen11_dsi_power_up_lanes(encoder); in gen11_dsi_enable_port_and_phy()
1112 gen11_dsi_config_phy_lanes_sequence(encoder); in gen11_dsi_enable_port_and_phy()
1115 gen11_dsi_voltage_swing_program_seq(encoder); in gen11_dsi_enable_port_and_phy()
1118 gen11_dsi_setup_dphy_timings(encoder, crtc_state); in gen11_dsi_enable_port_and_phy()
1121 gen11_dsi_enable_ddi_buffer(encoder); in gen11_dsi_enable_port_and_phy()
1123 gen11_dsi_gate_clocks(encoder); in gen11_dsi_enable_port_and_phy()
1125 gen11_dsi_setup_timings(encoder, crtc_state); in gen11_dsi_enable_port_and_phy()
1128 gen11_dsi_config_util_pin(encoder, true); in gen11_dsi_enable_port_and_phy()
1131 gen11_dsi_setup_timeouts(encoder, crtc_state); in gen11_dsi_enable_port_and_phy()
1134 gen11_dsi_configure_transcoder(encoder, crtc_state); in gen11_dsi_enable_port_and_phy()
1137 static void gen11_dsi_powerup_panel(struct intel_encoder *encoder) in gen11_dsi_powerup_panel() argument
1139 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_powerup_panel()
1140 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_powerup_panel()
1169 wait_for_cmds_dispatched_to_panel(encoder); in gen11_dsi_powerup_panel()
1173 struct intel_encoder *encoder, in gen11_dsi_pre_pll_enable() argument
1177 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_pre_pll_enable()
1186 gen11_dsi_enable_io_power(encoder); in gen11_dsi_pre_pll_enable()
1189 gen11_dsi_program_esc_clk_div(encoder, crtc_state); in gen11_dsi_pre_pll_enable()
1193 struct intel_encoder *encoder, in gen11_dsi_pre_enable() argument
1198 gen11_dsi_map_pll(encoder, pipe_config); in gen11_dsi_pre_enable()
1201 gen11_dsi_enable_port_and_phy(encoder, pipe_config); in gen11_dsi_pre_enable()
1204 gen11_dsi_powerup_panel(encoder); in gen11_dsi_pre_enable()
1206 intel_dsc_dsi_pps_write(encoder, pipe_config); in gen11_dsi_pre_enable()
1209 gen11_dsi_set_transcoder_timings(encoder, pipe_config); in gen11_dsi_pre_enable()
1219 static void icl_apply_kvmr_pipe_a_wa(struct intel_encoder *encoder, in icl_apply_kvmr_pipe_a_wa() argument
1222 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in icl_apply_kvmr_pipe_a_wa()
1236 static void adlp_set_lp_hs_wakeup_gb(struct intel_encoder *encoder) in adlp_set_lp_hs_wakeup_gb() argument
1238 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in adlp_set_lp_hs_wakeup_gb()
1239 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in adlp_set_lp_hs_wakeup_gb()
1251 struct intel_encoder *encoder, in gen11_dsi_enable() argument
1255 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_enable()
1259 icl_apply_kvmr_pipe_a_wa(encoder, crtc->pipe, true); in gen11_dsi_enable()
1262 adlp_set_lp_hs_wakeup_gb(encoder); in gen11_dsi_enable()
1265 gen11_dsi_enable_transcoder(encoder); in gen11_dsi_enable()
1276 static void gen11_dsi_disable_transcoder(struct intel_encoder *encoder) in gen11_dsi_disable_transcoder() argument
1278 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_disable_transcoder()
1279 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_disable_transcoder()
1298 static void gen11_dsi_powerdown_panel(struct intel_encoder *encoder) in gen11_dsi_powerdown_panel() argument
1300 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_powerdown_panel()
1305 wait_for_cmds_dispatched_to_panel(encoder); in gen11_dsi_powerdown_panel()
1308 static void gen11_dsi_deconfigure_trancoder(struct intel_encoder *encoder) in gen11_dsi_deconfigure_trancoder() argument
1310 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_deconfigure_trancoder()
1311 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_deconfigure_trancoder()
1356 static void gen11_dsi_disable_port(struct intel_encoder *encoder) in gen11_dsi_disable_port() argument
1358 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_disable_port()
1359 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_disable_port()
1362 gen11_dsi_ungate_clocks(encoder); in gen11_dsi_disable_port()
1373 gen11_dsi_gate_clocks(encoder); in gen11_dsi_disable_port()
1376 static void gen11_dsi_disable_io_power(struct intel_encoder *encoder) in gen11_dsi_disable_io_power() argument
1378 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_disable_io_power()
1379 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_disable_io_power()
1400 struct intel_encoder *encoder, in gen11_dsi_disable() argument
1404 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_disable()
1412 struct intel_encoder *encoder, in gen11_dsi_post_disable() argument
1416 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_post_disable()
1422 gen11_dsi_disable_transcoder(encoder); in gen11_dsi_post_disable()
1425 icl_apply_kvmr_pipe_a_wa(encoder, crtc->pipe, false); in gen11_dsi_post_disable()
1428 gen11_dsi_powerdown_panel(encoder); in gen11_dsi_post_disable()
1431 gen11_dsi_deconfigure_trancoder(encoder); in gen11_dsi_post_disable()
1437 gen11_dsi_disable_port(encoder); in gen11_dsi_post_disable()
1439 gen11_dsi_config_util_pin(encoder, false); in gen11_dsi_post_disable()
1442 gen11_dsi_disable_io_power(encoder); in gen11_dsi_post_disable()
1466 static void gen11_dsi_get_timings(struct intel_encoder *encoder, in gen11_dsi_get_timings() argument
1469 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_get_timings()
1533 static void gen11_dsi_get_config(struct intel_encoder *encoder, in gen11_dsi_get_config() argument
1537 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_get_config()
1539 intel_ddi_get_clock(encoder, pipe_config, icl_ddi_combo_get_pll(encoder)); in gen11_dsi_get_config()
1545 gen11_dsi_get_timings(encoder, pipe_config); in gen11_dsi_get_config()
1557 static void gen11_dsi_sync_state(struct intel_encoder *encoder, in gen11_dsi_sync_state() argument
1560 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_sync_state()
1574 "[ENCODER:%d:%s] BIOS left IGNORE_KVMR_PIPE_A cleared with pipe B enabled\n", in gen11_dsi_sync_state()
1575 encoder->base.base.id, in gen11_dsi_sync_state()
1576 encoder->base.name); in gen11_dsi_sync_state()
1579 static int gen11_dsi_dsc_compute_config(struct intel_encoder *encoder, in gen11_dsi_dsc_compute_config() argument
1582 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_dsc_compute_config()
1588 use_dsc = intel_bios_get_dsc_params(encoder, crtc_state, dsc_max_bpc); in gen11_dsi_dsc_compute_config()
1626 static int gen11_dsi_compute_config(struct intel_encoder *encoder, in gen11_dsi_compute_config() argument
1630 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in gen11_dsi_compute_config()
1631 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_compute_config()
1663 if (gen11_dsi_dsc_compute_config(encoder, pipe_config)) in gen11_dsi_compute_config()
1666 pipe_config->port_clock = afe_clk(encoder, pipe_config) / 5; in gen11_dsi_compute_config()
1679 static void gen11_dsi_get_power_domains(struct intel_encoder *encoder, in gen11_dsi_get_power_domains() argument
1682 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in gen11_dsi_get_power_domains()
1685 enc_to_intel_dsi(encoder)); in gen11_dsi_get_power_domains()
1688 static bool gen11_dsi_get_hw_state(struct intel_encoder *encoder, in gen11_dsi_get_hw_state() argument
1691 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in gen11_dsi_get_hw_state()
1692 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); in gen11_dsi_get_hw_state()
1700 encoder->power_domain); in gen11_dsi_get_hw_state()
1730 intel_display_power_put(dev_priv, encoder->power_domain, wakeref); in gen11_dsi_get_hw_state()
1734 static bool gen11_dsi_initial_fastset_check(struct intel_encoder *encoder, in gen11_dsi_initial_fastset_check() argument
1738 drm_dbg_kms(encoder->base.dev, "Forcing full modeset due to DSC being enabled\n"); in gen11_dsi_initial_fastset_check()
1747 static void gen11_dsi_encoder_destroy(struct drm_encoder *encoder) in gen11_dsi_encoder_destroy() argument
1749 intel_encoder_destroy(encoder); in gen11_dsi_encoder_destroy()
1950 struct intel_encoder *encoder; in icl_dsi_init() local
1969 encoder = &intel_dsi->base; in icl_dsi_init()
1973 encoder->devdata = devdata; in icl_dsi_init()
1975 /* register DSI encoder with DRM subsystem */ in icl_dsi_init()
1976 drm_encoder_init(&dev_priv->drm, &encoder->base, &gen11_dsi_encoder_funcs, in icl_dsi_init()
1979 encoder->pre_pll_enable = gen11_dsi_pre_pll_enable; in icl_dsi_init()
1980 encoder->pre_enable = gen11_dsi_pre_enable; in icl_dsi_init()
1981 encoder->enable = gen11_dsi_enable; in icl_dsi_init()
1982 encoder->disable = gen11_dsi_disable; in icl_dsi_init()
1983 encoder->post_disable = gen11_dsi_post_disable; in icl_dsi_init()
1984 encoder->port = port; in icl_dsi_init()
1985 encoder->get_config = gen11_dsi_get_config; in icl_dsi_init()
1986 encoder->sync_state = gen11_dsi_sync_state; in icl_dsi_init()
1987 encoder->update_pipe = intel_backlight_update; in icl_dsi_init()
1988 encoder->compute_config = gen11_dsi_compute_config; in icl_dsi_init()
1989 encoder->get_hw_state = gen11_dsi_get_hw_state; in icl_dsi_init()
1990 encoder->initial_fastset_check = gen11_dsi_initial_fastset_check; in icl_dsi_init()
1991 encoder->type = INTEL_OUTPUT_DSI; in icl_dsi_init()
1992 encoder->cloneable = 0; in icl_dsi_init()
1993 encoder->pipe_mask = ~0; in icl_dsi_init()
1994 encoder->power_domain = POWER_DOMAIN_PORT_DSI; in icl_dsi_init()
1995 encoder->get_power_domains = gen11_dsi_get_power_domains; in icl_dsi_init()
1996 encoder->disable_clock = gen11_dsi_gate_clocks; in icl_dsi_init()
1997 encoder->is_clock_enabled = gen11_dsi_is_clock_enabled; in icl_dsi_init()
1998 encoder->shutdown = intel_dsi_shutdown; in icl_dsi_init()
2007 /* attach connector to encoder */ in icl_dsi_init()
2008 intel_connector_attach_encoder(intel_connector, encoder); in icl_dsi_init()
2012 intel_bios_init_panel_late(display, &intel_connector->panel, encoder->devdata, NULL); in icl_dsi_init()
2060 drm_encoder_cleanup(&encoder->base); in icl_dsi_init()