Skip to content

Commit 6016cd9

Browse files
Bing Guoalexdeucher
authored andcommitted
drm/amd/display: add helper for enabling mst stream features
[Why] Some MST devices uses different method to enable mst specific stream features. [How] Add dm_helpers_mst_enable_stream features. This can be modified later when we are ready to implement those features. Signed-off-by: Bing Guo <[email protected]> Reviewed-by: Anthony Koo <[email protected]> Acked-by: Aurabindo Pillai <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent fdf7d4f commit 6016cd9

File tree

3 files changed

+44
-11
lines changed

3 files changed

+44
-11
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,3 +711,28 @@ bool dm_helpers_dmub_outbox0_interrupt_control(struct dc_context *ctx, bool enab
711711
enable ? "en" : "dis", ret);
712712
return ret;
713713
}
714+
715+
void dm_helpers_mst_enable_stream_features(const struct dc_stream_state *stream)
716+
{
717+
/* TODO: virtual DPCD */
718+
struct dc_link *link = stream->link;
719+
union down_spread_ctrl old_downspread;
720+
union down_spread_ctrl new_downspread;
721+
722+
if (link->aux_access_disabled)
723+
return;
724+
725+
if (!dm_helpers_dp_read_dpcd(link->ctx, link, DP_DOWNSPREAD_CTRL,
726+
&old_downspread.raw,
727+
sizeof(old_downspread)))
728+
return;
729+
730+
new_downspread.raw = old_downspread.raw;
731+
new_downspread.bits.IGNORE_MSA_TIMING_PARAM =
732+
(stream->ignore_msa_timing_param) ? 1 : 0;
733+
734+
if (new_downspread.raw != old_downspread.raw)
735+
dm_helpers_dp_write_dpcd(link->ctx, link, DP_DOWNSPREAD_CTRL,
736+
&new_downspread.raw,
737+
sizeof(new_downspread));
738+
}

drivers/gpu/drm/amd/display/dc/core/dc_link.c

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1679,21 +1679,27 @@ void link_destroy(struct dc_link **link)
16791679
static void enable_stream_features(struct pipe_ctx *pipe_ctx)
16801680
{
16811681
struct dc_stream_state *stream = pipe_ctx->stream;
1682-
struct dc_link *link = stream->link;
1683-
union down_spread_ctrl old_downspread;
1684-
union down_spread_ctrl new_downspread;
16851682

1686-
core_link_read_dpcd(link, DP_DOWNSPREAD_CTRL,
1687-
&old_downspread.raw, sizeof(old_downspread));
1683+
if (pipe_ctx->stream->signal != SIGNAL_TYPE_DISPLAY_PORT_MST) {
1684+
struct dc_link *link = stream->link;
1685+
union down_spread_ctrl old_downspread;
1686+
union down_spread_ctrl new_downspread;
1687+
1688+
core_link_read_dpcd(link, DP_DOWNSPREAD_CTRL,
1689+
&old_downspread.raw, sizeof(old_downspread));
16881690

1689-
new_downspread.raw = old_downspread.raw;
1691+
new_downspread.raw = old_downspread.raw;
16901692

1691-
new_downspread.bits.IGNORE_MSA_TIMING_PARAM =
1692-
(stream->ignore_msa_timing_param) ? 1 : 0;
1693+
new_downspread.bits.IGNORE_MSA_TIMING_PARAM =
1694+
(stream->ignore_msa_timing_param) ? 1 : 0;
16931695

1694-
if (new_downspread.raw != old_downspread.raw) {
1695-
core_link_write_dpcd(link, DP_DOWNSPREAD_CTRL,
1696-
&new_downspread.raw, sizeof(new_downspread));
1696+
if (new_downspread.raw != old_downspread.raw) {
1697+
core_link_write_dpcd(link, DP_DOWNSPREAD_CTRL,
1698+
&new_downspread.raw, sizeof(new_downspread));
1699+
}
1700+
1701+
} else {
1702+
dm_helpers_mst_enable_stream_features(stream);
16971703
}
16981704
}
16991705

drivers/gpu/drm/amd/display/dc/dm_helpers.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ bool dm_helpers_dp_write_dsc_enable(
147147
bool dm_helpers_is_dp_sink_present(
148148
struct dc_link *link);
149149

150+
void dm_helpers_mst_enable_stream_features(const struct dc_stream_state *stream);
151+
150152
enum dc_edid_status dm_helpers_read_local_edid(
151153
struct dc_context *ctx,
152154
struct dc_link *link,

0 commit comments

Comments
 (0)