]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Don't prefault the entire obj if the vma is smaller
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 17 Jun 2014 18:03:00 +0000 (21:03 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 17 Jun 2014 22:48:35 +0000 (00:48 +0200)
commit206fa915db468c46854f0d00f4acb11158f51011
tree46b84c371dc7ebddfe45c90b07a9893dad0a2dd0
parent19987397e2be089160d409b613c0756ae6c4a574
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 d6fbf2e4062cb78744e0344bc48a1f2e1f39d4e5
 Author: Chris Wilson <chris@chris-wilson.co.uk>
 Date:   Tue Jun 10 12:14:40 2014 +0100

    drm/i915: Prefault the entire object on first page fault

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Testcase: igt/gem_mmap/short-mmap
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem.c