From patchwork Tue Jan 21 12:56:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Lee, Shawn C" X-Patchwork-Id: 11343067 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ACA381820 for ; Tue, 21 Jan 2020 04:58:02 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 94D9B24653 for ; Tue, 21 Jan 2020 04:58:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 94D9B24653 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6C60E6E1E6; Tue, 21 Jan 2020 04:58:00 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id B812D6E1E6 for ; Tue, 21 Jan 2020 04:57:58 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Jan 2020 20:57:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,344,1574150400"; d="scan'208";a="219829851" Received: from shawnle1-build-machine.itwn.intel.com ([10.5.253.9]) by orsmga008.jf.intel.com with ESMTP; 20 Jan 2020 20:57:56 -0800 From: Lee Shawn C To: intel-gfx@lists.freedesktop.org Date: Tue, 21 Jan 2020 20:56:13 +0800 Message-Id: <20200121125613.21138-1-shawn.c.lee@intel.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH] drm/i915/dp: set fail-safe mode if EDID corrupt X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Cooper Chiou Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 Cc: Ville Syrjälä Cc: Jani Nikula Cc: Cooper Chiou Signed-off-by: Lee Shawn C --- 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