• Chris Wilson's avatar
    drm/i915: Preallocate stashes for vma page-directories · cd0452aa
    Chris Wilson authored
    We need to make the DMA allocations used for page directories to be
    performed up front so that we can include those allocations in our
    memory reservation pass. The downside is that we have to assume the
    worst case, even before we know the final layout, and always allocate
    enough page directories for this object, even when there will be overlap.
    This unfortunately can be quite expensive, especially as we have to
    clear/reset the page directories and DMA pages, but it should only be
    required during early phases of a workload when new objects are being
    discovered, or after memory/eviction pressure when we need to rebind.
    Once we reach steady state, the objects should not be moved and we no
    longer need to preallocating the pages tables.
    
    It should be noted that the lifetime for the page directories DMA is
    more or less decoupled from individual fences as they will be shared
    across objects across timelines.
    
    v2: Only allocate enough PD space for the PTE we may use, we do not need
    to allocate PD that will be left as scratch.
    v3: Store the shift unto the first PD level to encapsulate the different
    PTE counts for gen6/gen8.
    Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
    Cc: Matthew Auld <matthew.auld@intel.com>
    Reviewed-by: default avatarMatthew Auld <matthew.auld@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20200729164219.5737-1-chris@chris-wilson.co.ukSigned-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
    Signed-off-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
    cd0452aa
gen8_ppgtt.c 18.8 KB