|
@@ -25,8 +25,8 @@
|
|
#include <linux/pagemap.h>
|
|
#include <linux/pagemap.h>
|
|
|
|
|
|
/* this is to find and return the vmalloc-ed fb pages */
|
|
/* this is to find and return the vmalloc-ed fb pages */
|
|
-static struct page* fb_deferred_io_nopage(struct vm_area_struct *vma,
|
|
|
|
- unsigned long vaddr, int *type)
|
|
|
|
|
|
+static int fb_deferred_io_fault(struct vm_area_struct *vma,
|
|
|
|
+ struct vm_fault *vmf)
|
|
{
|
|
{
|
|
unsigned long offset;
|
|
unsigned long offset;
|
|
struct page *page;
|
|
struct page *page;
|
|
@@ -34,18 +34,17 @@ static struct page* fb_deferred_io_nopage(struct vm_area_struct *vma,
|
|
/* info->screen_base is in System RAM */
|
|
/* info->screen_base is in System RAM */
|
|
void *screen_base = (void __force *) info->screen_base;
|
|
void *screen_base = (void __force *) info->screen_base;
|
|
|
|
|
|
- offset = (vaddr - vma->vm_start) + (vma->vm_pgoff << PAGE_SHIFT);
|
|
|
|
|
|
+ offset = vmf->pgoff << PAGE_SHIFT;
|
|
if (offset >= info->fix.smem_len)
|
|
if (offset >= info->fix.smem_len)
|
|
- return NOPAGE_SIGBUS;
|
|
|
|
|
|
+ return VM_FAULT_SIGBUS;
|
|
|
|
|
|
page = vmalloc_to_page(screen_base + offset);
|
|
page = vmalloc_to_page(screen_base + offset);
|
|
if (!page)
|
|
if (!page)
|
|
- return NOPAGE_OOM;
|
|
|
|
|
|
+ return VM_FAULT_SIGBUS;
|
|
|
|
|
|
get_page(page);
|
|
get_page(page);
|
|
- if (type)
|
|
|
|
- *type = VM_FAULT_MINOR;
|
|
|
|
- return page;
|
|
|
|
|
|
+ vmf->page = page;
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
|
|
|
|
int fb_deferred_io_fsync(struct file *file, struct dentry *dentry, int datasync)
|
|
int fb_deferred_io_fsync(struct file *file, struct dentry *dentry, int datasync)
|
|
@@ -84,7 +83,7 @@ static int fb_deferred_io_mkwrite(struct vm_area_struct *vma,
|
|
}
|
|
}
|
|
|
|
|
|
static struct vm_operations_struct fb_deferred_io_vm_ops = {
|
|
static struct vm_operations_struct fb_deferred_io_vm_ops = {
|
|
- .nopage = fb_deferred_io_nopage,
|
|
|
|
|
|
+ .fault = fb_deferred_io_fault,
|
|
.page_mkwrite = fb_deferred_io_mkwrite,
|
|
.page_mkwrite = fb_deferred_io_mkwrite,
|
|
};
|
|
};
|
|
|
|
|