• Chris Wilson's avatar
    drm/i915: Replace the array of pages with a scatterlist · 9da3da66
    Chris Wilson authored
    
    
    Rather than have multiple data structures for describing our page layout
    in conjunction with the array of pages, we can migrate all users over to
    a scatterlist.
    
    One major advantage, other than unifying the page tracking structures,
    this offers is that we replace the vmalloc'ed array (which can be up to
    a megabyte in size) with a chain of individual pages which helps reduce
    memory pressure.
    
    The disadvantage is that we then do not have a simple array to iterate,
    or to access randomly. The common case for this is in the relocation
    processing, which will typically fit within a single scatterlist page
    and so be almost the same cost as the simple array. For iterating over
    the array, the extra function call could be optimised away, but in
    reality is an insignificant cost of either binding the pages, or
    performing the pwrite/pread.
    
    v2: Fix drm_clflush_sg() to not invoke wbinvd as well! And fix the
    trivial compile error from rebasing.
    Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
    Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    9da3da66
i915_gem.c 110 KB