Commit 10fdb0a1 authored by Rodrigo Siqueira's avatar Rodrigo Siqueira Committed by Alex Deucher

drm/amd/display: Rework context change check

Context change is all about streams; for this reason, this commit
renames context_changed to streams_changed. Additionally, to make this
function more flexible, this commit changes the function signature to
receive the stream array and the stream count as a parameter.
Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Co-developed-by: default avatarAurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: default avatarAurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 03ce7b38
...@@ -1488,19 +1488,19 @@ static void program_timing_sync( ...@@ -1488,19 +1488,19 @@ static void program_timing_sync(
} }
} }
static bool context_changed( static bool streams_changed(struct dc *dc,
struct dc *dc, struct dc_stream_state *streams[],
struct dc_state *context) uint8_t stream_count)
{ {
uint8_t i; uint8_t i;
if (context->stream_count != dc->current_state->stream_count) if (stream_count != dc->current_state->stream_count)
return true; return true;
for (i = 0; i < dc->current_state->stream_count; i++) { for (i = 0; i < dc->current_state->stream_count; i++) {
if (dc->current_state->streams[i] != context->streams[i]) if (dc->current_state->streams[i] != streams[i])
return true; return true;
if (!context->streams[i]->link->link_state_valid) if (!streams[i]->link->link_state_valid)
return true; return true;
} }
...@@ -1895,7 +1895,7 @@ bool dc_commit_state(struct dc *dc, struct dc_state *context) ...@@ -1895,7 +1895,7 @@ bool dc_commit_state(struct dc *dc, struct dc_state *context)
enum dc_status result = DC_ERROR_UNEXPECTED; enum dc_status result = DC_ERROR_UNEXPECTED;
int i; int i;
if (!context_changed(dc, context)) if (!streams_changed(dc, context->streams, context->stream_count))
return DC_OK; return DC_OK;
DC_LOG_DC("%s: %d streams\n", DC_LOG_DC("%s: %d streams\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment