From: Wayne Lin <Wayne.Lin@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Eryk.Brol@amd.com, Sunpeng.Li@amd.com, Harry.Wentland@amd.com,
Qingqing.Zhuo@amd.com, Rodrigo.Siqueira@amd.com,
Anson.Jacob@amd.com, Aurabindo.Pillai@amd.com,
Bhawanpreet.Lakha@amd.com, Dale Zhao <dale.zhao@amd.com>,
bindu.r@amd.com
Subject: [PATCH 07/14] drm/amd/display: Add audio support for DFP type of active branch is DP case
Date: Thu, 29 Apr 2021 15:51:59 +0800 [thread overview]
Message-ID: <20210429075206.15974-8-Wayne.Lin@amd.com> (raw)
In-Reply-To: <20210429075206.15974-1-Wayne.Lin@amd.com>
From: Dale Zhao <dale.zhao@amd.com>
[Why]
Per DP spec, for active protocol convertor adaptor, DP source should enable audio
for DFP type is DP, HDMI or DP++. Current is_dp_active_dongle() checking is not
precise, which treat branch device default as active dongle. As a result, we will
mistakenly disable audio for DFP type is DP case.
[How]
Make is_dp_active_dongle() checking more precise for active dongle types.
Rename active diongle type as SST branch device in case confusion.
Signed-off-by: Dale Zhao <dale.zhao@amd.com>
Reviewed-by: Wenjing Liu <Wenjing.Liu@amd.com>
Acked-by: Wayne Lin <Wayne.Lin@amd.com>
---
drivers/gpu/drm/amd/display/dc/core/dc_link.c | 17 +++++++++--------
.../gpu/drm/amd/display/dc/core/dc_link_dp.c | 14 +++++++++-----
drivers/gpu/drm/amd/display/dc/dc_types.h | 2 +-
drivers/gpu/drm/amd/display/dc/inc/dc_link_dp.h | 2 ++
4 files changed, 21 insertions(+), 14 deletions(-)
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 8bbed9c90c5d..c6b4daf00be5 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -762,19 +762,20 @@ static bool detect_dp(struct dc_link *link,
}
if (link->type != dc_connection_mst_branch &&
- is_dp_active_dongle(link)) {
- /* DP active dongles */
- link->type = dc_connection_active_dongle;
+ is_dp_branch_device(link)) {
+ /* DP SST branch */
+ link->type = dc_connection_sst_branch;
if (!link->dpcd_caps.sink_count.bits.SINK_COUNT) {
/*
- * active dongle unplug processing for short irq
+ * SST branch unplug processing for short irq
*/
link_disconnect_sink(link);
return true;
}
- if (link->dpcd_caps.dongle_type !=
- DISPLAY_DONGLE_DP_HDMI_CONVERTER)
+ if (is_dp_active_dongle(link) &&
+ (link->dpcd_caps.dongle_type !=
+ DISPLAY_DONGLE_DP_HDMI_CONVERTER))
*converter_disable_audio = true;
}
} else {
@@ -974,8 +975,8 @@ static bool dc_link_detect_helper(struct dc_link *link,
sizeof(struct dpcd_caps)))
same_dpcd = false;
}
- /* Active dongle downstream unplug*/
- if (link->type == dc_connection_active_dongle &&
+ /* Active SST downstream branch device unplug*/
+ if (link->type == dc_connection_sst_branch &&
link->dpcd_caps.sink_count.bits.SINK_COUNT == 0) {
if (prev_sink)
/* Downstream unplug */
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 3ff3d9e90983..ffb4f9027d5e 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
@@ -2593,13 +2593,11 @@ static bool allow_hpd_rx_irq(const struct dc_link *link)
/*
* Don't handle RX IRQ unless one of following is met:
* 1) The link is established (cur_link_settings != unknown)
- * 2) We kicked off MST detection
- * 3) We know we're dealing with an active dongle
+ * 2) We know we're dealing with a branch device, SST or MST
*/
if ((link->cur_link_settings.lane_count != LANE_COUNT_UNKNOWN) ||
- (link->type == dc_connection_mst_branch) ||
- is_dp_active_dongle(link))
+ is_dp_branch_device(link))
return true;
return false;
@@ -3164,7 +3162,7 @@ bool dc_link_handle_hpd_rx_irq(struct dc_link *link, union hpd_irq_data *out_hpd
*out_link_loss = true;
}
- if (link->type == dc_connection_active_dongle &&
+ if (link->type == dc_connection_sst_branch &&
hpd_irq_dpcd_data.bytes.sink_cnt.bits.SINK_COUNT
!= link->dpcd_sink_count)
status = true;
@@ -3214,6 +3212,12 @@ bool is_mst_supported(struct dc_link *link)
}
bool is_dp_active_dongle(const struct dc_link *link)
+{
+ return (link->dpcd_caps.dongle_type >= DISPLAY_DONGLE_DP_VGA_CONVERTER) &&
+ (link->dpcd_caps.dongle_type <= DISPLAY_DONGLE_DP_HDMI_CONVERTER);
+}
+
+bool is_dp_branch_device(const struct dc_link *link)
{
return link->dpcd_caps.is_branch_dev;
}
diff --git a/drivers/gpu/drm/amd/display/dc/dc_types.h b/drivers/gpu/drm/amd/display/dc/dc_types.h
index 432754eaf10b..205d8241c4fc 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_types.h
+++ b/drivers/gpu/drm/amd/display/dc/dc_types.h
@@ -404,7 +404,7 @@ enum dc_connection_type {
dc_connection_none,
dc_connection_single,
dc_connection_mst_branch,
- dc_connection_active_dongle
+ dc_connection_sst_branch
};
struct dc_csc_adjustments {
diff --git a/drivers/gpu/drm/amd/display/dc/inc/dc_link_dp.h b/drivers/gpu/drm/amd/display/dc/inc/dc_link_dp.h
index 3ae05c96d557..699de64a7e44 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/dc_link_dp.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/dc_link_dp.h
@@ -75,6 +75,8 @@ void detect_edp_sink_caps(struct dc_link *link);
bool is_dp_active_dongle(const struct dc_link *link);
+bool is_dp_branch_device(const struct dc_link *link);
+
bool is_edp_ilr_optimization_required(struct dc_link *link, struct dc_crtc_timing *crtc_timing);
void dp_enable_mst_on_sink(struct dc_link *link, bool enable);
--
2.17.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2021-04-29 7:54 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-29 7:51 [PATCH 00/14] DC Patches May 03, 2021 Wayne Lin
2021-04-29 7:51 ` [PATCH 01/14] drm/amd/display: multi-eDP backlight support Wayne Lin
2021-04-29 7:51 ` [PATCH 02/14] dc: Revert commit "treat memory as a single-channel" Wayne Lin
2021-04-29 7:51 ` [PATCH 03/14] drm/amd/display: fix potential gpu reset deadlock Wayne Lin
2021-04-29 7:51 ` [PATCH 04/14] drm/amd/display: Extend DMUB HW params to allow DM to specify boot options Wayne Lin
2021-04-29 7:51 ` [PATCH 05/14] drm/amd/display: update DCN to use new surface programming Wayne Lin
2021-04-29 7:51 ` [PATCH 06/14] drm/amd/display: Support for DMUB AUX Wayne Lin
2021-04-29 7:51 ` Wayne Lin [this message]
2021-04-29 7:52 ` [PATCH 08/14] drm/amd/display: remove checking sink in is_timing_changed Wayne Lin
2021-04-29 7:52 ` [PATCH 09/14] drm/amd/display: add dsc stream overhead for dp only Wayne Lin
2021-04-29 7:52 ` [PATCH 10/14] drm/amd/display: Filter out YCbCr420 timing if VSC SDP not supported Wayne Lin
2021-04-29 7:52 ` [PATCH 11/14] drm/amd/display: Set stream_count to 0 when dc_resource_state_destruct Wayne Lin
2021-04-29 7:52 ` [PATCH 12/14] drm/amd/display: Avoid gpio conflict on MST branch Wayne Lin
2021-04-29 7:52 ` [PATCH 13/14] drm/amd/display: [FW Promotion] Release 0.0.64 Wayne Lin
2021-04-29 7:52 ` [PATCH 14/14] drm/amd/display: 3.2.134 Wayne Lin
2021-04-30 19:49 ` [PATCH 00/14] DC Patches May 03, 2021 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=20210429075206.15974-8-Wayne.Lin@amd.com \
--to=wayne.lin@amd.com \
--cc=Anson.Jacob@amd.com \
--cc=Aurabindo.Pillai@amd.com \
--cc=Bhawanpreet.Lakha@amd.com \
--cc=Eryk.Brol@amd.com \
--cc=Harry.Wentland@amd.com \
--cc=Qingqing.Zhuo@amd.com \
--cc=Rodrigo.Siqueira@amd.com \
--cc=Sunpeng.Li@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=bindu.r@amd.com \
--cc=dale.zhao@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.