• C
    drm/i915: Allow overlapping userptr objects · ec8b0dd5
    Chris Wilson 提交于
    Whilst I strongly advise against doing so for the implicit coherency
    issues between the multiple buffer objects accessing the same backing
    store, it nevertheless is a valid use case, akin to mmaping the same
    file multiple times.
    
    The reason why we forbade it earlier was that our use of the interval
    tree for fast invalidation upon vma changes excluded overlapping
    objects. So in the case where the user wishes to create such pairs of
    overlapping objects, we degrade the range invalidation to walkin the
    linear list of objects associated with the mm.
    
    A situation where overlapping objects could arise is the lax implementation
    of MIT-SHM Pixmaps in the xserver. A second situation is where the user
    wishes to have different access modes to a region of memory (e.g. access
    through a read-only userptr buffer and through a normal userptr buffer).
    
    v2: Compile for mmu-notifiers after tweaking
    v3: Rename is_linear/has_linear
    Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
    Cc: "Li, Victor Y" <victor.y.li@intel.com>
    Cc: "Kelley, Sean V" <sean.v.kelley@intel.com>
    Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
    Cc: "Gong, Zhipeng" <zhipeng.gong@intel.com>
    Cc: Akash Goel <akash.goel@intel.com>
    Cc: "Volkin, Bradley D" <bradley.d.volkin@intel.com>
    Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
    Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
    ec8b0dd5
i915_gem_userptr.c 20.5 KB