linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aditya Garg <gargaditya08@live.com>
To: Harry Wentland <hwentlan@amd.com>
Cc: Alex Deucher <alexdeucher@gmail.com>,
	"harry.wentland@amd.com" <harry.wentland@amd.com>,
	"sunpeng.li@amd.com" <sunpeng.li@amd.com>,
	"Rodrigo.Siqueira@amd.com" <Rodrigo.Siqueira@amd.com>,
	"alexander.deucher@amd.com" <alexander.deucher@amd.com>,
	"christian.koenig@amd.com" <christian.koenig@amd.com>,
	"Xinhui.Pan@amd.com" <Xinhui.Pan@amd.com>,
	"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"Felix.Kuehling@amd.com" <Felix.Kuehling@amd.com>,
	"evan.quan@amd.com" <evan.quan@amd.com>,
	"stylon.wang@amd.com" <stylon.wang@amd.com>,
	"wesley.chalmers@amd.com" <wesley.chalmers@amd.com>,
	"qingqing.zhuo@amd.com" <qingqing.zhuo@amd.com>,
	"George.Shen@amd.com" <George.Shen@amd.com>,
	"roman.li@amd.com" <roman.li@amd.com>,
	"solomon.chiu@amd.com" <solomon.chiu@amd.com>,
	"Aurabindo.Pillai@amd.com" <Aurabindo.Pillai@amd.com>,
	"wayne.lin@amd.com" <wayne.lin@amd.com>,
	"mikita.lipski@amd.com" <mikita.lipski@amd.com>,
	"Bhawanpreet.Lakha@amd.com" <Bhawanpreet.Lakha@amd.com>,
	"agustin.gutierrez@amd.com" <agustin.gutierrez@amd.com>,
	"pavle.kotarac@amd.com" <pavle.kotarac@amd.com>,
	Aun-Ali Zaidi <admin@kodeit.net>,
	Orlando Chamberlain <redecorating@protonmail.com>
Subject: [PATCH v2] drm/amd/display: Force link_rate as LINK_RATE_RBR2 for 2018 15" Apple Retina panels
Date: Sat, 29 Jan 2022 05:49:55 +0000	[thread overview]
Message-ID: <5CC8BCC9-176A-4478-B03B-3E4B4D7D88E6@live.com> (raw)
In-Reply-To: <0932bbf6-409e-0d3e-2824-b33914033f81@amd.com>

From: Aun-Ali Zaidi <admin@kodeit.net>
 
The eDP link rate reported by the DP_MAX_LINK_RATE dpcd register (0xa) is
contradictory to the highest rate supported reported by
EDID (0xc = LINK_RATE_RBR2). The effects of this compounded with commit
'4a8ca46bae8a ("drm/amd/display: Default max bpc to 16 for eDP")' results
in no display modes being found and a dark panel.

For now, simply force the maximum supported link rate for the eDP attached
2018 15" Apple Retina panels.

Additionally, we must also check the firmware revision since the device ID
reported by the DPCD is identical to that of the more capable 16,1,
incorrectly quirking it. We also use said firmware check to quirk the
refreshed 15,1 models with Vega graphics as they use a slightly newer
firmware version.

Tested-by: Aun-Ali Zaidi <admin@kodeit.net>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Aun-Ali Zaidi <admin@kodeit.net>
Signed-off-by: Aditya Garg <gargaditya08@live.com>
---
v2 :- Use C styled comments
 .../gpu/drm/amd/display/dc/core/dc_link_dp.c  | 20 +++++++++++++++++++
 1 file changed, 20 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 05e216524..086f7ee2c 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
@@ -5597,6 +5597,26 @@ static bool retrieve_link_cap(struct dc_link *link)
 		dp_hw_fw_revision.ieee_fw_rev,
 		sizeof(dp_hw_fw_revision.ieee_fw_rev));
 
+	/* Quirk for Apple MBP 2018 15" Retina panels: wrong DP_MAX_LINK_RATE */
+	{
+		uint8_t str_mbp_2018[] = { 101, 68, 21, 103, 98, 97 };
+		uint8_t fwrev_mbp_2018[] = { 7, 4 };
+		uint8_t fwrev_mbp_2018_vega[] = { 8, 4 };
+
+		/* We also check for the firmware revision as 16,1 models have an
+		 * identical device id and are incorrectly quirked otherwise.
+		 */
+		if ((link->dpcd_caps.sink_dev_id == 0x0010fa) &&
+		    !memcmp(link->dpcd_caps.sink_dev_id_str, str_mbp_2018,
+			     sizeof(str_mbp_2018)) &&
+		    (!memcmp(link->dpcd_caps.sink_fw_revision, fwrev_mbp_2018,
+			     sizeof(fwrev_mbp_2018)) ||
+		    !memcmp(link->dpcd_caps.sink_fw_revision, fwrev_mbp_2018_vega,
+			     sizeof(fwrev_mbp_2018_vega)))) {
+			link->reported_link_cap.link_rate = LINK_RATE_RBR2;
+		}
+	}
+
 	memset(&link->dpcd_caps.dsc_caps, '\0',
 			sizeof(link->dpcd_caps.dsc_caps));
 	memset(&link->dpcd_caps.fec_cap, '\0', sizeof(link->dpcd_caps.fec_cap));
-- 
2.25.1



  parent reply	other threads:[~2022-01-29  5:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-26 11:31 [PATCH RESEND] drm/amd/display: Force link_rate as LINK_RATE_RBR2 for 2018 15" Apple Retina panels Aditya Garg
2022-01-27 17:36 ` Alex Deucher
2022-01-28 13:06   ` Aditya Garg
2022-01-28 15:03     ` Harry Wentland
2022-01-29  5:48       ` Aditya Garg
2022-01-29  5:49       ` Aditya Garg [this message]
2022-01-31 20:17         ` [PATCH v2] " Alex Deucher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5CC8BCC9-176A-4478-B03B-3E4B4D7D88E6@live.com \
    --to=gargaditya08@live.com \
    --cc=Aurabindo.Pillai@amd.com \
    --cc=Bhawanpreet.Lakha@amd.com \
    --cc=Felix.Kuehling@amd.com \
    --cc=George.Shen@amd.com \
    --cc=Rodrigo.Siqueira@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=admin@kodeit.net \
    --cc=agustin.gutierrez@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=alexdeucher@gmail.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=evan.quan@amd.com \
    --cc=harry.wentland@amd.com \
    --cc=hwentlan@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikita.lipski@amd.com \
    --cc=pavle.kotarac@amd.com \
    --cc=qingqing.zhuo@amd.com \
    --cc=redecorating@protonmail.com \
    --cc=roman.li@amd.com \
    --cc=solomon.chiu@amd.com \
    --cc=stylon.wang@amd.com \
    --cc=sunpeng.li@amd.com \
    --cc=wayne.lin@amd.com \
    --cc=wesley.chalmers@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).