From patchwork Mon Mar 13 08:12:59 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: 9619959 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 F110E604CC for ; Mon, 13 Mar 2017 07:45:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E1CB5283E0 for ; Mon, 13 Mar 2017 07:45:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D4C8428417; Mon, 13 Mar 2017 07:45:18 +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 6CA61283E0 for ; Mon, 13 Mar 2017 07:45:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B20B16E267; Mon, 13 Mar 2017 07:45:16 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id 416456E267 for ; Mon, 13 Mar 2017 07:45:15 +0000 (UTC) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Mar 2017 00:45:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.36,157,1486454400"; d="scan'208"; a="1121761568" Received: from shawnle1-cm6330-cm6630-cm6730-cm6830-m11aa-8.itwn.intel.com ([10.5.230.140]) by fmsmga001.fm.intel.com with ESMTP; 13 Mar 2017 00:45:13 -0700 From: "Lee, Shawn C" To: intel-gfx@lists.freedesktop.org Date: Mon, 13 Mar 2017 16:12:59 +0800 Message-Id: <1489392779-25893-1-git-send-email-shawn.c.lee@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1488443763-26709-1-git-send-email-shawn.c.lee@intel.com> References: <1488443763-26709-1-git-send-email-shawn.c.lee@intel.com> Cc: Cooper Chiou , Jani Nikula , Rodrigo Vivi , Wei Shun Chen Subject: [Intel-gfx] [PATCH v3] 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" Display driver read DPCD register 0x202, 0x203 and 0x204 to identify eDP sink status.If PSR exit is ongoing at eDP sink, and eDP source read these registers at the same time. Panel will report EQ & symbol lock not done. It will cause panel display flicking. Try to read link status more times if eDP EQ not done. Panel side request at least 1000us for fast link train while doing PSR exit. So wait more than 1000us then retrieve sink's 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 Cc: Rodrigo Vivi Signed-off-by: Lee, Shawn C --- drivers/gpu/drm/i915/intel_dp.c | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 024798a9c016..d50827a92aa2 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -4225,15 +4225,11 @@ static void intel_dp_handle_test_request(struct intel_dp *intel_dp) { struct intel_encoder *intel_encoder = &dp_to_dig_port(intel_dp)->base; struct drm_device *dev = intel_dp_to_dev(intel_dp); - u8 link_status[DP_LINK_STATUS_SIZE]; + struct drm_i915_private *dev_priv = dev->dev_private; + u8 link_status[DP_LINK_STATUS_SIZE], retry = 1; WARN_ON(!drm_modeset_is_locked(&dev->mode_config.connection_mutex)); - if (!intel_dp_get_link_status(intel_dp, link_status)) { - DRM_ERROR("Failed to get link status\n"); - return; - } - if (!intel_encoder->base.crtc) return; @@ -4245,13 +4241,31 @@ static void intel_dp_handle_test_request(struct intel_dp *intel_dp) if (!intel_dp->lane_count) return; + if (is_edp(intel_dp) && dev_priv->psr.enabled) + retry = 3; + /* Retrain if Channel EQ or CR not ok */ - if (!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); + while ( retry-- ) { + if (!intel_dp_get_link_status(intel_dp, link_status)) { + DRM_ERROR("Failed to get link status\n"); + return; + } - intel_dp_retrain_link(intel_dp); + if (drm_dp_channel_eq_ok(link_status, intel_dp->lane_count)) + return; + + /* + * EQ not ok may caused by fast link train while exit PSR active, + * wait at least 1000 us then read it again. + */ + if (retry) + usleep_range(1000, 1500); } + + DRM_DEBUG_KMS("%s: channel EQ not ok, retraining\n", + intel_encoder->base.name); + + intel_dp_retrain_link(intel_dp); } /*