make video/geode/lxfb_core.c:geode_modedb[] static
[safe/jmp/linux-2.6] / drivers / video / fb_defio.c
index 65f4e6e..a0c5d9d 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/interrupt.h>
 #include <linux/fb.h>
 #include <linux/list.h>
-#include <asm/uaccess.h>
 
 /* to support deferred IO */
 #include <linux/rmap.h>
@@ -32,12 +31,14 @@ static struct page* fb_deferred_io_nopage(struct vm_area_struct *vma,
        unsigned long offset;
        struct page *page;
        struct fb_info *info = vma->vm_private_data;
+       /* info->screen_base is in System RAM */
+       void *screen_base = (void __force *) info->screen_base;
 
        offset = (vaddr - vma->vm_start) + (vma->vm_pgoff << PAGE_SHIFT);
        if (offset >= info->fix.smem_len)
                return NOPAGE_SIGBUS;
 
-       page = vmalloc_to_page(info->screen_base + offset);
+       page = vmalloc_to_page(screen_base + offset);
        if (!page)
                return NOPAGE_OOM;
 
@@ -47,6 +48,18 @@ static struct page* fb_deferred_io_nopage(struct vm_area_struct *vma,
        return page;
 }
 
+int fb_deferred_io_fsync(struct file *file, struct dentry *dentry, int datasync)
+{
+       struct fb_info *info = file->private_data;
+
+       /* Kill off the delayed work */
+       cancel_rearming_delayed_work(&info->deferred_work);
+
+       /* Run it immediately */
+       return schedule_delayed_work(&info->deferred_work, 0);
+}
+EXPORT_SYMBOL_GPL(fb_deferred_io_fsync);
+
 /* vm_ops->page_mkwrite handler */
 static int fb_deferred_io_mkwrite(struct vm_area_struct *vma,
                                  struct page *page)