[Intel-gfx] [PATCH] drm/i915/dp: set fail-safe mode if EDID corrupt

Lee Shawn C shawn.c.lee at intel.com
Tue Jan 21 12:56:13 UTC 2020


According to chapter 5.1.1.2 in DP spec. When the Sink
device capability is unknown, for example due to corruption
of an EDID. The Source device may fall back to a set of
fall-back video timing formats its choice. When none of
the fall-back video timing formats is acceptable, the
Source device must fall back to the fail safe mode,
which is 640 x 480 at 60Hz.

This change set source driver output fail-safe mode automatically
if EDID corrupt. It may also benefit link layer compliance
test case "4.2.2.6  EDID Corruption Detection".

Cc: Manasi Navare <manasi.d.navare at intel.com>
Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
Cc: Jani Nikula <jani.nikula at linux.intel.com>
Cc: Cooper Chiou <cooper.chiou at intel.com>
Signed-off-by: Lee Shawn C <shawn.c.lee at intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index c27d3e7ac219..7e072db4a530 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -5659,9 +5659,18 @@ intel_dp_get_edid(struct intel_dp *intel_dp)
 			return NULL;
 
 		return drm_edid_duplicate(intel_connector->edid);
-	} else
-		return drm_get_edid(&intel_connector->base,
+	} else {
+		struct edid *edid;
+
+		edid = drm_get_edid(&intel_connector->base,
 				    &intel_dp->aux.ddc);
+
+		if (intel_connector->base.edid_corrupt || !edid)
+			if (drm_add_modes_noedid(&intel_connector->base, 640, 480))
+				drm_set_preferred_mode(&intel_connector->base, 640, 480);
+
+		return edid;
+	}
 }
 
 static void
-- 
2.17.1



More information about the Intel-gfx mailing list