dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Sasha Levin <sashal@kernel.org>,
	Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	Martin Leung <martin.leung@amd.com>,
	Alex Deucher <alexander.deucher@amd.com>,
	Anthony Koo <Anthony.Koo@amd.com>
Subject: [PATCH AUTOSEL 5.6 068/149] drm/amd/display: always apply T7/T9 delay logic
Date: Sat, 11 Apr 2020 19:02:25 -0400	[thread overview]
Message-ID: <20200411230347.22371-68-sashal@kernel.org> (raw)
In-Reply-To: <20200411230347.22371-1-sashal@kernel.org>

From: Martin Leung <martin.leung@amd.com>

[ Upstream commit cb8348fec250e517b5facb4cab3125ddc597f9aa ]

[why]
before we exit early in edp_reciever_ready if we detect that panel
is not edp or below rev 1.2. This will skip the backlight/t7 delay panel
patch.

[how]
edit logic to ensure panel patch is applied regardless of edp rev.

Signed-off-by: Martin Leung <martin.leung@amd.com>
Reviewed-by: Anthony Koo <Anthony.Koo@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../drm/amd/display/dc/core/dc_link_hwss.c    | 56 ++++++++++---------
 1 file changed, 29 insertions(+), 27 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c
index ddb8550457672..58634f191a55d 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c
@@ -153,18 +153,19 @@ bool edp_receiver_ready_T9(struct dc_link *link)
 	unsigned char edpRev = 0;
 	enum dc_status result = DC_OK;
 	result = core_link_read_dpcd(link, DP_EDP_DPCD_REV, &edpRev, sizeof(edpRev));
-	if (edpRev < DP_EDP_12)
-		return true;
-	/* start from eDP version 1.2, SINK_STAUS indicate the sink is ready.*/
-	do {
-		sinkstatus = 1;
-		result = core_link_read_dpcd(link, DP_SINK_STATUS, &sinkstatus, sizeof(sinkstatus));
-		if (sinkstatus == 0)
-			break;
-		if (result != DC_OK)
-			break;
-		udelay(100); //MAx T9
-	} while (++tries < 50);
+
+     /* start from eDP version 1.2, SINK_STAUS indicate the sink is ready.*/
+	if (result == DC_OK && edpRev >= DP_EDP_12) {
+		do {
+			sinkstatus = 1;
+			result = core_link_read_dpcd(link, DP_SINK_STATUS, &sinkstatus, sizeof(sinkstatus));
+			if (sinkstatus == 0)
+				break;
+			if (result != DC_OK)
+				break;
+			udelay(100); //MAx T9
+		} while (++tries < 50);
+	}
 
 	if (link->local_sink->edid_caps.panel_patch.extra_delay_backlight_off > 0)
 		udelay(link->local_sink->edid_caps.panel_patch.extra_delay_backlight_off * 1000);
@@ -183,21 +184,22 @@ bool edp_receiver_ready_T7(struct dc_link *link)
 	unsigned long long time_taken_in_ns = 0;
 
 	result = core_link_read_dpcd(link, DP_EDP_DPCD_REV, &edpRev, sizeof(edpRev));
-	if (result == DC_OK && edpRev < DP_EDP_12)
-		return true;
-	/* start from eDP version 1.2, SINK_STAUS indicate the sink is ready.*/
-	enter_timestamp = dm_get_timestamp(link->ctx);
-	do {
-		sinkstatus = 0;
-		result = core_link_read_dpcd(link, DP_SINK_STATUS, &sinkstatus, sizeof(sinkstatus));
-		if (sinkstatus == 1)
-			break;
-		if (result != DC_OK)
-			break;
-		udelay(25);
-		finish_timestamp = dm_get_timestamp(link->ctx);
-		time_taken_in_ns = dm_get_elapse_time_in_ns(link->ctx, finish_timestamp, enter_timestamp);
-	} while (time_taken_in_ns < 50 * 1000000); //MAx T7 is 50ms
+
+	if (result == DC_OK && edpRev >= DP_EDP_12) {
+		/* start from eDP version 1.2, SINK_STAUS indicate the sink is ready.*/
+		enter_timestamp = dm_get_timestamp(link->ctx);
+		do {
+			sinkstatus = 0;
+			result = core_link_read_dpcd(link, DP_SINK_STATUS, &sinkstatus, sizeof(sinkstatus));
+			if (sinkstatus == 1)
+				break;
+			if (result != DC_OK)
+				break;
+			udelay(25);
+			finish_timestamp = dm_get_timestamp(link->ctx);
+			time_taken_in_ns = dm_get_elapse_time_in_ns(link->ctx, finish_timestamp, enter_timestamp);
+		} while (time_taken_in_ns < 50 * 1000000); //MAx T7 is 50ms
+	}
 
 	if (link->local_sink->edid_caps.panel_patch.extra_t7_ms > 0)
 		udelay(link->local_sink->edid_caps.panel_patch.extra_t7_ms * 1000);
