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

drm/fb-helper: Call fb_sync in I/O functions

Call struct fb_ops.fb_sync in drm_fbdev_{read,write}() to mimic the
behavior of fbdev. Fbdev implementations of fb_read and fb_write in
struct fb_ops invoke fb_sync to synchronize with outstanding operations
before I/O. Doing the same in DRM implementations will allow us to use
them throughout DRM drivers.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221103151446.2638-17-tzimmermann@suse.de

+6
+6
drivers/gpu/drm/drm_fb_helper.c
··· 2246 2246 if (total_size - count < pos) 2247 2247 count = total_size - pos; 2248 2248 2249 + if (info->fbops->fb_sync) 2250 + info->fbops->fb_sync(info); 2251 + 2249 2252 if (drm_fbdev_use_iomem(info)) 2250 2253 ret = fb_read_screen_base(info, buf, count, pos); 2251 2254 else ··· 2329 2326 err = -ENOSPC; 2330 2327 count = total_size - pos; 2331 2328 } 2329 + 2330 + if (info->fbops->fb_sync) 2331 + info->fbops->fb_sync(info); 2332 2332 2333 2333 /* 2334 2334 * Copy to framebuffer even if we already logged an error. Emulates