summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display
diff options
context:
space:
mode:
authorAlex Hung <alex.hung@amd.com>2023-12-01 06:25:33 -0700
committerAlex Deucher <alexander.deucher@amd.com>2023-12-06 15:22:35 -0500
commitc09919e6ea5fefd49d8b7b54aa5b222937163108 (patch)
tree9c6dcda958b99f8fcfdd46fdd754c6c3365896b1 /drivers/gpu/drm/amd/display
parentf772f902b28662188636faba88e2a10bdb08e128 (diff)
downloadlinux-c09919e6ea5fefd49d8b7b54aa5b222937163108.tar.gz
linux-c09919e6ea5fefd49d8b7b54aa5b222937163108.tar.bz2
linux-c09919e6ea5fefd49d8b7b54aa5b222937163108.zip
drm/amd/display: Fix writeback_info never got updated
[WHY] wb_enabled field is set to false before it is used, and the following code will never be executed. [HOW] Setting wb_enable to false after all removal work is completed. Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display')
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc_stream.c13
1 files changed, 4 insertions, 9 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 e71d622098d7..8e7bc4a30f27 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
@@ -509,18 +509,13 @@ bool dc_stream_remove_writeback(struct dc *dc,
return false;
}
-// stream->writeback_info[dwb_pipe_inst].wb_enabled = false;
- for (i = 0; i < stream->num_wb_info; i++) {
- /*dynamic update*/
- if (stream->writeback_info[i].wb_enabled &&
- stream->writeback_info[i].dwb_pipe_inst == dwb_pipe_inst) {
- stream->writeback_info[i].wb_enabled = false;
- }
- }
-
/* remove writeback info for disabled writeback pipes from stream */
for (i = 0, j = 0; i < stream->num_wb_info; i++) {
if (stream->writeback_info[i].wb_enabled) {
+
+ if (stream->writeback_info[i].dwb_pipe_inst == dwb_pipe_inst)
+ stream->writeback_info[i].wb_enabled = false;
+
if (j < i)
/* trim the array */
memcpy(&stream->writeback_info[j], &stream->writeback_info[i],