Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: Write to correct dirty_rect

When FB_DAMAGE_CLIPS are provided in a non-MPO scenario, the loop does
not use the counter i. This causes the fill_dc_dity_rect() to always
fill dirty_rects[0], causing graphical artifacts when a damage clip
aware DRM client sends more than 1 damage clip.

Instead, use the flip_addrs->dirty_rect_count which is incremented by
fill_dc_dirty_rect() on a successful fill.

Fixes: 30ebe41582d1 ("drm/amd/display: add FB_DAMAGE_CLIPS support")
Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2453
Signed-off-by: Benjamin Cheng <ben@bcheng.me>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org # 6.1.x

authored by

Benjamin Cheng and committed by
Alex Deucher
751281c5 3fadda5d

+3 -3
+3 -3
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
··· 5105 5105 5106 5106 for (; flip_addrs->dirty_rect_count < num_clips; clips++) 5107 5107 fill_dc_dirty_rect(new_plane_state->plane, 5108 - &dirty_rects[i], clips->x1, 5109 - clips->y1, clips->x2 - clips->x1, 5110 - clips->y2 - clips->y1, 5108 + &dirty_rects[flip_addrs->dirty_rect_count], 5109 + clips->x1, clips->y1, 5110 + clips->x2 - clips->x1, clips->y2 - clips->y1, 5111 5111 &flip_addrs->dirty_rect_count, 5112 5112 false); 5113 5113 return;