linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: Write to correct dirty_rect
@ 2023-03-13  0:47 Benjamin Cheng
  2023-03-13 12:00 ` Hamza Mahfooz
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Cheng @ 2023-03-13  0:47 UTC (permalink / raw)
  To: Harry Wentland, Leo Li, Rodrigo Siqueira, Alex Deucher,
	Christian König, Pan, Xinhui, David Airlie, Daniel Vetter,
	Hamza Mahfooz
  Cc: Benjamin Cheng, amd-gfx, dri-devel, linux-kernel

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>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 8af58bba503f..a89ec2cc4ffc 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -5130,9 +5130,9 @@ static void fill_dc_dirty_rects(struct drm_plane *plane,
 
 		for (; flip_addrs->dirty_rect_count < num_clips; clips++)
 			fill_dc_dirty_rect(new_plane_state->plane,
-					   &dirty_rects[i], clips->x1,
-					   clips->y1, clips->x2 - clips->x1,
-					   clips->y2 - clips->y1,
+					   &dirty_rects[flip_addrs->dirty_rect_count],
+					   clips->x1, clips->y1,
+					   clips->x2 - clips->x1, clips->y2 - clips->y1,
 					   &flip_addrs->dirty_rect_count,
 					   false);
 		return;
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/amd/display: Write to correct dirty_rect
  2023-03-13  0:47 [PATCH] drm/amd/display: Write to correct dirty_rect Benjamin Cheng
@ 2023-03-13 12:00 ` Hamza Mahfooz
  0 siblings, 0 replies; 2+ messages in thread
From: Hamza Mahfooz @ 2023-03-13 12:00 UTC (permalink / raw)
  To: Benjamin Cheng, Harry Wentland, Leo Li, Rodrigo Siqueira,
	Alex Deucher, Christian König, Pan, Xinhui, David Airlie,
	Daniel Vetter
  Cc: amd-gfx, dri-devel, linux-kernel

On 3/12/23 20:47, Benjamin Cheng wrote:
> 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>

Applied, thanks for catching this!

> ---
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 8af58bba503f..a89ec2cc4ffc 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -5130,9 +5130,9 @@ static void fill_dc_dirty_rects(struct drm_plane *plane,
>   
>   		for (; flip_addrs->dirty_rect_count < num_clips; clips++)
>   			fill_dc_dirty_rect(new_plane_state->plane,
> -					   &dirty_rects[i], clips->x1,
> -					   clips->y1, clips->x2 - clips->x1,
> -					   clips->y2 - clips->y1,
> +					   &dirty_rects[flip_addrs->dirty_rect_count],
> +					   clips->x1, clips->y1,
> +					   clips->x2 - clips->x1, clips->y2 - clips->y1,
>   					   &flip_addrs->dirty_rect_count,
>   					   false);
>   		return;

-- 
Hamza


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-13 11:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-13  0:47 [PATCH] drm/amd/display: Write to correct dirty_rect Benjamin Cheng
2023-03-13 12:00 ` Hamza Mahfooz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).