@@ -760,6 +760,16 @@ void drm_fb_helper_deferred_io(struct fb_info *info,
}
EXPORT_SYMBOL(drm_fb_helper_deferred_io);
+vm_fault_t drm_fb_helper_vm_page_mkwrite(struct drm_fb_helper *fb_helper, struct vm_fault *vmf)
+{
+ struct fb_info *info = fb_helper->fbdev;
+
+ if (!info->fbdefio)
+ return 0;
+ return fb_deferred_io_page_mkwrite(info, vmf);
+}
+EXPORT_SYMBOL(drm_fb_helper_vm_page_mkwrite);
+
/**
* drm_fb_helper_sys_read - wrapper around fb_sys_read
* @info: fb_info struct pointer
@@ -232,6 +232,9 @@ void drm_fb_helper_fill_info(struct fb_info *info,
void drm_fb_helper_deferred_io(struct fb_info *info,
struct list_head *pagelist);
+vm_fault_t drm_fb_helper_vm_page_mkwrite(struct drm_fb_helper *fb_helper,
+ struct vm_fault *vmf);
+
ssize_t drm_fb_helper_sys_read(struct fb_info *info, char __user *buf,
size_t count, loff_t *ppos);
ssize_t drm_fb_helper_sys_write(struct fb_info *info, const char __user *buf,
@@ -355,6 +358,12 @@ static inline void drm_fb_helper_deferred_io(struct fb_info *info,
{
}
+static inline vm_fault_t drm_fb_helper_vm_page_mkwrite(struct drm_fb_helper *fb_helper,
+ struct vm_fault *vmf)
+{
+ return 0;
+}
+
static inline int drm_fb_helper_defio_init(struct drm_fb_helper *fb_helper)
{
return -ENODEV;
Add drm_fb_helper_vm_page_mkwrite(), a helper to track pages written by fbdev userspace. DRM drivers should use this function to implement fbdev deferred I/O. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> --- drivers/gpu/drm/drm_fb_helper.c | 10 ++++++++++ include/drm/drm_fb_helper.h | 9 +++++++++ 2 files changed, 19 insertions(+)