drm/i915: Correctly set the write flag for get_user_pages in pread.
authorEric Anholt <eric@anholt.net>
Tue, 7 Apr 2009 23:01:22 +0000 (16:01 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 8 Apr 2009 17:50:56 +0000 (10:50 -0700)
Otherwise, the results of our read didn't show up when we were faulting in
the page being read into (as happened with a testcase reading into a big
stack area).  Likely accounts for some conformance test failures.

Signed-off-by: Eric Anholt <eric@anholt.net>
drivers/gpu/drm/i915/i915_gem.c

index 6f7d0e27036f7f01b90e5a835b7084a2aa257028..3a1189d94a9a793852767a23ddbf34d08d510c4e 100644 (file)
@@ -287,7 +287,7 @@ i915_gem_shmem_pread_slow(struct drm_device *dev, struct drm_gem_object *obj,
 
        down_read(&mm->mmap_sem);
        pinned_pages = get_user_pages(current, mm, (uintptr_t)args->data_ptr,
-                                     num_pages, 0, 0, user_pages, NULL);
+                                     num_pages, 1, 0, user_pages, NULL);
        up_read(&mm->mmap_sem);
        if (pinned_pages < num_pages) {
                ret = -EFAULT;