From patchwork Thu Jun 4 00:23:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Navare, Manasi" X-Patchwork-Id: 11586739 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 B799C739 for ; Thu, 4 Jun 2020 00:23:22 +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 9FBC820663 for ; Thu, 4 Jun 2020 00:23:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9FBC820663 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 D4EAA89998; Thu, 4 Jun 2020 00:23:20 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id 77B5689998 for ; Thu, 4 Jun 2020 00:23:19 +0000 (UTC) IronPort-SDR: y7bhHSlUoJi1WMw5Lojb13yP1xnjEtB6nc2v0KczTAKQp4iTrS6ij9M5oqloN5z40XgvPIZeBX pJKoL6BvR+RA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2020 17:23:18 -0700 IronPort-SDR: fOYmDE3Pn0HOFF7/SkB09iMLVNU5rQgy7SkG7fSpx5LINki6+L4t14vJfDB2f4P/THwv1HB/Ls ojv/TvuEOzOw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,470,1583222400"; d="scan'208";a="312749500" Received: from labuser-z97x-ud5h.jf.intel.com ([10.165.21.211]) by FMSMGA003.fm.intel.com with ESMTP; 03 Jun 2020 17:23:18 -0700 From: Manasi Navare To: intel-gfx@lists.freedesktop.org Date: Wed, 3 Jun 2020 17:23:59 -0700 Message-Id: <20200604002359.17128-1-manasi.d.navare@intel.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH] drm/i915/dp: Reset link params on connector disconnect 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" We have noticed that when link training fails the panel sends a long pulse indicating connector disconnect. In this case we need to reset the link parameters instead of continuing to use the fallback parameters since else this long pulse by the panel followed by a modeset request which was triggered by the userspace before getting the connector status as disconnected, will result into a modeset now using lower link rate/lane count values. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1385 Cc: Jani Nikula Cc: Ville Syrjälä Signed-off-by: Manasi Navare --- drivers/gpu/drm/i915/display/intel_dp.c | 28 +++++++++++++++++-------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 55fda074c0ad..f7af372647dd 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -6111,6 +6111,18 @@ intel_dp_unset_edid(struct intel_dp *intel_dp) intel_dp->edid_quirks = 0; } +static void +intel_dp_reset_link_params(struct intel_dp *intel_dp) +{ + /* Initial max link lane count */ + intel_dp->max_link_lane_count = intel_dp_max_common_lane_count(intel_dp); + + /* Initial max link rate */ + intel_dp->max_link_rate = intel_dp_max_common_rate(intel_dp); + + intel_dp->reset_link_params = false; +} + static int intel_dp_detect(struct drm_connector *connector, struct drm_modeset_acquire_ctx *ctx, @@ -6139,6 +6151,11 @@ intel_dp_detect(struct drm_connector *connector, memset(&intel_dp->compliance, 0, sizeof(intel_dp->compliance)); memset(intel_dp->dsc_dpcd, 0, sizeof(intel_dp->dsc_dpcd)); + /*Reset the immutable VRR Capable property */ + drm_connector_set_vrr_capable_property(connector, + false); + intel_dp_reset_link_params(intel_dp); + if (intel_dp->is_mst) { drm_dbg_kms(&dev_priv->drm, "MST device may have disappeared %d vs %d\n", @@ -6152,15 +6169,8 @@ intel_dp_detect(struct drm_connector *connector, goto out; } - if (intel_dp->reset_link_params) { - /* Initial max link lane count */ - intel_dp->max_link_lane_count = intel_dp_max_common_lane_count(intel_dp); - - /* Initial max link rate */ - intel_dp->max_link_rate = intel_dp_max_common_rate(intel_dp); - - intel_dp->reset_link_params = false; - } + if (intel_dp->reset_link_params) + intel_dp_reset_link_params(intel_dp); intel_dp_print_rates(intel_dp);