My Samsung N210 has a VBT with DEVICE_TYPE_INT_LFP with a zero
addin-offset. With the check in place, the panel was declared absent.

Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk>
Cc: Zhao Yakui <yakui.z...@intel.com>
---
 drivers/gpu/drm/i915/intel_lvds.c |   34 +++++++++++++++-------------------
 1 files changed, 15 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_lvds.c 
b/drivers/gpu/drm/i915/intel_lvds.c
index 218875a..12fd5fe 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -748,38 +748,34 @@ static void intel_find_lvds_downclock(struct drm_device 
*dev,
  * If it is present, return 1.
  * If it is not present, return false.
  * If no child dev is parsed from VBT, it assumes that the LVDS is present.
- * Note: The addin_offset should also be checked for LVDS panel.
- * Only when it is non-zero, it is assumed that it is present.
  */
-static int lvds_is_present_in_vbt(struct drm_device *dev)
+static bool lvds_is_present_in_vbt(struct drm_device *dev)
 {
        struct drm_i915_private *dev_priv = dev->dev_private;
-       struct child_device_config *p_child;
-       int i, ret;
+       int i;
 
        if (!dev_priv->child_dev_num)
-               return 1;
+               return true;
 
-       ret = 0;
        for (i = 0; i < dev_priv->child_dev_num; i++) {
-               p_child = dev_priv->child_dev + i;
+               struct child_device_config *child = dev_priv->child_dev + i;
+
                /*
                 * If the device type is not LFP, continue.
                 * If the device type is 0x22, it is also regarded as LFP.
                 */
-               if (p_child->device_type != DEVICE_TYPE_INT_LFP &&
-                       p_child->device_type != DEVICE_TYPE_LFP)
-                       continue;
-
-               /* The addin_offset should be checked. Only when it is
-                * non-zero, it is regarded as present.
+               if (p_child->device_type == DEVICE_TYPE_INT_LFP ||
+                   p_child->device_type == DEVICE_TYPE_LFP)
+                       return true;
+
+               /* Note that we used to check for a non-zero addin offset
+                * before declaring the panel present. However, we have found
+                * panels with zero offset in the wild and so must assume
+                * that the VBT is correct.
                 */
-               if (p_child->addin_offset) {
-                       ret = 1;
-                       break;
-               }
        }
-       return ret;
+
+       return false;
 }
 
 /**
-- 
1.7.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to