Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3811329ybi; Mon, 29 Jul 2019 13:05:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqz8PcRnwreOunFlMtvDJocj3uo/r4DFgTHNqmb/WN6rbdGRSvTVOEgcWjovSivuxckcny+8 X-Received: by 2002:a65:57ca:: with SMTP id q10mr108977849pgr.52.1564430741830; Mon, 29 Jul 2019 13:05:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564430741; cv=none; d=google.com; s=arc-20160816; b=fu54hEpj9V/G3abuPipoZoaPCYo9SBcr5nV6ydEZu4H84FgJlxab2U6yRRaNz854xt ODOusG0dRnIPrJz9HsjcskQsKl18u6LPDfKE5m3T9hez0sQSia2HLnZd99JkdHgvlv0B m/3c3zOsitW4/pTAZIhKQPyufbjwrzQOwS0UXxp8cERn6pG5MlvZu9t4dunHkOInRflW OU6ypckW4n0vJGmQaBq0SB3QMzL/1qAHv5f78eFl6i00Wjl2+T2Q1LdXBHKFKJo28GGA LLD265BjXk5yXGC9UVgD1Srlxol4rPAsLNueqeRaCAGpdp/xDLpeXP/Lli+sBZh2iKXr b7PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=H+2dqxjNgtSPWLUIW+gF3rj++38FiS2jgWJZp5LmxLY=; b=iiY6Eu1ZYFsQgvdtM6HwfRHLOU38WRAf1yUI+5c+7B7OE5AbjE+XuQaOITsyI3hjBy jiaRU0EPxA8y8KrDjtm8GF+xuMSHDrFr/J8jAi3F9ZbqQcEbEYyiJInevud9T5Hkve0x keYg/FFp93qyr2n09GweGUl4KFXVLgb0Dn8r/Cq97y4D40KWQ5KQS6xpGbGCaW1iGEjm xKH8RWq4Es5cTIVrTXHf2w/v7s94CC1J563g2GCRu7A39Uvng8/g3E2aQkIcMHnUqNtn zqzrb7PFn3np9ZwUXpBBqgXJsT+H7oIgYEWIOJ+51t92I+sslzBff1gF74pcNNQUsgUV iDqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=m26QAPY3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 4si29813537pfo.266.2019.07.29.13.05.26; Mon, 29 Jul 2019 13:05:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=m26QAPY3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389750AbfG2UC7 (ORCPT + 99 others); Mon, 29 Jul 2019 16:02:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:37564 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390377AbfG2Trp (ORCPT ); Mon, 29 Jul 2019 15:47:45 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3BC332054F; Mon, 29 Jul 2019 19:47:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429664; bh=Hrbc675MLAsFjEaFA9El9Z7mjy9taTlDFUs376GO9O4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m26QAPY3qY+gP7x6MqURAipOjs6PaI50wVrsluMBACoNo2sTxXJk/zRR+iLMSnulm HXBQQoW6pC2aglgp6xd15j88mM0sjthcGQYvrIHlPG/dwqHsDhAuuGEJxILGnXjisK lk4o6brkDvfS7jeovEl9YXEh1doOQt1dvXUIZ+LM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wesley Chalmers , Anthony Koo , Bhawanpreet Lakha , Alex Deucher , Sasha Levin Subject: [PATCH 5.2 055/215] drm/amd/display: Update link rate from DPCD 10 Date: Mon, 29 Jul 2019 21:20:51 +0200 Message-Id: <20190729190750.056856446@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190739.971253303@linuxfoundation.org> References: <20190729190739.971253303@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 53c81fc7875bc2dca358485dac3999e14ec91a00 ] [WHY] Some panels return a link rate of 0 (unknown) in DPCD 0. In this case, an appropriate mode cannot be set, and certain panels will show corruption as they are forced to use a mode they do not support. [HOW] Read DPCD 10 in the case where supported link rate from DPCD 0 is unknown, and pass that value on to the reported link rate. This re-introduces behaviour present in previous versions that appears to have been accidentally removed. Signed-off-by: Wesley Chalmers Reviewed-by: Anthony Koo Acked-by: Bhawanpreet Lakha Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c index 1ee544a32ebb..253311864cdd 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c @@ -1624,8 +1624,7 @@ static bool decide_edp_link_settings(struct dc_link *link, struct dc_link_settin uint32_t link_bw; if (link->dpcd_caps.dpcd_rev.raw < DPCD_REV_14 || - link->dpcd_caps.edp_supported_link_rates_count == 0 || - link->dc->config.optimize_edp_link_rate == false) { + link->dpcd_caps.edp_supported_link_rates_count == 0) { *link_setting = link->verified_link_cap; return true; } @@ -2597,7 +2596,8 @@ void detect_edp_sink_caps(struct dc_link *link) memset(supported_link_rates, 0, sizeof(supported_link_rates)); if (link->dpcd_caps.dpcd_rev.raw >= DPCD_REV_14 && - link->dc->config.optimize_edp_link_rate) { + (link->dc->config.optimize_edp_link_rate || + link->reported_link_cap.link_rate == LINK_RATE_UNKNOWN)) { // Read DPCD 00010h - 0001Fh 16 bytes at one shot core_link_read_dpcd(link, DP_SUPPORTED_LINK_RATES, supported_link_rates, sizeof(supported_link_rates)); @@ -2612,6 +2612,9 @@ void detect_edp_sink_caps(struct dc_link *link) link_rate = linkRateInKHzToLinkRateMultiplier(link_rate_in_khz); link->dpcd_caps.edp_supported_link_rates[link->dpcd_caps.edp_supported_link_rates_count] = link_rate; link->dpcd_caps.edp_supported_link_rates_count++; + + if (link->reported_link_cap.link_rate < link_rate) + link->reported_link_cap.link_rate = link_rate; } } } -- 2.20.1