Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1517597ybb; Sat, 11 Apr 2020 05:28:16 -0700 (PDT) X-Google-Smtp-Source: APiQypL1sfsxRe7vTzLvOYooFV5tp7D86Soz/SQvWChwD+eCkmy/BrPF0M6fCkFKdMSU0jwvpLdX X-Received: by 2002:a05:620a:cc6:: with SMTP id b6mr8331764qkj.74.1586608096197; Sat, 11 Apr 2020 05:28:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586608096; cv=none; d=google.com; s=arc-20160816; b=xFHOpRNA1hUWPi1CIlw5KHaA9qciVKdVuA7FBma5Kc1YnNa9QktQzgski+m1/jQDHo TfVmEUIz9zD+zXOvy6HIubsDWtsSCm88nEOG5M2mzukxVRVpYOnvM6IkOSNJ26OWPtJC jKPXtEhWtyUOinEpc8ukR/2kGsVSQMSE9MsmNje5+34JrEwNYm9KYJPpWvDwXqud1EIS KjhYS1TldSQOuiSnxi6EvNpI6No8lujBLsr6iiriI18GLBSRV8q34+AwuYCpa3lEXT0M SxhWY1uR8j3YPx4/Mr9NBjPrpI5MVTIySwFqIi/EXrv/qYV9tQtNylhmmAEGGsSEYFXr rLHg== 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=SQ67PYc4wQVHa8WT5z9KWOG2lLNwIpv76HbO41F7vXw=; b=m9kgXAW50rTIRvRznRkBWmjC/08GvN9RKULaa0D1jTrUTuNrKNCeJqR4UVFFd61fIO wW6Km4lclwa2/vNt0wHeNHbDw7YCVQBr4C4CvWKw9zItlKQHea61S7PFIuNSjWmlkRnd gPTYxJr7bmRa7XWV3KoJMTju8igIb1/L4/qBq60DkUFl7RduA6JeHIa6UDtLwd3MjGPY LcnL/6agCgZKMkBPgvVs5DqSXqpjT2gv03mpa7/4ty6tLtM3r2i58s6JeCctYHFPGRxF onElJSMIQD4x6Fauf10zNuRsU7ywgSUfLUGV0IWre5mFnKc6ECbnZcxgWMKTWcrjmSdY nkgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xEhBmJgB; 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 i14si3016928qvf.217.2020.04.11.05.28.02; Sat, 11 Apr 2020 05:28:16 -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=xEhBmJgB; 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 S1727496AbgDKMPJ (ORCPT + 99 others); Sat, 11 Apr 2020 08:15:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:48856 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726934AbgDKMPF (ORCPT ); Sat, 11 Apr 2020 08:15:05 -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 46BA620692; Sat, 11 Apr 2020 12:15:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586607305; bh=64g/FuVY4FkADB9UpvuwvHmWfRLDc5mR7iw725sbOe8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xEhBmJgBrboQWKRA8HHhCvzQ/m1SwjX47inhuE+6UbDsP9e9pQ/s4ys5NnZB5Eezn 7ZgRBM5JZYEl1JeNCIlgWolvMcIHLChtHFcAD9uoBSbjIrQX5EOpWhzAjBr/R26GC/ ofgQVyKDeOsGO+MW7xAsqyZaXWdYSu6Xd/uCwIig= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mario Kleiner , Alex Deucher , Sasha Levin Subject: [PATCH 4.19 06/54] drm/amd/display: Add link_rate quirk for Apple 15" MBP 2017 Date: Sat, 11 Apr 2020 14:08:48 +0200 Message-Id: <20200411115508.931334215@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200411115508.284500414@linuxfoundation.org> References: <20200411115508.284500414@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 From: Mario Kleiner [ Upstream commit dec9de2ada523b344eb2428abfedf9d6cd0a0029 ] This fixes a problem found on the MacBookPro 2017 Retina panel: The panel reports 10 bpc color depth in its EDID, and the firmware chooses link settings at boot which support enough bandwidth for 10 bpc (324000 kbit/sec aka LINK_RATE_RBR2 aka 0xc), but the DP_MAX_LINK_RATE dpcd register only reports 2.7 Gbps (multiplier value 0xa) as possible, in direct contradiction of what the firmware successfully set up. This restricts the panel to 8 bpc, not providing the full color depth of the panel on Linux <= 5.5. Additionally, commit '4a8ca46bae8a ("drm/amd/display: Default max bpc to 16 for eDP")' introduced into Linux 5.6-rc1 will unclamp panel depth to its full 10 bpc, thereby requiring a eDP bandwidth for all modes that exceeds the bandwidth available and causes all modes to fail validation -> No modes for the laptop panel -> failure to set any mode -> Panel goes dark. This patch adds a quirk specific to the MBP 2017 15" Retina panel to override reported max link rate to the correct maximum of 0xc = LINK_RATE_RBR2 to fix the darkness and reduced display precision. Please apply for Linux 5.6+ to avoid regressing Apple MBP panel support. Signed-off-by: Mario Kleiner Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 122249da03ab7..a4928854a3de5 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 @@ -2440,6 +2440,17 @@ static bool retrieve_link_cap(struct dc_link *link) sink_id.ieee_device_id, sizeof(sink_id.ieee_device_id)); + /* Quirk Apple MBP 2017 15" Retina panel: Wrong DP_MAX_LINK_RATE */ + { + uint8_t str_mbp_2017[] = { 101, 68, 21, 101, 98, 97 }; + + if ((link->dpcd_caps.sink_dev_id == 0x0010fa) && + !memcmp(link->dpcd_caps.sink_dev_id_str, str_mbp_2017, + sizeof(str_mbp_2017))) { + link->reported_link_cap.link_rate = 0x0c; + } + } + core_link_read_dpcd( link, DP_SINK_HW_REVISION_START, -- 2.20.1