Skip to content

Commit

Permalink
drm/amd/display: Reduce redundant minimal transitions due to SubVP
Browse files Browse the repository at this point in the history
[WHY]
Stream ID's associated with phantom pipes can change often as they
are reconstructed on full updates, however they can remain identical
depending on the required update.

[HOW]
In the case phantom streams and pipe topologies remain the same
between updates, mark the transition as seamless.

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Signed-off-by: Dillon Varone <dillon.varone@amd.com>
Signed-off-by: Tom Chung <chiahsuan.chung@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Dillon Varone authored and Alex Deucher committed Aug 13, 2024
1 parent cd9e9e0 commit cc29912
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c
Original file line number Diff line number Diff line change
Expand Up @@ -1719,6 +1719,28 @@ void dcn32_blank_phantom(struct dc *dc,
hws->funcs.wait_for_blank_complete(opp);
}

/* phantom stream id's can change often, but can be identical between contexts.
* This function checks for the condition the streams are identical to avoid
* redundant pipe transitions.
*/
static bool is_subvp_phantom_topology_transition_seamless(
const struct dc_state *cur_ctx,
const struct dc_state *new_ctx,
const struct pipe_ctx *cur_pipe,
const struct pipe_ctx *new_pipe)
{
enum mall_stream_type cur_pipe_type = dc_state_get_pipe_subvp_type(cur_ctx, cur_pipe);
enum mall_stream_type new_pipe_type = dc_state_get_pipe_subvp_type(new_ctx, new_pipe);

const struct dc_stream_state *cur_paired_stream = dc_state_get_paired_subvp_stream(cur_ctx, cur_pipe->stream);
const struct dc_stream_state *new_paired_stream = dc_state_get_paired_subvp_stream(new_ctx, new_pipe->stream);

return cur_pipe_type == SUBVP_PHANTOM &&
cur_pipe_type == new_pipe_type &&
cur_paired_stream && new_paired_stream &&
cur_paired_stream->stream_id == new_paired_stream->stream_id;
}

bool dcn32_is_pipe_topology_transition_seamless(struct dc *dc,
const struct dc_state *cur_ctx,
const struct dc_state *new_ctx)
Expand All @@ -1737,7 +1759,8 @@ bool dcn32_is_pipe_topology_transition_seamless(struct dc *dc,
continue;
else if (resource_is_pipe_type(cur_pipe, OTG_MASTER)) {
if (resource_is_pipe_type(new_pipe, OTG_MASTER))
if (cur_pipe->stream->stream_id == new_pipe->stream->stream_id)
if (cur_pipe->stream->stream_id == new_pipe->stream->stream_id ||
is_subvp_phantom_topology_transition_seamless(cur_ctx, new_ctx, cur_pipe, new_pipe))
/* OTG master with the same stream is seamless */
continue;
} else if (resource_is_pipe_type(cur_pipe, OPP_HEAD)) {
Expand Down

0 comments on commit cc29912

Please sign in to comment.