Skip to content
  • Chris Wilson's avatar
    drm/i915: Support for creating write combined type vmaps · d31d7cb1
    Chris Wilson authored
    
    
    vmaps has a provision for controlling the page protection bits, with which
    we can use to control the mapping type, e.g. WB, WC, UC or even WT.
    To allow the caller to choose their mapping type, we add a parameter to
    i915_gem_object_pin_map - but we still only allow one vmap to be cached
    per object. If the object is currently not pinned, then we recreate the
    previous vmap with the new access type, but if it was pinned we report an
    error. This effectively limits the access via i915_gem_object_pin_map to a
    single mapping type for the lifetime of the object. Not usually a problem,
    but something to be aware of when setting up the object's vmap.
    
    We will want to vary the access type to enable WC mappings of ringbuffer
    and context objects on !llc platforms, as well as other objects where we
    need coherent access to the GPU's pages without going through the GTT
    
    v2: Remove the redundant braces around pin count check and fix the marker
         in documentation (Chris)
    
    v3:
    - Add a new enum for the vmalloc mapping type & pass that as an argument to
       i915_object_pin_map. (Tvrtko)
    - Use PAGE_MASK to extract or filter the mapping type info and remove a
       superfluous BUG_ON.(Tvrtko)
    
    v4:
    - Rename the enums and clean up the pin_map function. (Chris)
    
    v5: Drop the VM_NO_GUARD, minor cosmetics.
    
    Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
    Signed-off-by: default avatarAkash Goel <akash.goel@intel.com>
    Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
    Link: http://patchwork.freedesktop.org/patch/msgid/1471001999-17787-1-git-send-email-chris@chris-wilson.co.uk
    d31d7cb1