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
if (total_size - count < pos)
count = total_size - pos;
+ if (info->fbops->fb_sync)
+ info->fbops->fb_sync(info);
+
if (drm_fbdev_use_iomem(info))
ret = fb_read_screen_base(info, buf, count, pos);
else
count = total_size - pos;
}
+ if (info->fbops->fb_sync)
+ info->fbops->fb_sync(info);
+
/*
* Copy to framebuffer even if we already logged an error. Emulates
* the behavior of the original fbdev implementation.