• Chris Wilson's avatar
    drm/i915: Move ioremap_wc tracking onto VMA · 8ef8561f
    Chris Wilson authored
    By tracking the iomapping on the VMA itself, we can share that area
    between multiple users. Also by only revoking the iomapping upon
    unbinding from the mappable portion of the GGTT, we can keep that iomap
    across multiple invocations (e.g. execlists context pinning).
    
    Note that by moving the iounnmap tracking to the VMA, we actually end up
    fixing a leak of the iomapping in intel_fbdev.
    
    v1.5: Rebase prompted by Tvrtko
    v2: Drop dev_priv parameter, we can recover the i915_ggtt from the vma.
    v3: Move handling of ioremap space exhaustion to vmap_purge and also
    allow vmallocs to recover old iomaps. Add Tvrtko's kerneldoc.
    v4: Fix a use-after-free in shrinker and rearrange i915_vma_iomap
    v5: Back to i915_vm_to_ggtt
    v6: Use i915_vma_pin_iomap and i915_vma_unpin_iomap to mark critical
    sections and ensure the VMA cannot be reaped whilst mapped.
    v7: Move i915_vma_iounmap so that consumers of the API are not tempted,
    and add iomem annotations
    Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
    Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
    Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
    Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
    Link: http://patchwork.freedesktop.org/patch/msgid/1461833819-3991-5-git-send-email-chris@chris-wilson.co.uk
    8ef8561f
i915_gem.c 138 KB