Lines Matching +full:panel +full:- +full:lvds
2 * Copyright © 2006-2007 Intel Corporation
49 /* Private structure for the integrated LVDS support */
101 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in intel_lvds_get_hw_state()
102 struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(&encoder->base); in intel_lvds_get_hw_state()
107 encoder->power_domain); in intel_lvds_get_hw_state()
111 ret = intel_lvds_port_enabled(dev_priv, lvds_encoder->reg, pipe); in intel_lvds_get_hw_state()
113 intel_display_power_put(dev_priv, encoder->power_domain, wakeref); in intel_lvds_get_hw_state()
121 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in intel_lvds_get_config()
122 struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(&encoder->base); in intel_lvds_get_config()
125 pipe_config->output_types |= BIT(INTEL_OUTPUT_LVDS); in intel_lvds_get_config()
127 tmp = intel_de_read(dev_priv, lvds_encoder->reg); in intel_lvds_get_config()
137 pipe_config->hw.adjusted_mode.flags |= flags; in intel_lvds_get_config()
140 pipe_config->gmch_pfit.lvds_border_bits = in intel_lvds_get_config()
147 pipe_config->gmch_pfit.control |= tmp & PANEL_8TO6_DITHER_ENABLE; in intel_lvds_get_config()
150 pipe_config->hw.adjusted_mode.crtc_clock = pipe_config->port_clock; in intel_lvds_get_config()
158 pps->powerdown_on_reset = intel_de_read(dev_priv, PP_CONTROL(0)) & PANEL_POWER_RESET; in intel_lvds_pps_get_hw_state()
161 pps->port = REG_FIELD_GET(PANEL_PORT_SELECT_MASK, val); in intel_lvds_pps_get_hw_state()
162 pps->t1_t2 = REG_FIELD_GET(PANEL_POWER_UP_DELAY_MASK, val); in intel_lvds_pps_get_hw_state()
163 pps->t5 = REG_FIELD_GET(PANEL_LIGHT_ON_DELAY_MASK, val); in intel_lvds_pps_get_hw_state()
166 pps->t3 = REG_FIELD_GET(PANEL_POWER_DOWN_DELAY_MASK, val); in intel_lvds_pps_get_hw_state()
167 pps->tx = REG_FIELD_GET(PANEL_LIGHT_OFF_DELAY_MASK, val); in intel_lvds_pps_get_hw_state()
170 pps->divider = REG_FIELD_GET(PP_REFERENCE_DIVIDER_MASK, val); in intel_lvds_pps_get_hw_state()
174 * too short power-cycle delay due to the asynchronous programming of in intel_lvds_pps_get_hw_state()
178 val--; in intel_lvds_pps_get_hw_state()
180 pps->t4 = val * 1000; in intel_lvds_pps_get_hw_state()
183 pps->t1_t2 == 0 && pps->t5 == 0 && pps->t3 == 0 && pps->tx == 0) { in intel_lvds_pps_get_hw_state()
184 drm_dbg_kms(&dev_priv->drm, in intel_lvds_pps_get_hw_state()
185 "Panel power timings uninitialized, " in intel_lvds_pps_get_hw_state()
188 pps->t1_t2 = 40 * 10; in intel_lvds_pps_get_hw_state()
189 pps->t5 = 200 * 10; in intel_lvds_pps_get_hw_state()
191 pps->t3 = 35 * 10; in intel_lvds_pps_get_hw_state()
192 pps->tx = 200 * 10; in intel_lvds_pps_get_hw_state()
195 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()
197 pps->t1_t2, pps->t3, pps->t4, pps->t5, pps->tx, in intel_lvds_pps_get_hw_state()
198 pps->divider, pps->port, pps->powerdown_on_reset); in intel_lvds_pps_get_hw_state()
207 drm_WARN_ON(&dev_priv->drm, in intel_lvds_pps_init_hw()
209 if (pps->powerdown_on_reset) in intel_lvds_pps_init_hw()
214 …ORT_SELECT_MASK, pps->port) | REG_FIELD_PREP(PANEL_POWER_UP_DELAY_MASK, pps->t1_t2) | REG_FIELD_PR… in intel_lvds_pps_init_hw()
217 …REG_FIELD_PREP(PANEL_POWER_DOWN_DELAY_MASK, pps->t3) | REG_FIELD_PREP(PANEL_LIGHT_OFF_DELAY_MASK, … in intel_lvds_pps_init_hw()
220 …ELD_PREP(PP_REFERENCE_DIVIDER_MASK, pps->divider) | REG_FIELD_PREP(PANEL_POWER_CYCLE_DELAY_MASK, D… in intel_lvds_pps_init_hw()
228 struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(&encoder->base); in intel_pre_enable_lvds()
229 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in intel_pre_enable_lvds()
230 struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc); in intel_pre_enable_lvds()
231 const struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; in intel_pre_enable_lvds()
232 enum pipe pipe = crtc->pipe; in intel_pre_enable_lvds()
238 pipe_config->shared_dpll); in intel_pre_enable_lvds()
243 intel_lvds_pps_init_hw(dev_priv, &lvds_encoder->init_pps); in intel_pre_enable_lvds()
245 temp = lvds_encoder->init_lvds_val; in intel_pre_enable_lvds()
258 temp |= pipe_config->gmch_pfit.lvds_border_bits; in intel_pre_enable_lvds()
261 * Set the B0-B3 data pairs corresponding to whether we're going to in intel_pre_enable_lvds()
262 * set the DPLLs for dual-channel mode or not. in intel_pre_enable_lvds()
264 if (lvds_encoder->is_dual_link) in intel_pre_enable_lvds()
270 * It would be nice to set 24 vs 18-bit mode (LVDS_A3_POWER_UP) in intel_pre_enable_lvds()
276 temp |= lvds_encoder->a3_power; in intel_pre_enable_lvds()
279 * Set the dithering flag on LVDS as needed, note that there is no in intel_pre_enable_lvds()
280 * special lvds dither control bit on pch-split platforms, dithering is in intel_pre_enable_lvds()
285 * Bspec wording suggests that LVDS port dithering only exists in intel_pre_enable_lvds()
288 if (pipe_config->dither && pipe_config->pipe_bpp == 18) in intel_pre_enable_lvds()
294 if (adjusted_mode->flags & DRM_MODE_FLAG_NHSYNC) in intel_pre_enable_lvds()
296 if (adjusted_mode->flags & DRM_MODE_FLAG_NVSYNC) in intel_pre_enable_lvds()
299 intel_de_write(dev_priv, lvds_encoder->reg, temp); in intel_pre_enable_lvds()
303 * Sets the power state for the panel.
310 struct drm_device *dev = encoder->base.dev; in intel_enable_lvds()
311 struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(&encoder->base); in intel_enable_lvds()
314 intel_de_write(dev_priv, lvds_encoder->reg, in intel_enable_lvds()
315 intel_de_read(dev_priv, lvds_encoder->reg) | LVDS_PORT_EN); in intel_enable_lvds()
319 intel_de_posting_read(dev_priv, lvds_encoder->reg); in intel_enable_lvds()
322 drm_err(&dev_priv->drm, in intel_enable_lvds()
323 "timed out waiting for panel to power on\n"); in intel_enable_lvds()
333 struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(&encoder->base); in intel_disable_lvds()
334 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in intel_disable_lvds()
339 drm_err(&dev_priv->drm, in intel_disable_lvds()
340 "timed out waiting for panel to power off\n"); in intel_disable_lvds()
342 intel_de_write(dev_priv, lvds_encoder->reg, in intel_disable_lvds()
343 intel_de_read(dev_priv, lvds_encoder->reg) & ~LVDS_PORT_EN); in intel_disable_lvds()
344 intel_de_posting_read(dev_priv, lvds_encoder->reg); in intel_disable_lvds()
379 struct drm_display_mode *fixed_mode = intel_connector->panel.fixed_mode; in intel_lvds_mode_valid()
380 int max_pixclk = to_i915(connector->dev)->max_dotclk_freq; in intel_lvds_mode_valid()
382 if (mode->flags & DRM_MODE_FLAG_DBLSCAN) in intel_lvds_mode_valid()
384 if (mode->hdisplay > fixed_mode->hdisplay) in intel_lvds_mode_valid()
386 if (mode->vdisplay > fixed_mode->vdisplay) in intel_lvds_mode_valid()
388 if (fixed_mode->clock > max_pixclk) in intel_lvds_mode_valid()
398 struct drm_i915_private *dev_priv = to_i915(intel_encoder->base.dev); in intel_lvds_compute_config()
400 to_lvds_encoder(&intel_encoder->base); in intel_lvds_compute_config()
402 lvds_encoder->attached_connector; in intel_lvds_compute_config()
403 struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; in intel_lvds_compute_config()
404 struct intel_crtc *intel_crtc = to_intel_crtc(pipe_config->uapi.crtc); in intel_lvds_compute_config()
409 if (INTEL_GEN(dev_priv) < 4 && intel_crtc->pipe == 0) { in intel_lvds_compute_config()
410 drm_err(&dev_priv->drm, "Can't support LVDS on pipe A\n"); in intel_lvds_compute_config()
411 return -EINVAL; in intel_lvds_compute_config()
414 if (lvds_encoder->a3_power == LVDS_A3_POWER_UP) in intel_lvds_compute_config()
419 if (lvds_bpp != pipe_config->pipe_bpp && !pipe_config->bw_constrained) { in intel_lvds_compute_config()
420 drm_dbg_kms(&dev_priv->drm, in intel_lvds_compute_config()
421 "forcing display bpp (was %d) to LVDS (%d)\n", in intel_lvds_compute_config()
422 pipe_config->pipe_bpp, lvds_bpp); in intel_lvds_compute_config()
423 pipe_config->pipe_bpp = lvds_bpp; in intel_lvds_compute_config()
426 pipe_config->output_format = INTEL_OUTPUT_FORMAT_RGB; in intel_lvds_compute_config()
429 * We have timings from the BIOS for the panel, put them in in intel_lvds_compute_config()
431 * with the panel scaling set up to source from the H/VDisplay in intel_lvds_compute_config()
434 intel_fixed_panel_mode(intel_connector->panel.fixed_mode, in intel_lvds_compute_config()
437 if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN) in intel_lvds_compute_config()
438 return -EINVAL; in intel_lvds_compute_config()
441 pipe_config->has_pch_encoder = true; in intel_lvds_compute_config()
465 struct drm_device *dev = connector->dev; in intel_lvds_get_modes()
469 if (!IS_ERR_OR_NULL(intel_connector->edid)) in intel_lvds_get_modes()
470 return drm_add_edid_modes(connector, intel_connector->edid); in intel_lvds_get_modes()
472 mode = drm_mode_duplicate(dev, intel_connector->panel.fixed_mode); in intel_lvds_get_modes()
504 DRM_INFO("Skipping LVDS initialization for %s\n", id->ident); in intel_no_lvds_dmi_callback()
508 /* These systems claim to have LVDS, but really don't */
528 .ident = "MSI IM-945GSE-A",
555 DMI_MATCH(DMI_PRODUCT_NAME, "i965GMx-IF"),
563 DMI_MATCH(DMI_BOARD_NAME, "i915GMx-F"),
568 .ident = "AOpen i915GMm-HFS",
571 DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"),
576 .ident = "AOpen i45GMx-I",
579 DMI_MATCH(DMI_BOARD_NAME, "i45GMx-I"),
584 .ident = "Aopen i945GTt-VFA",
615 .ident = "Asus AT5NM10T-I",
618 DMI_MATCH(DMI_BOARD_NAME, "AT5NM10T-I"),
623 .ident = "Hewlett-Packard HP t5740",
625 DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"),
631 .ident = "Hewlett-Packard t5745",
633 DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"),
639 .ident = "Hewlett-Packard st5747",
641 DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"),
649 DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
650 DMI_MATCH(DMI_BOARD_NAME, "MS-7469"),
655 .ident = "Gigabyte GA-D525TUD",
663 .ident = "Supermicro X7SPA-H",
666 DMI_MATCH(DMI_PRODUCT_NAME, "X7SPA-H"),
723 DRM_INFO("Forcing lvds to dual link mode on %s\n", id->ident); in intel_dual_link_lvds_callback()
759 for_each_intel_encoder(&dev_priv->drm, encoder) { in intel_get_lvds_encoder()
760 if (encoder->type == INTEL_OUTPUT_LVDS) in intel_get_lvds_encoder()
771 return encoder && to_lvds_encoder(&encoder->base)->is_dual_link; in intel_is_dual_link_lvds()
776 struct drm_device *dev = lvds_encoder->base.base.dev; in compute_is_dual_link_lvds()
781 if (dev_priv->params.lvds_channel_mode > 0) in compute_is_dual_link_lvds()
782 return dev_priv->params.lvds_channel_mode == 2; in compute_is_dual_link_lvds()
784 /* single channel LVDS is limited to 112 MHz */ in compute_is_dual_link_lvds()
785 if (lvds_encoder->attached_connector->panel.fixed_mode->clock > 112999) in compute_is_dual_link_lvds()
792 * BIOS should set the proper LVDS register value at boot, but in compute_is_dual_link_lvds()
794 * we need to check "the value to be set" in VBT when LVDS in compute_is_dual_link_lvds()
797 val = intel_de_read(dev_priv, lvds_encoder->reg); in compute_is_dual_link_lvds()
803 val = dev_priv->vbt.bios_lvds_val; in compute_is_dual_link_lvds()
809 * intel_lvds_init - setup LVDS connectors on this device
812 * Create the connector, register the LVDS DDC bus, and try to figure out what
813 * modes we can display on the LVDS panel (if present).
817 struct drm_device *dev = &dev_priv->drm; in intel_lvds_init()
827 u32 lvds; in intel_lvds_init() local
831 /* Skip init on machines we know falsely report LVDS */ in intel_lvds_init()
833 drm_WARN(dev, !dev_priv->vbt.int_lvds_support, in intel_lvds_init()
834 "Useless DMI match. Internal LVDS support disabled by VBT\n"); in intel_lvds_init()
838 if (!dev_priv->vbt.int_lvds_support) { in intel_lvds_init()
839 drm_dbg_kms(&dev_priv->drm, in intel_lvds_init()
840 "Internal LVDS support disabled by VBT\n"); in intel_lvds_init()
847 lvds_reg = LVDS; in intel_lvds_init()
849 lvds = intel_de_read(dev_priv, lvds_reg); in intel_lvds_init()
852 if ((lvds & LVDS_DETECTED) == 0) in intel_lvds_init()
858 if ((lvds & LVDS_PORT_EN) == 0) { in intel_lvds_init()
859 drm_dbg_kms(&dev_priv->drm, in intel_lvds_init()
860 "LVDS is not present in VBT\n"); in intel_lvds_init()
863 drm_dbg_kms(&dev_priv->drm, in intel_lvds_init()
864 "LVDS is not present in VBT, but enabled anyway\n"); in intel_lvds_init()
877 lvds_encoder->attached_connector = intel_connector; in intel_lvds_init()
879 intel_encoder = &lvds_encoder->base; in intel_lvds_init()
880 encoder = &intel_encoder->base; in intel_lvds_init()
881 connector = &intel_connector->base; in intel_lvds_init()
882 drm_connector_init(dev, &intel_connector->base, &intel_lvds_connector_funcs, in intel_lvds_init()
885 drm_encoder_init(dev, &intel_encoder->base, &intel_lvds_enc_funcs, in intel_lvds_init()
886 DRM_MODE_ENCODER_LVDS, "LVDS"); in intel_lvds_init()
888 intel_encoder->enable = intel_enable_lvds; in intel_lvds_init()
889 intel_encoder->pre_enable = intel_pre_enable_lvds; in intel_lvds_init()
890 intel_encoder->compute_config = intel_lvds_compute_config; in intel_lvds_init()
892 intel_encoder->disable = pch_disable_lvds; in intel_lvds_init()
893 intel_encoder->post_disable = pch_post_disable_lvds; in intel_lvds_init()
895 intel_encoder->disable = gmch_disable_lvds; in intel_lvds_init()
897 intel_encoder->get_hw_state = intel_lvds_get_hw_state; in intel_lvds_init()
898 intel_encoder->get_config = intel_lvds_get_config; in intel_lvds_init()
899 intel_encoder->update_pipe = intel_panel_update_backlight; in intel_lvds_init()
900 intel_connector->get_hw_state = intel_connector_get_hw_state; in intel_lvds_init()
904 intel_encoder->type = INTEL_OUTPUT_LVDS; in intel_lvds_init()
905 intel_encoder->power_domain = POWER_DOMAIN_PORT_OTHER; in intel_lvds_init()
906 intel_encoder->port = PORT_NONE; in intel_lvds_init()
907 intel_encoder->cloneable = 0; in intel_lvds_init()
909 intel_encoder->pipe_mask = BIT(PIPE_B); in intel_lvds_init()
911 intel_encoder->pipe_mask = ~0; in intel_lvds_init()
914 connector->display_info.subpixel_order = SubPixelHorizontalRGB; in intel_lvds_init()
915 connector->interlace_allowed = false; in intel_lvds_init()
916 connector->doublescan_allowed = false; in intel_lvds_init()
918 lvds_encoder->reg = lvds_reg; in intel_lvds_init()
925 connector->state->scaling_mode = DRM_MODE_SCALE_ASPECT; in intel_lvds_init()
927 intel_lvds_pps_get_hw_state(dev_priv, &lvds_encoder->init_pps); in intel_lvds_init()
928 lvds_encoder->init_lvds_val = lvds; in intel_lvds_init()
931 * LVDS discovery: in intel_lvds_init()
934 * 3) check to see if LVDS is already on in intel_lvds_init()
935 * if none of the above, no panel in intel_lvds_init()
939 * Attempt to get the fixed panel mode from DDC. Assume that the in intel_lvds_init()
942 mutex_lock(&dev->mode_config.mutex); in intel_lvds_init()
955 edid = ERR_PTR(-EINVAL); in intel_lvds_init()
958 edid = ERR_PTR(-ENOENT); in intel_lvds_init()
960 intel_connector->edid = edid; in intel_lvds_init()
972 * If we didn't get EDID, try checking if the panel is already turned in intel_lvds_init()
978 drm_dbg_kms(&dev_priv->drm, "using current (BIOS) mode: "); in intel_lvds_init()
980 fixed_mode->type |= DRM_MODE_TYPE_PREFERRED; in intel_lvds_init()
988 mutex_unlock(&dev->mode_config.mutex); in intel_lvds_init()
990 intel_panel_init(&intel_connector->panel, fixed_mode, downclock_mode); in intel_lvds_init()
993 lvds_encoder->is_dual_link = compute_is_dual_link_lvds(lvds_encoder); in intel_lvds_init()
994 drm_dbg_kms(&dev_priv->drm, "detected %s-link lvds configuration\n", in intel_lvds_init()
995 lvds_encoder->is_dual_link ? "dual" : "single"); in intel_lvds_init()
997 lvds_encoder->a3_power = lvds & LVDS_A3_POWER_MASK; in intel_lvds_init()
1002 mutex_unlock(&dev->mode_config.mutex); in intel_lvds_init()
1004 drm_dbg_kms(&dev_priv->drm, "No LVDS modes found, disabling.\n"); in intel_lvds_init()