-- 
2.20.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2020-04-11 23:05 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200411230347.22371-1-sashal@kernel.org>
2020-04-11 23:01 ` [PATCH AUTOSEL 5.6 010/149] drm/amd/display: differentiate vsc sdp colorimetry use criteria between MST and SST Sasha Levin
2020-04-11 23:01 ` [PATCH AUTOSEL 5.6 015/149] drm/amd/display: Explicitly disable triplebuffer flips Sasha Levin
2020-04-11 23:01 ` [PATCH AUTOSEL 5.6 016/149] drm/amd/display: Fix test pattern color space inconsistency for Linux Sasha Levin
2020-04-11 23:01 ` [PATCH AUTOSEL 5.6 023/149] drm/amdgpu: check GFX RAS capability before reset counters Sasha Levin
2020-04-11 23:01 ` [PATCH AUTOSEL 5.6 031/149] drm/tegra: dc: Release PM and RGB output when client's registration fails Sasha Levin
2020-04-11 23:01 ` [PATCH AUTOSEL 5.6 033/149] drm/amd/display: Stop if retimer is not available Sasha Levin
2020-04-11 23:01 ` [PATCH AUTOSEL 5.6 036/149] drm/amd/display: writing stereo polarity register if swapped Sasha Levin
2020-04-11 23:01 ` [PATCH AUTOSEL 5.6 039/149] drm/amd/display: Fix default logger mask definition Sasha Levin
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 046/149] drm/amd/display: Only round InfoFrame refresh rates Sasha Levin
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 047/149] drm/amd/display: Fix HDMI repeater authentication Sasha Levin
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 049/149] drm/panel: simple: fix osd070t1718_19ts sync drive edge Sasha Levin
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 059/149] drm/sun4i: dsi: Use NULL to signify "no panel" Sasha Levin
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 065/149] drm/amdgpu: Fix missing error check in suspend Sasha Levin
2020-04-11 23:02 ` Sasha Levin [this message]
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 069/149] drm/omap: fix possible object reference leak Sasha Levin
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 072/149] drm/stm: ltdc: check crtc state before enabling LIE Sasha Levin
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 073/149] fbdev: potential information leak in do_fb_ioctl() Sasha Levin
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 074/149] drm/crc: Actually allow to change the crc source Sasha Levin
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 075/149] drm/amdgpu: fix parentheses in amdgpu_vm_update_ptes Sasha Levin
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 076/149] drm/amd/display: dc_get_vmid_use_vector() crashes when get called Sasha Levin
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 087/149] drm/amd/display: dal_ddc_i2c_payloads_create can fail causing panic Sasha Levin
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 088/149] drm/amd/display: System crashes when add_ptb_to_table() gets called Sasha Levin
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 089/149] drm/omap: dss: Cleanup DSS ports on initialisation failure Sasha Levin
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 090/149] drm/amdkfd: Fix a memory leak in queue creation error handling Sasha Levin
2020-04-11 23:02 ` [PATCH AUTOSEL 5.6 095/149] drm/amd/display: Fix dmub_psr_destroy() Sasha Levin
2020-04-11 23:03 ` [PATCH AUTOSEL 5.6 105/149] drm/msm: fix leaks if initialization fails Sasha Levin
2020-04-11 23:03 ` [PATCH AUTOSEL 5.6 106/149] drm/msm/a5xx: Always set an OPP supported hardware value Sasha Levin
2020-04-11 23:03 ` [PATCH AUTOSEL 5.6 149/149] PCI: Use ioremap(), not phys_to_virt() for platform ROM Sasha Levin

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=20200411230347.22371-68-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=Anthony.Koo@amd.com \
    --cc=Rodrigo.Siqueira@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.leung@amd.com \
    --cc=stable@vger.kernel.org \
    /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).