From patchwork Thu Feb 2 10:27:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lee, Shawn C" X-Patchwork-Id: 9551535 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E0F3660453 for ; Thu, 2 Feb 2017 10:00:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C0D4A20855 for ; Thu, 2 Feb 2017 10:00:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B57C528404; Thu, 2 Feb 2017 10:00:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5D31820855 for ; Thu, 2 Feb 2017 10:00:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 78FC76E980; Thu, 2 Feb 2017 10:00:46 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1EF3D6E981 for ; Thu, 2 Feb 2017 10:00:45 +0000 (UTC) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP; 02 Feb 2017 02:00:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.33,324,1477983600"; d="scan'208"; a="1102046470" Received: from shawnle1-cm6330-cm6630-cm6730-cm6830-m11aa-8.itwn.intel.com ([10.5.230.138]) by fmsmga001.fm.intel.com with ESMTP; 02 Feb 2017 02:00:40 -0800 From: "Lee, Shawn C" To: intel-gfx@lists.freedesktop.org Date: Thu, 2 Feb 2017 18:27:10 +0800 Message-Id: <1486031230-4914-1-git-send-email-shawn.c.lee@intel.com> X-Mailer: git-send-email 1.7.9.5 Cc: Jani Nikula , Cooper Chiou , Wei Shun Chen Subject: [Intel-gfx] [PATCH] drm/i915/dp: Read link status more times when EQ not done 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-Virus-Scanned: ClamAV using ClamSMTP From: "Lee, Shawn C" When user space link status, display driver read DPCD register 0x202, 0x203 and 0x204 to identify sink status. When PSR exit is ongoing before EQ done. Panel will report EQ & symbol lock not done. Both of them are under progressing at the same time to cause this issue. This WA try to read link status more times if EQ not done. Panel spec request at least 1000us for fast link train when PSR exit. So driver will wait 1000us~1500us then retrieve sink link status again. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99639 TEST=Reboot DUT and no flicking on local display at login screen Cc: Cooper Chiou Cc: Wei Shun Chen Cc: Gary C Wang Cc: Jani Nikula Signed-off-by: Lee, Shawn C --- drivers/gpu/drm/i915/intel_dp.c | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index e80d620846c8..a9a6ce476438 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -4136,13 +4136,36 @@ static void intel_dp_handle_test_request(struct intel_dp *intel_dp) return; /* if link training is requested we should perform it always */ - if ((intel_dp->compliance.test_type == DP_TEST_LINK_TRAINING) || - (!drm_dp_channel_eq_ok(link_status, intel_dp->lane_count))) { - DRM_DEBUG_KMS("%s: channel EQ not ok, retraining\n", - intel_encoder->base.name); + if (intel_dp->compliance.test_type == DP_TEST_LINK_TRAINING) { + DRM_DEBUG_KMS("%s: compliance test mode, retraining\n", + intel_encoder->base.name); + } else { + u8 retry; + + for (retry = 0; retry < 3; retry++) { + if (!drm_dp_channel_eq_ok(link_status, intel_dp->lane_count)) { + /* + * EQ not ok may caused by fast link train while exit PSR active, + * wait at least 1000 us then read it again. + */ + DRM_DEBUG_KMS("%s: channel EQ not ok, retry = %d, DPCD 0x202 = 0x%x, 0x203 = 0x%x, 0x204 = 0x%x\n", + intel_encoder->base.name, retry, link_status[0], link_status[1], link_status[2]); + usleep_range(1000, 1500); + if (!intel_dp_get_link_status(intel_dp, link_status)) { + DRM_ERROR("Failed to get link status\n"); + return; + } + } else { + /* channel EQ is fine */ + return; + } + } - intel_dp_retrain_link(intel_dp); + DRM_DEBUG_KMS("%s: channel EQ not ok, retraining\n", + intel_encoder->base.name); } + + intel_dp_retrain_link(intel_dp); } /*