diff options
author | David S. Miller <davem@davemloft.net> | 2009-11-19 01:19:03 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-19 01:19:03 -0500 |
commit | 3505d1a9fd65e2d3e00827857b6795d9d8983658 (patch) | |
tree | 941cfafdb57c427bb6b7ebf6354ee93b2a3693b5 /drivers/gpu/drm/i915/intel_lvds.c | |
parent | dfef948ed2ba69cf041840b5e860d6b4e16fa0b1 (diff) | |
parent | 66b00a7c93ec782d118d2c03bd599cfd041e80a1 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/sfc/sfe4001.c
drivers/net/wireless/libertas/cmd.c
drivers/staging/Kconfig
drivers/staging/Makefile
drivers/staging/rtl8187se/Kconfig
drivers/staging/rtl8192e/Kconfig
Diffstat (limited to 'drivers/gpu/drm/i915/intel_lvds.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_lvds.c | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index 98ae3d73577e..05598ae10c4b 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c | |||
@@ -380,7 +380,7 @@ static bool intel_lvds_mode_fixup(struct drm_encoder *encoder, | |||
380 | adjusted_mode->crtc_vblank_start + vsync_pos; | 380 | adjusted_mode->crtc_vblank_start + vsync_pos; |
381 | /* keep the vsync width constant */ | 381 | /* keep the vsync width constant */ |
382 | adjusted_mode->crtc_vsync_end = | 382 | adjusted_mode->crtc_vsync_end = |
383 | adjusted_mode->crtc_vblank_start + vsync_width; | 383 | adjusted_mode->crtc_vsync_start + vsync_width; |
384 | border = 1; | 384 | border = 1; |
385 | break; | 385 | break; |
386 | case DRM_MODE_SCALE_ASPECT: | 386 | case DRM_MODE_SCALE_ASPECT: |
@@ -526,6 +526,14 @@ out: | |||
526 | lvds_priv->pfit_control = pfit_control; | 526 | lvds_priv->pfit_control = pfit_control; |
527 | lvds_priv->pfit_pgm_ratios = pfit_pgm_ratios; | 527 | lvds_priv->pfit_pgm_ratios = pfit_pgm_ratios; |
528 | /* | 528 | /* |
529 | * When there exists the border, it means that the LVDS_BORDR | ||
530 | * should be enabled. | ||
531 | */ | ||
532 | if (border) | ||
533 | dev_priv->lvds_border_bits |= LVDS_BORDER_ENABLE; | ||
534 | else | ||
535 | dev_priv->lvds_border_bits &= ~(LVDS_BORDER_ENABLE); | ||
536 | /* | ||
529 | * XXX: It would be nice to support lower refresh rates on the | 537 | * XXX: It would be nice to support lower refresh rates on the |
530 | * panels to reduce power consumption, and perhaps match the | 538 | * panels to reduce power consumption, and perhaps match the |
531 | * user's requested refresh rate. | 539 | * user's requested refresh rate. |
@@ -656,6 +664,15 @@ static int intel_lvds_get_modes(struct drm_connector *connector) | |||
656 | return 0; | 664 | return 0; |
657 | } | 665 | } |
658 | 666 | ||
667 | /* | ||
668 | * Lid events. Note the use of 'modeset_on_lid': | ||
669 | * - we set it on lid close, and reset it on open | ||
670 | * - we use it as a "only once" bit (ie we ignore | ||
671 | * duplicate events where it was already properly | ||
672 | * set/reset) | ||
673 | * - the suspend/resume paths will also set it to | ||
674 | * zero, since they restore the mode ("lid open"). | ||
675 | */ | ||
659 | static int intel_lid_notify(struct notifier_block *nb, unsigned long val, | 676 | static int intel_lid_notify(struct notifier_block *nb, unsigned long val, |
660 | void *unused) | 677 | void *unused) |
661 | { | 678 | { |
@@ -663,13 +680,19 @@ static int intel_lid_notify(struct notifier_block *nb, unsigned long val, | |||
663 | container_of(nb, struct drm_i915_private, lid_notifier); | 680 | container_of(nb, struct drm_i915_private, lid_notifier); |
664 | struct drm_device *dev = dev_priv->dev; | 681 | struct drm_device *dev = dev_priv->dev; |
665 | 682 | ||
666 | if (acpi_lid_open() && !dev_priv->suspended) { | 683 | if (!acpi_lid_open()) { |
667 | mutex_lock(&dev->mode_config.mutex); | 684 | dev_priv->modeset_on_lid = 1; |
668 | drm_helper_resume_force_mode(dev); | 685 | return NOTIFY_OK; |
669 | mutex_unlock(&dev->mode_config.mutex); | ||
670 | } | 686 | } |
671 | 687 | ||
672 | drm_sysfs_hotplug_event(dev_priv->dev); | 688 | if (!dev_priv->modeset_on_lid) |
689 | return NOTIFY_OK; | ||
690 | |||
691 | dev_priv->modeset_on_lid = 0; | ||
692 | |||
693 | mutex_lock(&dev->mode_config.mutex); | ||
694 | drm_helper_resume_force_mode(dev); | ||
695 | mutex_unlock(&dev->mode_config.mutex); | ||
673 | 696 | ||
674 | return NOTIFY_OK; | 697 | return NOTIFY_OK; |
675 | } | 698 | } |