• Michel Thierry's avatar
    drm/i915/gen8: Add 4 level support in insert_entries and clear_range · de5ba8eb
    Michel Thierry authored
    When 48b is enabled, gen8_ppgtt_insert_entries needs to read the Page Map
    Level 4 (PML4), before it selects which Page Directory Pointer (PDP)
    it will write to.
    
    Similarly, gen8_ppgtt_clear_range needs to get the correct PDP/PD range.
    
    This patch was inspired by Ben's "Depend exclusively on map and
    unmap_vma".
    
    v2: Rebase after s/page_tables/page_table/.
    v3: Remove unnecessary pdpe loop in gen8_ppgtt_clear_range_4lvl and use
    clamp_pdp in gen8_ppgtt_insert_entries (Akash).
    v4: Merge gen8_ppgtt_clear_range_4lvl into gen8_ppgtt_clear_range to
    maintain symmetry with gen8_ppgtt_insert_entries (Akash).
    v5: Do not mix pages and bytes in insert_entries (Akash).
    v6: Prevent overflow in sg_nents << PAGE_SHIFT, when inserting 4GB at
    once.
    v7: Rebase after Mika's ppgtt cleanup / scratch merge patch series.
    Use gen8_px_index functions, and remove unnecessary number of pages
    parameter in insert_pte_entries.
    v8: Change gen8_ppgtt_clear_pte_range to stop at PDP boundary, instead of
    adding and extra clamp function; remove unnecessary pdp_start/pdp_len
    variables (Akash).
    v9: pages->orig_nents instead of sg_nents(pages->sgl) to get the
    length (Akash).
    v10: Remove pdp warning check ingen8_ppgtt_insert_pte_entries until this
    commit (Akash).
    
    Reviewed-by: Akash Goel <akash.goel@intel.com> (v9)
    Cc: Akash Goel <akash.goel@intel.com>
    Signed-off-by: default avatarMichel Thierry <michel.thierry@intel.com>
    Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    de5ba8eb
i915_gem_gtt.c 85.4 KB