Lines Matching +full:mac +full:- +full:divider
2 * Copyright © 2006-2007 Intel Corporation
67 int divider; member
110 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in intel_lvds_get_hw_state()
115 wakeref = intel_display_power_get_if_enabled(i915, encoder->power_domain); in intel_lvds_get_hw_state()
119 ret = intel_lvds_port_enabled(i915, lvds_encoder->reg, pipe); in intel_lvds_get_hw_state()
121 intel_display_power_put(i915, encoder->power_domain, wakeref); in intel_lvds_get_hw_state()
129 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in intel_lvds_get_config()
133 crtc_state->output_types |= BIT(INTEL_OUTPUT_LVDS); in intel_lvds_get_config()
135 tmp = intel_de_read(dev_priv, lvds_encoder->reg); in intel_lvds_get_config()
145 crtc_state->hw.adjusted_mode.flags |= flags; in intel_lvds_get_config()
148 crtc_state->gmch_pfit.lvds_border_bits = in intel_lvds_get_config()
155 crtc_state->gmch_pfit.control |= tmp & PFIT_PANEL_8TO6_DITHER_ENABLE; in intel_lvds_get_config()
158 crtc_state->hw.adjusted_mode.crtc_clock = crtc_state->port_clock; in intel_lvds_get_config()
166 pps->powerdown_on_reset = intel_de_read(dev_priv, in intel_lvds_pps_get_hw_state()
170 pps->port = REG_FIELD_GET(PANEL_PORT_SELECT_MASK, val); in intel_lvds_pps_get_hw_state()
171 pps->t1_t2 = REG_FIELD_GET(PANEL_POWER_UP_DELAY_MASK, val); in intel_lvds_pps_get_hw_state()
172 pps->t5 = REG_FIELD_GET(PANEL_LIGHT_ON_DELAY_MASK, val); in intel_lvds_pps_get_hw_state()
175 pps->t3 = REG_FIELD_GET(PANEL_POWER_DOWN_DELAY_MASK, val); in intel_lvds_pps_get_hw_state()
176 pps->tx = REG_FIELD_GET(PANEL_LIGHT_OFF_DELAY_MASK, val); in intel_lvds_pps_get_hw_state()
179 pps->divider = REG_FIELD_GET(PP_REFERENCE_DIVIDER_MASK, val); in intel_lvds_pps_get_hw_state()
183 * too short power-cycle delay due to the asynchronous programming of in intel_lvds_pps_get_hw_state()
187 val--; in intel_lvds_pps_get_hw_state()
189 pps->t4 = val * 1000; in intel_lvds_pps_get_hw_state()
192 pps->t1_t2 == 0 && pps->t5 == 0 && pps->t3 == 0 && pps->tx == 0) { in intel_lvds_pps_get_hw_state()
193 drm_dbg_kms(&dev_priv->drm, in intel_lvds_pps_get_hw_state()
197 pps->t1_t2 = 40 * 10; in intel_lvds_pps_get_hw_state()
198 pps->t5 = 200 * 10; in intel_lvds_pps_get_hw_state()
200 pps->t3 = 35 * 10; in intel_lvds_pps_get_hw_state()
201 pps->tx = 200 * 10; in intel_lvds_pps_get_hw_state()
204 drm_dbg(&dev_priv->drm, "LVDS PPS:t1+t2 %d t3 %d t4 %d t5 %d tx %d " in intel_lvds_pps_get_hw_state()
205 "divider %d port %d powerdown_on_reset %d\n", in intel_lvds_pps_get_hw_state()
206 pps->t1_t2, pps->t3, pps->t4, pps->t5, pps->tx, in intel_lvds_pps_get_hw_state()
207 pps->divider, pps->port, pps->powerdown_on_reset); in intel_lvds_pps_get_hw_state()
216 drm_WARN_ON(&dev_priv->drm, in intel_lvds_pps_init_hw()
218 if (pps->powerdown_on_reset) in intel_lvds_pps_init_hw()
223 REG_FIELD_PREP(PANEL_PORT_SELECT_MASK, pps->port) | in intel_lvds_pps_init_hw()
224 REG_FIELD_PREP(PANEL_POWER_UP_DELAY_MASK, pps->t1_t2) | in intel_lvds_pps_init_hw()
225 REG_FIELD_PREP(PANEL_LIGHT_ON_DELAY_MASK, pps->t5)); in intel_lvds_pps_init_hw()
228 REG_FIELD_PREP(PANEL_POWER_DOWN_DELAY_MASK, pps->t3) | in intel_lvds_pps_init_hw()
229 REG_FIELD_PREP(PANEL_LIGHT_OFF_DELAY_MASK, pps->tx)); in intel_lvds_pps_init_hw()
232 REG_FIELD_PREP(PP_REFERENCE_DIVIDER_MASK, pps->divider) | in intel_lvds_pps_init_hw()
233 REG_FIELD_PREP(PANEL_POWER_CYCLE_DELAY_MASK, DIV_ROUND_UP(pps->t4, 1000) + 1)); in intel_lvds_pps_init_hw()
242 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in intel_pre_enable_lvds()
243 struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); in intel_pre_enable_lvds()
244 const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; in intel_pre_enable_lvds()
245 enum pipe pipe = crtc->pipe; in intel_pre_enable_lvds()
250 assert_shared_dpll_disabled(i915, crtc_state->shared_dpll); in intel_pre_enable_lvds()
255 intel_lvds_pps_init_hw(i915, &lvds_encoder->init_pps); in intel_pre_enable_lvds()
257 temp = lvds_encoder->init_lvds_val; in intel_pre_enable_lvds()
270 temp |= crtc_state->gmch_pfit.lvds_border_bits; in intel_pre_enable_lvds()
273 * Set the B0-B3 data pairs corresponding to whether we're going to in intel_pre_enable_lvds()
274 * set the DPLLs for dual-channel mode or not. in intel_pre_enable_lvds()
276 if (lvds_encoder->is_dual_link) in intel_pre_enable_lvds()
282 * It would be nice to set 24 vs 18-bit mode (LVDS_A3_POWER_UP) in intel_pre_enable_lvds()
288 temp |= lvds_encoder->a3_power; in intel_pre_enable_lvds()
292 * special lvds dither control bit on pch-split platforms, dithering is in intel_pre_enable_lvds()
300 if (crtc_state->dither && crtc_state->pipe_bpp == 18) in intel_pre_enable_lvds()
306 if (adjusted_mode->flags & DRM_MODE_FLAG_NHSYNC) in intel_pre_enable_lvds()
308 if (adjusted_mode->flags & DRM_MODE_FLAG_NVSYNC) in intel_pre_enable_lvds()
311 intel_de_write(i915, lvds_encoder->reg, temp); in intel_pre_enable_lvds()
323 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in intel_enable_lvds()
325 intel_de_rmw(dev_priv, lvds_encoder->reg, 0, LVDS_PORT_EN); in intel_enable_lvds()
328 intel_de_posting_read(dev_priv, lvds_encoder->reg); in intel_enable_lvds()
331 drm_err(&dev_priv->drm, in intel_enable_lvds()
343 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in intel_disable_lvds()
347 drm_err(&dev_priv->drm, in intel_disable_lvds()
350 intel_de_rmw(dev_priv, lvds_encoder->reg, LVDS_PORT_EN, 0); in intel_disable_lvds()
351 intel_de_posting_read(dev_priv, lvds_encoder->reg); in intel_disable_lvds()
383 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in intel_lvds_shutdown()
386 drm_err(&dev_priv->drm, in intel_lvds_shutdown()
395 struct drm_i915_private *i915 = to_i915(connector->base.dev); in intel_lvds_mode_valid()
398 int max_pixclk = to_i915(connector->base.dev)->display.cdclk.max_dotclk_freq; in intel_lvds_mode_valid()
409 if (fixed_mode->clock > max_pixclk) in intel_lvds_mode_valid()
419 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in intel_lvds_compute_config()
421 struct intel_connector *connector = lvds_encoder->attached_connector; in intel_lvds_compute_config()
422 struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; in intel_lvds_compute_config()
423 struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); in intel_lvds_compute_config()
428 if (DISPLAY_VER(i915) < 4 && crtc->pipe == 0) { in intel_lvds_compute_config()
429 drm_err(&i915->drm, "Can't support LVDS on pipe A\n"); in intel_lvds_compute_config()
430 return -EINVAL; in intel_lvds_compute_config()
434 crtc_state->has_pch_encoder = true; in intel_lvds_compute_config()
436 return -EINVAL; in intel_lvds_compute_config()
439 if (lvds_encoder->a3_power == LVDS_A3_POWER_UP) in intel_lvds_compute_config()
444 /* TODO: Check crtc_state->max_link_bpp_x16 instead of bw_constrained */ in intel_lvds_compute_config()
445 if (lvds_bpp != crtc_state->pipe_bpp && !crtc_state->bw_constrained) { in intel_lvds_compute_config()
446 drm_dbg_kms(&i915->drm, in intel_lvds_compute_config()
448 crtc_state->pipe_bpp, lvds_bpp); in intel_lvds_compute_config()
449 crtc_state->pipe_bpp = lvds_bpp; in intel_lvds_compute_config()
452 crtc_state->sink_format = INTEL_OUTPUT_FORMAT_RGB; in intel_lvds_compute_config()
453 crtc_state->output_format = INTEL_OUTPUT_FORMAT_RGB; in intel_lvds_compute_config()
465 if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN) in intel_lvds_compute_config()
466 return -EINVAL; in intel_lvds_compute_config()
487 const struct drm_edid *fixed_edid = connector->panel.fixed_edid; in intel_lvds_get_modes()
491 drm_edid_connector_update(&connector->base, fixed_edid); in intel_lvds_get_modes()
493 return drm_edid_connector_add_modes(&connector->base); in intel_lvds_get_modes()
523 DRM_INFO("Skipping LVDS initialization for %s\n", id->ident); in intel_no_lvds_dmi_callback()
531 .ident = "Apple Mac Mini (Core series)",
539 .ident = "Apple Mac Mini (Core 2 series)",
547 .ident = "MSI IM-945GSE-A",
574 DMI_MATCH(DMI_PRODUCT_NAME, "i965GMx-IF"),
582 DMI_MATCH(DMI_BOARD_NAME, "i915GMx-F"),
587 .ident = "AOpen i915GMm-HFS",
590 DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"),
595 .ident = "AOpen i45GMx-I",
598 DMI_MATCH(DMI_BOARD_NAME, "i45GMx-I"),
603 .ident = "Aopen i945GTt-VFA",
634 .ident = "Asus AT5NM10T-I",
637 DMI_MATCH(DMI_BOARD_NAME, "AT5NM10T-I"),
642 .ident = "Hewlett-Packard HP t5740",
644 DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"),
650 .ident = "Hewlett-Packard t5745",
652 DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"),
658 .ident = "Hewlett-Packard st5747",
660 DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"),
668 DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
669 DMI_MATCH(DMI_BOARD_NAME, "MS-7469"),
674 .ident = "Gigabyte GA-D525TUD",
682 .ident = "Supermicro X7SPA-H",
685 DMI_MATCH(DMI_PRODUCT_NAME, "X7SPA-H"),
742 DRM_INFO("Forcing lvds to dual link mode on %s\n", id->ident); in intel_dual_link_lvds_callback()
778 for_each_intel_encoder(&i915->drm, encoder) { in intel_get_lvds_encoder()
779 if (encoder->type == INTEL_OUTPUT_LVDS) in intel_get_lvds_encoder()
790 return encoder && to_lvds_encoder(encoder)->is_dual_link; in intel_is_dual_link_lvds()
795 struct drm_i915_private *i915 = to_i915(lvds_encoder->base.base.dev); in compute_is_dual_link_lvds()
796 struct intel_connector *connector = lvds_encoder->attached_connector; in compute_is_dual_link_lvds()
802 if (i915->display.params.lvds_channel_mode > 0) in compute_is_dual_link_lvds()
803 return i915->display.params.lvds_channel_mode == 2; in compute_is_dual_link_lvds()
806 if (fixed_mode->clock > 112999) in compute_is_dual_link_lvds()
818 val = intel_de_read(i915, lvds_encoder->reg); in compute_is_dual_link_lvds()
824 val = connector->panel.vbt.bios_lvds_val; in compute_is_dual_link_lvds()
835 * intel_lvds_init - setup LVDS connectors on this device
843 struct intel_display *display = &i915->display; in intel_lvds_init()
854 drm_WARN(&i915->drm, !i915->display.vbt.int_lvds_support, in intel_lvds_init()
859 if (!i915->display.vbt.int_lvds_support) { in intel_lvds_init()
860 drm_dbg_kms(&i915->drm, in intel_lvds_init()
880 drm_dbg_kms(&i915->drm, in intel_lvds_init()
884 drm_dbg_kms(&i915->drm, in intel_lvds_init()
898 lvds_encoder->attached_connector = connector; in intel_lvds_init()
899 encoder = &lvds_encoder->base; in intel_lvds_init()
901 drm_connector_init_with_ddc(&i915->drm, &connector->base, in intel_lvds_init()
906 drm_encoder_init(&i915->drm, &encoder->base, &intel_lvds_enc_funcs, in intel_lvds_init()
909 encoder->enable = intel_enable_lvds; in intel_lvds_init()
910 encoder->pre_enable = intel_pre_enable_lvds; in intel_lvds_init()
911 encoder->compute_config = intel_lvds_compute_config; in intel_lvds_init()
913 encoder->disable = pch_disable_lvds; in intel_lvds_init()
914 encoder->post_disable = pch_post_disable_lvds; in intel_lvds_init()
916 encoder->disable = gmch_disable_lvds; in intel_lvds_init()
918 encoder->get_hw_state = intel_lvds_get_hw_state; in intel_lvds_init()
919 encoder->get_config = intel_lvds_get_config; in intel_lvds_init()
920 encoder->update_pipe = intel_backlight_update; in intel_lvds_init()
921 encoder->shutdown = intel_lvds_shutdown; in intel_lvds_init()
922 connector->get_hw_state = intel_connector_get_hw_state; in intel_lvds_init()
926 encoder->type = INTEL_OUTPUT_LVDS; in intel_lvds_init()
927 encoder->power_domain = POWER_DOMAIN_PORT_OTHER; in intel_lvds_init()
928 encoder->port = PORT_NONE; in intel_lvds_init()
929 encoder->cloneable = 0; in intel_lvds_init()
931 encoder->pipe_mask = BIT(PIPE_B); in intel_lvds_init()
933 encoder->pipe_mask = ~0; in intel_lvds_init()
935 drm_connector_helper_add(&connector->base, &intel_lvds_connector_helper_funcs); in intel_lvds_init()
936 connector->base.display_info.subpixel_order = SubPixelHorizontalRGB; in intel_lvds_init()
938 lvds_encoder->reg = lvds_reg; in intel_lvds_init()
940 intel_lvds_add_properties(&connector->base); in intel_lvds_init()
942 intel_lvds_pps_get_hw_state(i915, &lvds_encoder->init_pps); in intel_lvds_init()
943 lvds_encoder->init_lvds_val = lvds; in intel_lvds_init()
957 mutex_lock(&i915->drm.mode_config.mutex); in intel_lvds_init()
959 drm_edid = drm_edid_read_switcheroo(&connector->base, connector->base.ddc); in intel_lvds_init()
961 drm_edid = drm_edid_read_ddc(&connector->base, connector->base.ddc); in intel_lvds_init()
963 if (drm_edid_connector_update(&connector->base, drm_edid) || in intel_lvds_init()
964 !drm_edid_connector_add_modes(&connector->base)) { in intel_lvds_init()
965 drm_edid_connector_update(&connector->base, NULL); in intel_lvds_init()
967 drm_edid = ERR_PTR(-EINVAL); in intel_lvds_init()
970 drm_edid = ERR_PTR(-ENOENT); in intel_lvds_init()
972 intel_bios_init_panel_late(display, &connector->panel, NULL, in intel_lvds_init()
990 mutex_unlock(&i915->drm.mode_config.mutex); in intel_lvds_init()
1000 lvds_encoder->is_dual_link = compute_is_dual_link_lvds(lvds_encoder); in intel_lvds_init()
1001 drm_dbg_kms(&i915->drm, "detected %s-link lvds configuration\n", in intel_lvds_init()
1002 lvds_encoder->is_dual_link ? "dual" : "single"); in intel_lvds_init()
1004 lvds_encoder->a3_power = lvds & LVDS_A3_POWER_MASK; in intel_lvds_init()
1009 drm_dbg_kms(&i915->drm, "No LVDS modes found, disabling.\n"); in intel_lvds_init()
1010 drm_connector_cleanup(&connector->base); in intel_lvds_init()
1011 drm_encoder_cleanup(&encoder->base); in intel_lvds_init()