drm/i915: Don't prefault the entire obj if the vma is smaller
Take the minimum of the object size and the vma size and prefault
only that much. Avoids a SIGBUS when mmapping only a portion of the
object.
Prefaulting was introduced here:
commit
b90b91d87038f6b257b40a02b42ed4f9705e06f0
Author: Chris Wilson <
[email protected]>
Date: Tue Jun 10 12:14:40 2014 +0100
drm/i915: Prefault the entire object on first page fault
Cc: Chris Wilson <[email protected]>
Signed-off-by: Ville Syrjälä <[email protected]>
Testcase: igt/gem_mmap/short-mmap
Signed-off-by: Daniel Vetter <[email protected]>