Rev 3480 | Rev 4104 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3480 | Rev 3746 | ||
---|---|---|---|
Line 259... | Line 259... | ||
259 | mode->crtc_hblank_start = width + border; |
259 | mode->crtc_hblank_start = width + border; |
260 | mode->crtc_hblank_end = mode->crtc_hblank_start + blank_width; |
260 | mode->crtc_hblank_end = mode->crtc_hblank_start + blank_width; |
Line 261... | Line 261... | ||
261 | 261 | ||
262 | mode->crtc_hsync_start = mode->crtc_hblank_start + sync_pos; |
262 | mode->crtc_hsync_start = mode->crtc_hblank_start + sync_pos; |
263 | mode->crtc_hsync_end = mode->crtc_hsync_start + sync_width; |
- | |
264 | - | ||
265 | mode->private_flags |= INTEL_MODE_CRTC_TIMINGS_SET; |
263 | mode->crtc_hsync_end = mode->crtc_hsync_start + sync_width; |
Line 266... | Line 264... | ||
266 | } |
264 | } |
267 | 265 | ||
268 | static void |
266 | static void |
Line 282... | Line 280... | ||
282 | mode->crtc_vblank_start = height + border; |
280 | mode->crtc_vblank_start = height + border; |
283 | mode->crtc_vblank_end = mode->crtc_vblank_start + blank_width; |
281 | mode->crtc_vblank_end = mode->crtc_vblank_start + blank_width; |
Line 284... | Line 282... | ||
284 | 282 | ||
285 | mode->crtc_vsync_start = mode->crtc_vblank_start + sync_pos; |
283 | mode->crtc_vsync_start = mode->crtc_vblank_start + sync_pos; |
286 | mode->crtc_vsync_end = mode->crtc_vsync_start + sync_width; |
- | |
287 | - | ||
288 | mode->private_flags |= INTEL_MODE_CRTC_TIMINGS_SET; |
284 | mode->crtc_vsync_end = mode->crtc_vsync_start + sync_width; |
Line 289... | Line 285... | ||
289 | } |
285 | } |
290 | 286 | ||
291 | static inline u32 panel_fitter_scaling(u32 source, u32 target) |
287 | static inline u32 panel_fitter_scaling(u32 source, u32 target) |
Line 299... | Line 295... | ||
299 | #define FACTOR (1 << ACCURACY) |
295 | #define FACTOR (1 << ACCURACY) |
300 | u32 ratio = source * FACTOR / target; |
296 | u32 ratio = source * FACTOR / target; |
301 | return (FACTOR * ratio + FACTOR/2) / FACTOR; |
297 | return (FACTOR * ratio + FACTOR/2) / FACTOR; |
302 | } |
298 | } |
Line 303... | Line 299... | ||
303 | 299 | ||
304 | static bool intel_lvds_mode_fixup(struct drm_encoder *encoder, |
- | |
305 | const struct drm_display_mode *mode, |
300 | static bool intel_lvds_compute_config(struct intel_encoder *intel_encoder, |
306 | struct drm_display_mode *adjusted_mode) |
301 | struct intel_crtc_config *pipe_config) |
307 | { |
302 | { |
308 | struct drm_device *dev = encoder->dev; |
303 | struct drm_device *dev = intel_encoder->base.dev; |
309 | struct drm_i915_private *dev_priv = dev->dev_private; |
304 | struct drm_i915_private *dev_priv = dev->dev_private; |
- | 305 | struct intel_lvds_encoder *lvds_encoder = |
|
310 | struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(encoder); |
306 | to_lvds_encoder(&intel_encoder->base); |
311 | struct intel_connector *intel_connector = |
307 | struct intel_connector *intel_connector = |
- | 308 | &lvds_encoder->attached_connector->base; |
|
- | 309 | struct drm_display_mode *adjusted_mode = &pipe_config->adjusted_mode; |
|
312 | &lvds_encoder->attached_connector->base; |
310 | struct drm_display_mode *mode = &pipe_config->requested_mode; |
313 | struct intel_crtc *intel_crtc = lvds_encoder->base.new_crtc; |
311 | struct intel_crtc *intel_crtc = lvds_encoder->base.new_crtc; |
- | 312 | u32 pfit_control = 0, pfit_pgm_ratios = 0, border = 0; |
|
314 | u32 pfit_control = 0, pfit_pgm_ratios = 0, border = 0; |
313 | unsigned int lvds_bpp; |
Line 315... | Line 314... | ||
315 | int pipe; |
314 | int pipe; |
316 | 315 | ||
317 | /* Should never happen!! */ |
316 | /* Should never happen!! */ |
Line 321... | Line 320... | ||
321 | } |
320 | } |
Line 322... | Line 321... | ||
322 | 321 | ||
323 | if (intel_encoder_check_is_cloned(&lvds_encoder->base)) |
322 | if (intel_encoder_check_is_cloned(&lvds_encoder->base)) |
Line -... | Line 323... | ||
- | 323 | return false; |
|
- | 324 | ||
- | 325 | if ((I915_READ(lvds_encoder->reg) & LVDS_A3_POWER_MASK) == |
|
- | 326 | LVDS_A3_POWER_UP) |
|
- | 327 | lvds_bpp = 8*3; |
|
- | 328 | else |
|
- | 329 | lvds_bpp = 6*3; |
|
- | 330 | ||
- | 331 | if (lvds_bpp != pipe_config->pipe_bpp) { |
|
- | 332 | DRM_DEBUG_KMS("forcing display bpp (was %d) to LVDS (%d)\n", |
|
- | 333 | pipe_config->pipe_bpp, lvds_bpp); |
|
324 | return false; |
334 | pipe_config->pipe_bpp = lvds_bpp; |
325 | 335 | } |
|
326 | /* |
336 | /* |
327 | * We have timings from the BIOS for the panel, put them in |
337 | * We have timings from the BIOS for the panel, put them in |
328 | * to the adjusted mode. The CRTC will be set up for this mode, |
338 | * to the adjusted mode. The CRTC will be set up for this mode, |
329 | * with the panel scaling set up to source from the H/VDisplay |
339 | * with the panel scaling set up to source from the H/VDisplay |
330 | * of the original mode. |
340 | * of the original mode. |
331 | */ |
341 | */ |
Line 332... | Line 342... | ||
332 | intel_fixed_panel_mode(intel_connector->panel.fixed_mode, |
342 | intel_fixed_panel_mode(intel_connector->panel.fixed_mode, |
- | 343 | adjusted_mode); |
|
- | 344 | ||
333 | adjusted_mode); |
345 | if (HAS_PCH_SPLIT(dev)) { |
334 | 346 | pipe_config->has_pch_encoder = true; |
|
335 | if (HAS_PCH_SPLIT(dev)) { |
347 | |
336 | intel_pch_panel_fitting(dev, |
348 | intel_pch_panel_fitting(dev, |
337 | intel_connector->panel.fitting_mode, |
349 | intel_connector->panel.fitting_mode, |
Line 357... | Line 369... | ||
357 | */ |
369 | */ |
358 | for_each_pipe(pipe) |
370 | for_each_pipe(pipe) |
359 | I915_WRITE(BCLRPAT(pipe), 0); |
371 | I915_WRITE(BCLRPAT(pipe), 0); |
Line 360... | Line 372... | ||
360 | 372 | ||
- | 373 | drm_mode_set_crtcinfo(adjusted_mode, 0); |
|
Line 361... | Line 374... | ||
361 | drm_mode_set_crtcinfo(adjusted_mode, 0); |
374 | pipe_config->timings_set = true; |
362 | 375 | ||
363 | switch (intel_connector->panel.fitting_mode) { |
376 | switch (intel_connector->panel.fitting_mode) { |
364 | case DRM_MODE_SCALE_CENTER: |
377 | case DRM_MODE_SCALE_CENTER: |
Line 616... | Line 629... | ||
616 | 629 | ||
617 | 630 | ||
Line 618... | Line -... | ||
618 | if (!IS_ERR_OR_NULL(lvds_connector->base.edid)) |
- | |
619 | kfree(lvds_connector->base.edid); |
631 | if (!IS_ERR_OR_NULL(lvds_connector->base.edid)) |
Line 620... | Line 632... | ||
620 | 632 | kfree(lvds_connector->base.edid); |
|
621 | intel_panel_destroy_backlight(connector->dev); |
633 | |
622 | intel_panel_fini(&lvds_connector->base.panel); |
634 | intel_panel_fini(&lvds_connector->base.panel); |
Line 659... | Line 671... | ||
659 | 671 | ||
660 | return 0; |
672 | return 0; |
Line 661... | Line 673... | ||
661 | } |
673 | } |
662 | - | ||
663 | static const struct drm_encoder_helper_funcs intel_lvds_helper_funcs = { |
674 | |
664 | .mode_fixup = intel_lvds_mode_fixup, |
675 | static const struct drm_encoder_helper_funcs intel_lvds_helper_funcs = { |
Line 665... | Line 676... | ||
665 | .mode_set = intel_lvds_mode_set, |
676 | .mode_set = intel_lvds_mode_set, |
666 | }; |
677 | }; |
Line 802... | Line 813... | ||
802 | DMI_MATCH(DMI_BOARD_NAME, "AT5NM10T-I"), |
813 | DMI_MATCH(DMI_BOARD_NAME, "AT5NM10T-I"), |
803 | }, |
814 | }, |
804 | }, |
815 | }, |
805 | { |
816 | { |
806 | .callback = intel_no_lvds_dmi_callback, |
817 | .callback = intel_no_lvds_dmi_callback, |
807 | .ident = "Hewlett-Packard HP t5740e Thin Client", |
818 | .ident = "Hewlett-Packard HP t5740", |
808 | .matches = { |
819 | .matches = { |
809 | DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"), |
820 | DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"), |
810 | DMI_MATCH(DMI_PRODUCT_NAME, "HP t5740e Thin Client"), |
821 | DMI_MATCH(DMI_PRODUCT_NAME, " t5740"), |
811 | }, |
822 | }, |
812 | }, |
823 | }, |
813 | { |
824 | { |
814 | .callback = intel_no_lvds_dmi_callback, |
825 | .callback = intel_no_lvds_dmi_callback, |
815 | .ident = "Hewlett-Packard t5745", |
826 | .ident = "Hewlett-Packard t5745", |
Line 848... | Line 859... | ||
848 | .matches = { |
859 | .matches = { |
849 | DMI_MATCH(DMI_SYS_VENDOR, "Supermicro"), |
860 | DMI_MATCH(DMI_SYS_VENDOR, "Supermicro"), |
850 | DMI_MATCH(DMI_PRODUCT_NAME, "X7SPA-H"), |
861 | DMI_MATCH(DMI_PRODUCT_NAME, "X7SPA-H"), |
851 | }, |
862 | }, |
852 | }, |
863 | }, |
- | 864 | { |
|
- | 865 | .callback = intel_no_lvds_dmi_callback, |
|
- | 866 | .ident = "Fujitsu Esprimo Q900", |
|
- | 867 | .matches = { |
|
- | 868 | DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), |
|
- | 869 | DMI_MATCH(DMI_PRODUCT_NAME, "ESPRIMO Q900"), |
|
- | 870 | }, |
|
- | 871 | }, |
|
Line 853... | Line 872... | ||
853 | 872 | ||
854 | { } /* terminating entry */ |
873 | { } /* terminating entry */ |
Line 855... | Line 874... | ||
855 | }; |
874 | }; |
Line 1004... | Line 1023... | ||
1004 | 1023 | ||
1005 | static bool intel_lvds_supported(struct drm_device *dev) |
1024 | static bool intel_lvds_supported(struct drm_device *dev) |
1006 | { |
1025 | { |
1007 | /* With the introduction of the PCH we gained a dedicated |
1026 | /* With the introduction of the PCH we gained a dedicated |
1008 | * LVDS presence pin, use it. */ |
1027 | * LVDS presence pin, use it. */ |
1009 | if (HAS_PCH_SPLIT(dev)) |
1028 | if (HAS_PCH_IBX(dev) || HAS_PCH_CPT(dev)) |
Line 1010... | Line 1029... | ||
1010 | return true; |
1029 | return true; |
1011 | 1030 | ||
1012 | /* Otherwise LVDS was only attached to mobile products, |
1031 | /* Otherwise LVDS was only attached to mobile products, |
- | 1032 | * except for the inglorious 830gm */ |
|
- | 1033 | if (INTEL_INFO(dev)->gen <= 4 && IS_MOBILE(dev) && !IS_I830(dev)) |
|
- | 1034 | return true; |
|
1013 | * except for the inglorious 830gm */ |
1035 | |
Line 1014... | Line 1036... | ||
1014 | return IS_MOBILE(dev) && !IS_I830(dev); |
1036 | return false; |
1015 | } |
1037 | } |
1016 | 1038 | ||
Line 1087... | Line 1109... | ||
1087 | DRM_MODE_ENCODER_LVDS); |
1109 | DRM_MODE_ENCODER_LVDS); |
Line 1088... | Line 1110... | ||
1088 | 1110 | ||
1089 | intel_encoder->enable = intel_enable_lvds; |
1111 | intel_encoder->enable = intel_enable_lvds; |
1090 | intel_encoder->pre_enable = intel_pre_enable_lvds; |
1112 | intel_encoder->pre_enable = intel_pre_enable_lvds; |
- | 1113 | intel_encoder->pre_pll_enable = intel_pre_pll_enable_lvds; |
|
1091 | intel_encoder->pre_pll_enable = intel_pre_pll_enable_lvds; |
1114 | intel_encoder->compute_config = intel_lvds_compute_config; |
1092 | intel_encoder->disable = intel_disable_lvds; |
1115 | intel_encoder->disable = intel_disable_lvds; |
1093 | intel_encoder->get_hw_state = intel_lvds_get_hw_state; |
1116 | intel_encoder->get_hw_state = intel_lvds_get_hw_state; |
Line 1094... | Line 1117... | ||
1094 | intel_connector->get_hw_state = intel_connector_get_hw_state; |
1117 | intel_connector->get_hw_state = intel_connector_get_hw_state; |