intel_lvds_get_edid() needs to be called when switching GPUs, but it
currently assumes that it will only be called once and that there's
always an LVDS connector present when it's called. Fix this assumptions.

Cc: Andreas Heider <andr...@meetr.de>
Cc: Seth Forshee <seth.fors...@canonical.com>
Original-patch-by: Seth Forshee <seth.fors...@canonical.com>
Signed-off-by: Ramkumar Ramachandra <artag...@gmail.com>
---
 drivers/gpu/drm/i915/intel_lvds.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_lvds.c 
b/drivers/gpu/drm/i915/intel_lvds.c
index 6c09617..8275551 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -927,10 +927,18 @@ static bool intel_lvds_get_edid(struct drm_device *dev)
        struct edid *edid;
        struct drm_i915_private *dev_priv = dev->dev_private;
        struct drm_connector *connector = dev_priv->int_lvds_connector;
-       struct intel_lvds_connector *lvds_connector = 
to_lvds_connector(connector);
+       struct intel_lvds_connector *lvds_connector;
        struct drm_display_mode *scan; /* *modes, *bios_mode; */
        struct drm_display_mode *fixed_mode = NULL;
 
+       if (!connector)
+               return false;
+       lvds_connector = to_lvds_connector(connector);
+
+       /* If we already have an EDID, no need to check again */
+       if (lvds_connector->base.edid)
+               return true;
+
        /*
         * Attempt to get the fixed panel mode from DDC.  Assume that the
         * preferred mode is the right one.
-- 
1.8.5.2.229.g4448466

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to