aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/display
diff options
context:
space:
mode:
authorAlex Hung <[email protected]>2023-12-01 13:25:35 +0000
committerAlex Deucher <[email protected]>2023-12-06 20:22:35 +0000
commitab37b88ed9de9de8d582683f7ea17059f1251a7f (patch)
treee6d4976b3ed0b2a3ccefabb922d680146635eea2 /drivers/gpu/drm/amd/display
parentdrm/amd/display: Validate hw_points_num before using it (diff)
downloadkernel-ab37b88ed9de9de8d582683f7ea17059f1251a7f.tar.gz
kernel-ab37b88ed9de9de8d582683f7ea17059f1251a7f.zip
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. Tested-by: Daniel Wheeler <[email protected]> Reviewed-by: Harry Wentland <[email protected]> Signed-off-by: Alex Hung <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/display')
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc_stream.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
index 8e7bc4a30f27..3dd9f4ab2261 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
@@ -516,11 +516,12 @@ bool dc_stream_remove_writeback(struct dc *dc,
if (stream->writeback_info[i].dwb_pipe_inst == dwb_pipe_inst)
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],
sizeof(struct dc_writeback_info));
- j++;
+ j++;
+ }
}
}
stream->num_wb_info = j;