mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/gud: Merge damage clips in full update mode
@ 2026-09-07 23:08 Sophie D
  2026-09-08  6:32 ` Thomas Zimmermann
  2026-09-10  1:49 ` [PATCH v2] drm/gud: Ignore " Sophie D
  0 siblings, 2 replies; 4+ messages in thread
From: Sophie D @ 2026-09-07 23:08 UTC (permalink / raw)
  To: rubenru09; +Cc: tzimmermann, dri-devel, linux-kernel, stable, Sophie D

When running in full update mode, previously small updates (such as
moving the mouse across the screen) would cause many full frames to be
generated. This would bog down the bus and lower the effective framerate
significantly - I was seeing a drop from 60 FPS to 2 FPS.

This patch fixes the bug by merging damage clips together.

Fixes: 73cfd166e045 ("drm/gud: Replace simple display pipe with DRM atomic helpers")
Cc: <stable@vger.kernel.org> # 6.18.x
Signed-off-by: Sophie D <patches@scd31.com>
---
 drivers/gpu/drm/gud/gud_pipe.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/gud/gud_pipe.c b/drivers/gpu/drm/gud/gud_pipe.c
index 5ef887d84..20418bf81 100644
--- a/drivers/gpu/drm/gud/gud_pipe.c
+++ b/drivers/gpu/drm/gud/gud_pipe.c
@@ -647,9 +647,14 @@ void gud_plane_atomic_update(struct drm_plane *plane,
 	if (ret)
 		goto out;
 
-	drm_atomic_helper_damage_iter_init(&iter, old_state, new_state);
-	drm_atomic_for_each_plane_damage(&iter, &damage)
-		gud_fb_handle_damage(gdrm, fb, &shadow_plane_state->data[0], &damage);
+	if (gdrm->flags & GUD_DISPLAY_FLAG_FULL_UPDATE) {
+		if (drm_atomic_helper_damage_merged(old_state, new_state, &damage))
+			gud_fb_handle_damage(gdrm, fb, &shadow_plane_state->data[0], &damage);
+	} else {
+		drm_atomic_helper_damage_iter_init(&iter, old_state, new_state);
+		drm_atomic_for_each_plane_damage(&iter, &damage)
+			gud_fb_handle_damage(gdrm, fb, &shadow_plane_state->data[0], &damage);
+	}
 
 	drm_gem_fb_end_cpu_access(fb, DMA_FROM_DEVICE);
 
-- 
2.55.0


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

end of thread, other threads:[~2026-09-10  1:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-07 23:08 [PATCH] drm/gud: Merge damage clips in full update mode Sophie D
2026-09-08  6:32 ` Thomas Zimmermann
2026-09-10  1:59   ` Sophie D
2026-09-10  1:49 ` [PATCH v2] drm/gud: Ignore " Sophie D

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®