This is a note to let you know that I've just added the patch titled

    drm/i915: fall back to bit-banging if GMBUS fails in CRT EDID reads

to the 3.4-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-i915-fall-back-to-bit-banging-if-gmbus-fails-in-crt-edid-reads.patch
and it can be found in the queue-3.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From f1a2f5b7c5f0941d23eef0a095c0b99bf8d051e6 Mon Sep 17 00:00:00 2001
From: Jani Nikula <[email protected]>
Date: Mon, 13 Aug 2012 13:22:35 +0300
Subject: drm/i915: fall back to bit-banging if GMBUS fails in CRT EDID reads

From: Jani Nikula <[email protected]>

commit f1a2f5b7c5f0941d23eef0a095c0b99bf8d051e6 upstream.

GMBUS was enabled over bit-banging as the default in commits:

commit c3dfefa0a6d235bd465309e12f4c56ea16e71111
Author: Daniel Vetter <[email protected]>
Date:   Tue Feb 14 22:37:25 2012 +0100

    drm/i915: reenable gmbus on gen3+ again

and

commit 0fb3f969c8683505fb7323c06bf8a999a5a45a15
Author: Daniel Vetter <[email protected]>
Date:   Fri Mar 2 19:38:30 2012 +0100

    drm/i915: enable gmbus on gen2

Unfortunately, GMBUS seems to fail on some CRT displays. Add a bit-banging
fallback to CRT EDID reads.

LKML-Reference: <[email protected]>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=45881
Signed-off-by: Jani Nikula <[email protected]>
Tested-by: Alex Ferrando <[email protected]>
Cc: [email protected] (for 3.4+3.5)
Signed-off-by: Daniel Vetter <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>


---
 drivers/gpu/drm/i915/intel_crt.c |   36 +++++++++++++++++++++++++++++++++---
 1 file changed, 33 insertions(+), 3 deletions(-)

--- a/drivers/gpu/drm/i915/intel_crt.c
+++ b/drivers/gpu/drm/i915/intel_crt.c
@@ -266,6 +266,36 @@ static bool intel_crt_detect_hotplug(str
        return ret;
 }
 
+static struct edid *intel_crt_get_edid(struct drm_connector *connector,
+                               struct i2c_adapter *i2c)
+{
+       struct edid *edid;
+
+       edid = drm_get_edid(connector, i2c);
+
+       if (!edid && !intel_gmbus_is_forced_bit(i2c)) {
+               DRM_DEBUG_KMS("CRT GMBUS EDID read failed, retry using GPIO 
bit-banging\n");
+               intel_gmbus_force_bit(i2c, true);
+               edid = drm_get_edid(connector, i2c);
+               intel_gmbus_force_bit(i2c, false);
+       }
+
+       return edid;
+}
+
+/* local version of intel_ddc_get_modes() to use intel_crt_get_edid() */
+static int intel_crt_ddc_get_modes(struct drm_connector *connector,
+                               struct i2c_adapter *adapter)
+{
+       struct edid *edid;
+
+       edid = intel_crt_get_edid(connector, adapter);
+       if (!edid)
+               return 0;
+
+       return intel_connector_update_modes(connector, edid);
+}
+
 static bool intel_crt_detect_ddc(struct drm_connector *connector)
 {
        struct intel_crt *crt = intel_attached_crt(connector);
@@ -279,7 +309,7 @@ static bool intel_crt_detect_ddc(struct
                struct edid *edid;
                bool is_digital = false;
 
-               edid = drm_get_edid(connector,
+               edid = intel_crt_get_edid(connector,
                        &dev_priv->gmbus[dev_priv->crt_ddc_pin].adapter);
                /*
                 * This may be a DVI-I connector with a shared DDC
@@ -477,13 +507,13 @@ static int intel_crt_get_modes(struct dr
        struct drm_i915_private *dev_priv = dev->dev_private;
        int ret;
 
-       ret = intel_ddc_get_modes(connector,
+       ret = intel_crt_ddc_get_modes(connector,
                                 
&dev_priv->gmbus[dev_priv->crt_ddc_pin].adapter);
        if (ret || !IS_G4X(dev))
                return ret;
 
        /* Try to probe digital port for output in DVI-I -> VGA mode. */
-       return intel_ddc_get_modes(connector,
+       return intel_crt_ddc_get_modes(connector,
                                   &dev_priv->gmbus[GMBUS_PORT_DPB].adapter);
 }
 


Patches currently in stable-queue which might be from [email protected] are

queue-3.4/drm-i915-fall-back-to-bit-banging-if-gmbus-fails-in-crt-edid-reads.patch
queue-3.4/drm-i915-extract-connector-update-from-intel_ddc_get_modes-for-reuse.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to