From: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: stylon.wang@amd.com, Sunpeng.Li@amd.com, Harry.Wentland@amd.com,
qingqing.zhuo@amd.com, Rodrigo.Siqueira@amd.com,
roman.li@amd.com, solomon.chiu@amd.com, jerry.zuo@amd.com,
Aurabindo.Pillai@amd.com, hamza.mahfooz@amd.com,
wayne.lin@amd.com, Bhawanpreet.Lakha@amd.com,
Sung Joon Kim <sungkim@amd.com>,
Agustin Gutierrez <Agustin.Gutierrez@amd.com>,
pavle.kotarac@amd.com
Subject: [PATCH 08/31] drm/amd/display: Fix eDP not light up on resume
Date: Fri, 17 Jun 2022 15:34:49 -0400 [thread overview]
Message-ID: <20220617193512.3471076-9-Rodrigo.Siqueira@amd.com> (raw)
In-Reply-To: <20220617193512.3471076-1-Rodrigo.Siqueira@amd.com>
From: Sung Joon Kim <sungkim@amd.com>
[why]
Only on VG, if external display is disconnected during S3 suspend, the
internal panel doesn't light up on resume because we set the power state
using an unsupported DPCD register SET_POWER. To check the register is
supported, we need to check SET_POWER_CAPABLE first which is
eDP-specific DPCD register field.
[how]
Check the SET_POWER_CAPABLE register field and decide the control of the
eDP power state based on the read register value.
Reviewed-by: Agustin Gutierrez <Agustin.Gutierrez@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Sung Joon Kim <sungkim@amd.com>
---
drivers/gpu/drm/amd/display/dc/core/dc_link.c | 6 +++++-
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 7 +++++++
drivers/gpu/drm/amd/display/dc/dc.h | 1 +
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
index fac27b45230f..82b74ee5f0c3 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -1104,9 +1104,13 @@ static bool detect_link_and_local_sink(struct dc_link *link,
dc_ctx->dce_version == DCN_VERSION_3_01 &&
link->dpcd_caps.sink_dev_id == DP_BRANCH_DEVICE_ID_0022B9 &&
memcmp(&link->dpcd_caps.branch_dev_name, DP_SINK_BRANCH_DEV_NAME_7580,
- sizeof(link->dpcd_caps.branch_dev_name)) == 0)
+ sizeof(link->dpcd_caps.branch_dev_name)) == 0) {
dc->config.edp_no_power_sequencing = true;
+ if (!link->dpcd_caps.set_power_state_capable_edp)
+ link->wa_flags.dp_keep_receiver_powered = true;
+ }
+
sink_caps.transaction_type = DDC_TRANSACTION_TYPE_I2C_OVER_AUX;
sink_caps.signal = SIGNAL_TYPE_EDP;
break;
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 f9c10d044da6..fd95bd51988b 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
@@ -5832,6 +5832,7 @@ void detect_edp_sink_caps(struct dc_link *link)
uint32_t link_rate_in_khz;
enum dc_link_rate link_rate = LINK_RATE_UNKNOWN;
uint8_t backlight_adj_cap;
+ uint8_t general_edp_cap;
retrieve_link_cap(link);
link->dpcd_caps.edp_supported_link_rates_count = 0;
@@ -5870,6 +5871,12 @@ void detect_edp_sink_caps(struct dc_link *link)
link->dpcd_caps.dynamic_backlight_capable_edp =
(backlight_adj_cap & DP_EDP_DYNAMIC_BACKLIGHT_CAP) ? true:false;
+ core_link_read_dpcd(link, DP_EDP_GENERAL_CAP_1,
+ &general_edp_cap, sizeof(general_edp_cap));
+
+ link->dpcd_caps.set_power_state_capable_edp =
+ (general_edp_cap & DP_EDP_SET_POWER_CAP) ? true:false;
+
dc_link_set_default_brightness_aux(link);
core_link_read_dpcd(link, DP_EDP_DPCD_REV,
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
index ba57e03d3d9e..51f5d75bf9e3 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -1245,6 +1245,7 @@ struct dpcd_caps {
bool panel_mode_edp;
bool dpcd_display_control_capable;
bool ext_receiver_cap_field_present;
+ bool set_power_state_capable_edp;
bool dynamic_backlight_capable_edp;
union dpcd_fec_capability fec_cap;
struct dpcd_dsc_capabilities dsc_caps;
--
2.25.1
next prev parent reply other threads:[~2022-06-17 19:35 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-17 19:34 [PATCH 00/31] DC Patches June 17, 2022 Rodrigo Siqueira
2022-06-17 19:34 ` [PATCH 01/31] drm/amd/display: Remove compiler warning Rodrigo Siqueira
2022-06-17 19:34 ` [PATCH 02/31] drm/amd/display: Revert "drm/amd/display: Add flag to detect dpms force off during HPD" Rodrigo Siqueira
2022-06-17 19:34 ` [PATCH 03/31] drm/amd/display: Revert "drm/amd/display: turn DPMS off on connector unplug" Rodrigo Siqueira
2022-06-17 19:34 ` [PATCH 04/31] drm/amd/display: Release remote dc_sink under mst scenario Rodrigo Siqueira
2022-06-17 19:34 ` [PATCH 05/31] drm/amd/display: Take emulated dc_sink into account for HDCP Rodrigo Siqueira
2022-06-17 19:34 ` [PATCH 06/31] drm/amd/display: Drop unnecessary detect link code Rodrigo Siqueira
2022-06-17 19:34 ` [PATCH 07/31] drm/amd/display: add mst port output bw check Rodrigo Siqueira
2022-06-17 19:34 ` Rodrigo Siqueira [this message]
2022-06-17 19:34 ` [PATCH 09/31] drm/amd/display: Turn off internal backlight when plugging external monitor Rodrigo Siqueira
2022-06-17 19:34 ` [PATCH 10/31] drm/amd/display: Add SMU logging code Rodrigo Siqueira
2022-06-17 19:34 ` [PATCH 11/31] drm/amd/display: Fix DC warning at driver load Rodrigo Siqueira
2022-06-17 19:34 ` [PATCH 12/31] drm/amd/display: Change HDMI judgement condition Rodrigo Siqueira
2022-06-17 19:34 ` [PATCH 13/31] drm/amd/display: Enrich the log in MST payload update Rodrigo Siqueira
2022-06-17 19:34 ` [PATCH 14/31] drm/amd/display: Fix in overriding DP drive settings Rodrigo Siqueira
2022-06-17 19:34 ` [PATCH 15/31] drm/amd/display: rename lane_settings to hw_lane_settings Rodrigo Siqueira
2022-06-17 19:34 ` [PATCH 16/31] drm/amd/display: refactor function transmitter_to_phy_id Rodrigo Siqueira
2022-06-17 19:51 ` Nathan Chancellor
2022-06-20 15:32 ` Rodrigo Siqueira Jordao
2022-06-17 19:34 ` [PATCH 17/31] drm/amd/display: Change initializer to single brace Rodrigo Siqueira
2022-06-17 19:34 ` [PATCH 18/31] drm/amd/display: Fix typo in override_lane_settings Rodrigo Siqueira
2022-06-17 19:35 ` [PATCH 19/31] drm/amd/display: Handle downstream LTTPR with fixed VS sequence Rodrigo Siqueira
2022-06-17 19:35 ` [PATCH 20/31] drm/amd/display: Remove unused vendor specific w/a Rodrigo Siqueira
2022-06-17 19:35 ` [PATCH 21/31] drm/amd/display: extract update stream allocation to link_hwss Rodrigo Siqueira
2022-06-17 19:35 ` [PATCH 22/31] drm/amd/display: Fix in dp link-training when updating payload allocation table Rodrigo Siqueira
2022-06-17 19:35 ` [PATCH 23/31] drm/amd/display: Check minimum disp_clk and dpp_clk debug option Rodrigo Siqueira
2022-06-17 19:35 ` [PATCH 24/31] drm/amd/display: Update DPPCLK programming sequence Rodrigo Siqueira
2022-06-17 19:35 ` [PATCH 25/31] drm/amd/display: Fix divide-by-zero in DPPCLK and DISPCLK calculation Rodrigo Siqueira
2022-06-17 19:35 ` [PATCH 26/31] drm/amd/display: Update SW state correctly for FCLK Rodrigo Siqueira
2022-06-17 19:35 ` [PATCH 27/31] drm/amd/display: Get VCO frequency from registers Rodrigo Siqueira
2022-06-17 19:35 ` [PATCH 28/31] drm/amd/display: Implement a pme workaround function Rodrigo Siqueira
2022-06-17 19:35 ` [PATCH 29/31] drm/amd/display: Update hook dcn32_funcs Rodrigo Siqueira
2022-06-17 19:35 ` [PATCH 30/31] drm/amd/display: Drop duplicate define Rodrigo Siqueira
2022-06-17 19:35 ` [PATCH 31/31] drm/amd/display: 3.2.191 Rodrigo Siqueira
2022-06-20 13:30 ` [PATCH 00/31] DC Patches June 17, 2022 Wheeler, Daniel
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=20220617193512.3471076-9-Rodrigo.Siqueira@amd.com \
--to=rodrigo.siqueira@amd.com \
--cc=Agustin.Gutierrez@amd.com \
--cc=Aurabindo.Pillai@amd.com \
--cc=Bhawanpreet.Lakha@amd.com \
--cc=Harry.Wentland@amd.com \
--cc=Sunpeng.Li@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=hamza.mahfooz@amd.com \
--cc=jerry.zuo@amd.com \
--cc=pavle.kotarac@amd.com \
--cc=qingqing.zhuo@amd.com \
--cc=roman.li@amd.com \
--cc=solomon.chiu@amd.com \
--cc=stylon.wang@amd.com \
--cc=sungkim@amd.com \
--cc=wayne.lin@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