Skip to content

Commit 4e4b72c

Browse files
patjakgregkh
authored andcommitted
drm/gma500/psb: Actually use VBT mode when it is found
commit 82bc9a42cf854fdf63155759c0aa790bd1f361b0 upstream. With LVDS we were incorrectly picking the pre-programmed mode instead of the prefered mode provided by VBT. Make sure we pick the VBT mode if one is provided. It is likely that the mode read-out code is still wrong but this patch fixes the immediate problem on most machines. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78562 Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170418114332.12183-1-patrik.r.jakobsson@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 14bfe11 commit 4e4b72c

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

drivers/gpu/drm/gma500/psb_intel_lvds.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -783,20 +783,23 @@ void psb_intel_lvds_init(struct drm_device *dev,
783783
if (scan->type & DRM_MODE_TYPE_PREFERRED) {
784784
mode_dev->panel_fixed_mode =
785785
drm_mode_duplicate(dev, scan);
786+
DRM_DEBUG_KMS("Using mode from DDC\n");
786787
goto out; /* FIXME: check for quirks */
787788
}
788789
}
789790

790791
/* Failed to get EDID, what about VBT? do we need this? */
791-
if (mode_dev->vbt_mode)
792+
if (dev_priv->lfp_lvds_vbt_mode) {
792793
mode_dev->panel_fixed_mode =
793-
drm_mode_duplicate(dev, mode_dev->vbt_mode);
794+
drm_mode_duplicate(dev, dev_priv->lfp_lvds_vbt_mode);
794795

795-
if (!mode_dev->panel_fixed_mode)
796-
if (dev_priv->lfp_lvds_vbt_mode)
797-
mode_dev->panel_fixed_mode =
798-
drm_mode_duplicate(dev,
799-
dev_priv->lfp_lvds_vbt_mode);
796+
if (mode_dev->panel_fixed_mode) {
797+
mode_dev->panel_fixed_mode->type |=
798+
DRM_MODE_TYPE_PREFERRED;
799+
DRM_DEBUG_KMS("Using mode from VBT\n");
800+
goto out;
801+
}
802+
}
800803

801804
/*
802805
* If we didn't get EDID, try checking if the panel is already turned
@@ -813,6 +816,7 @@ void psb_intel_lvds_init(struct drm_device *dev,
813816
if (mode_dev->panel_fixed_mode) {
814817
mode_dev->panel_fixed_mode->type |=
815818
DRM_MODE_TYPE_PREFERRED;
819+
DRM_DEBUG_KMS("Using pre-programmed mode\n");
816820
goto out; /* FIXME: check for quirks */
817821
}
818822
}

0 commit comments

Comments
 (0)