drm/gma500/cdv: Check vbt config bits when detecting lvds panels
authorPatrik Jakobsson <patrik.r.jakobsson@gmail.com>
Tue, 16 Apr 2019 11:46:07 +0000 (13:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Jun 2019 10:21:49 +0000 (12:21 +0200)
commit 7c420636860a719049fae9403e2c87804f53bdde upstream.

Some machines have an lvds child device in vbt even though a panel is
not attached. To make detection more reliable we now also check the lvds
config bits available in the vbt.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1665766
Cc: stable@vger.kernel.org
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190416114607.1072-1-patrik.r.jakobsson@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/gma500/cdv_intel_lvds.c
drivers/gpu/drm/gma500/intel_bios.c
drivers/gpu/drm/gma500/psb_drv.h

index e64960db32246d73902a946930835a0a90581811..e022951894e3d01bd26766c05af2f9aa44215e8d 100644 (file)
@@ -594,6 +594,9 @@ void cdv_intel_lvds_init(struct drm_device *dev,
        int pipe;
        u8 pin;
 
+       if (!dev_priv->lvds_enabled_in_vbt)
+               return;
+
        pin = GMBUS_PORT_PANEL;
        if (!lvds_is_present_in_vbt(dev, &pin)) {
                DRM_DEBUG_KMS("LVDS is not present in VBT\n");
index 63bde4e86c6a11643419a099b2e3b4216a0c038b..e019ea271ffc432262f3743d8e548cf14c76d518 100644 (file)
@@ -436,6 +436,9 @@ parse_driver_features(struct drm_psb_private *dev_priv,
        if (driver->lvds_config == BDB_DRIVER_FEATURE_EDP)
                dev_priv->edp.support = 1;
 
+       dev_priv->lvds_enabled_in_vbt = driver->lvds_config != 0;
+       DRM_DEBUG_KMS("LVDS VBT config bits: 0x%x\n", driver->lvds_config);
+
        /* This bit means to use 96Mhz for DPLL_A or not */
        if (driver->primary_lfp_id)
                dev_priv->dplla_96mhz = true;
index 821497dbd3fcbee99b2feb4e7a2890b2b40f213f..f9814c4ed51b8e808355f359c16dbb39ad627a1b 100644 (file)
@@ -538,6 +538,7 @@ struct drm_psb_private {
        int lvds_ssc_freq;
        bool is_lvds_on;
        bool is_mipi_on;
+       bool lvds_enabled_in_vbt;
        u32 mipi_ctrl_display;
 
        unsigned int core_freq;