Commit 5b89d2cc authored by Alex Hung's avatar Alex Hung Committed by Alex Deucher

drm/amd/display: Fix writeback_info is not removed

[WHY]
Counter j was not updated to present the num of writeback_info when
writeback pipes are removed.

[HOW]
update j (num of writeback info) under the correct condition.
Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarAlex Hung <alex.hung@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 58c3b334
...@@ -565,13 +565,14 @@ bool dc_stream_remove_writeback(struct dc *dc, ...@@ -565,13 +565,14 @@ bool dc_stream_remove_writeback(struct dc *dc,
if (stream->writeback_info[i].dwb_pipe_inst == dwb_pipe_inst) if (stream->writeback_info[i].dwb_pipe_inst == dwb_pipe_inst)
stream->writeback_info[i].wb_enabled = false; stream->writeback_info[i].wb_enabled = false;
if (j < i)
/* trim the array */ /* trim the array */
if (j < i) {
memcpy(&stream->writeback_info[j], &stream->writeback_info[i], memcpy(&stream->writeback_info[j], &stream->writeback_info[i],
sizeof(struct dc_writeback_info)); sizeof(struct dc_writeback_info));
j++; j++;
} }
} }
}
stream->num_wb_info = j; stream->num_wb_info = j;
/* recalculate and apply DML parameters */ /* recalculate and apply DML parameters */
......
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