From patchwork Thu Apr 21 06:18:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhangi Shrivastava X-Patchwork-Id: 8896321 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EEB799F1C1 for ; Thu, 21 Apr 2016 06:15:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1A85C202EC for ; Thu, 21 Apr 2016 06:15:32 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C91C020225 for ; Thu, 21 Apr 2016 06:15:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0DA546E263; Thu, 21 Apr 2016 06:15:28 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id 242616E263 for ; Thu, 21 Apr 2016 06:15:25 +0000 (UTC) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP; 20 Apr 2016 23:15:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,512,1455004800"; d="scan'208";a="959574517" Received: from shubhangi-desktop.iind.intel.com ([10.223.25.115]) by orsmga002.jf.intel.com with ESMTP; 20 Apr 2016 23:15:21 -0700 From: Shubhangi Shrivastava To: intel-gfx@lists.freedesktop.org Date: Thu, 21 Apr 2016 11:48:35 +0530 Message-Id: <1461219515-27479-1-git-send-email-shubhangi.shrivastava@intel.com> X-Mailer: git-send-email 2.6.1 Cc: Shubhangi Shrivastava Subject: [Intel-gfx] [PATCH] drm/i915: Use fail safe mode when edid is corrupt X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch forces panel to use fail safe mode when it is detected that edid is corrupt For now this is performed only when automated test request is received. This is because DRM's edid parser recovers from basic corruption in edid resulting in normal functioning. This can be modified to be used anytime by using edid_corrupt flag instead of checking for Automated test request flag. Signed-off-by: Sivakumar Thulasimani Signed-off-by: Shubhangi Shrivastava --- drivers/gpu/drm/i915/intel_dp.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index a3fc494..8b88161 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -1494,9 +1494,11 @@ intel_dp_compute_config(struct intel_encoder *encoder, max_lane_count, common_rates[max_clock], adjusted_mode->crtc_clock); - /* Walk through all bpp values. Luckily they're all nicely spaced with 2 - * bpc in between. */ - bpp = pipe_config->pipe_bpp; + if (intel_dp->compliance_test_data == INTEL_DP_RESOLUTION_FAILSAFE) + bpp = 18; + else + bpp = pipe_config->pipe_bpp; + if (is_edp(intel_dp)) { /* Get bpp from vbt only for panels that dont have bpp in edid */ @@ -1518,6 +1520,10 @@ intel_dp_compute_config(struct intel_encoder *encoder, min_clock = max_clock; } + /* + * Walk through all bpp values. Luckily they're all nicely spaced with + * 2bpc in between. + */ for (; bpp >= 6*3; bpp -= 2*3) { mode_rate = intel_dp_link_required(adjusted_mode->crtc_clock, bpp); @@ -4680,6 +4686,8 @@ intel_dp_detect(struct drm_connector *connector, bool force) intel_dp->detect_done = false; + if (intel_dp->compliance_test_data == INTEL_DP_RESOLUTION_FAILSAFE) + return connector_status_connected; if (intel_connector->detect_edid) return connector_status_connected; else @@ -4715,8 +4723,18 @@ intel_dp_force(struct drm_connector *connector) static int intel_dp_get_modes(struct drm_connector *connector) { struct intel_connector *intel_connector = to_intel_connector(connector); + struct intel_dp *intel_dp = intel_attached_dp(connector); struct edid *edid; + if (intel_dp->compliance_test_data == INTEL_DP_RESOLUTION_FAILSAFE) { + int count; + + count = drm_add_modes_noedid(connector, 640, 480); + drm_set_preferred_mode(connector, 640, 480); + DRM_ERROR("Using fail mode since edid is corrupt\n"); + return count; + } + edid = intel_connector->detect_edid; if (edid) { int ret = intel_connector_update_modes(connector, edid);