summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_fb_helper.c
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2022-11-15 12:58:17 +0100
committerThomas Zimmermann <tzimmermann@suse.de>2022-11-16 13:08:09 +0100
commit5fc586a058babc71c82a038477581b7bfe1c6e2a (patch)
treeb640c97d61e1ae70fe768f418ba6ae874f847be4 /drivers/gpu/drm/drm_fb_helper.c
parent9b7232400d4e6adb5b96918ac1fa959c15911f8f (diff)
downloadlinux-5fc586a058babc71c82a038477581b7bfe1c6e2a.tar.gz
linux-5fc586a058babc71c82a038477581b7bfe1c6e2a.tar.bz2
linux-5fc586a058babc71c82a038477581b7bfe1c6e2a.zip
drm/fb-helper: Perform damage handling in deferred-I/O helper
Call fb_dirty directly from drm_fb_helper_deferred_io() to avoid the latency of running the damage worker. The deferred-I/O helper drm_fb_helper_deferred_io() runs in a worker thread at regular intervals as part of writing to mmaped framebuffer memory. It used to schedule the fbdev damage worker to flush the framebuffer. Changing this to flushing the framebuffer directly avoids the latency introduced by the damage worker. v2: * remove fb_dirty from defio in separate patch (Daniel) Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20221115115819.23088-5-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/drm_fb_helper.c')
-rw-r--r--drivers/gpu/drm/drm_fb_helper.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index b3a731b9170a..cdbf03e941b2 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -666,10 +666,16 @@ void drm_fb_helper_deferred_io(struct fb_info *info, struct list_head *pagerefli
if (min_off < max_off) {
drm_fb_helper_memory_range_to_clip(info, min_off, max_off - min_off, &damage_area);
- drm_fb_helper_damage(helper, damage_area.x1, damage_area.y1,
- drm_rect_width(&damage_area),
- drm_rect_height(&damage_area));
+ drm_fb_helper_add_damage_clip(helper, damage_area.x1, damage_area.y1,
+ drm_rect_width(&damage_area),
+ drm_rect_height(&damage_area));
}
+
+ /*
+ * Flushes all dirty pages from mmap's pageref list and the
+ * areas that have been written by struct fb_ops callbacks.
+ */
+ drm_fb_helper_fb_dirty(helper);
}
EXPORT_SYMBOL(drm_fb_helper_deferred_io);