1. 19 11月, 2015 1 次提交
  2. 06 10月, 2015 1 次提交
    • M
      drm/i915: prevent out of range pt in the PDE macros (take 3) · 24dfd073
      Michel Thierry 提交于
      We tried to fix this in commit fdc454c1 ("drm/i915: Prevent out of
      range pt in gen6_for_each_pde").
      
      But the static analyzer still complains that, just before we break due
      to "iter < I915_PDES", we do "pt = (pd)->page_table[iter]" with an
      iter value that is bigger than I915_PDES. Of course, this isn't really
      a problem since no one uses pt outside the macro. Still, every single
      new usage of the macro will create a new issue for us to mark as a
      false positive.
      
      Also, Paulo re-started the discussion a while ago [1], but didn't end up
      implemented.
      
      In order to "solve" this "problem", this patch takes the ideas from
      Chris and Dave, but that check would change the desired behavior of the
      code, because the object (for example pdp->page_directory[iter]) can be
      null during init/alloc, and C would take this as false, breaking the for
      loop immediately.
      
      This has been already verified with "static analysis tools".
      
      [1]http://lists.freedesktop.org/archives/intel-gfx/2015-June/068548.html
      
      v2: Make it a single statement, while preventing the common subexpression
      elimination (Chris)
      
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Dave Gordon <david.s.gordon@intel.com>
      Signed-off-by: NMichel Thierry <michel.thierry@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      24dfd073
  3. 23 9月, 2015 3 次提交
  4. 15 8月, 2015 6 次提交
    • M
      drm/i915/gtt: Allow >= 4GB offsets in X86_32 · 088e0df4
      Michel Thierry 提交于
      Similar to commit c44ef60e ("drm/i915/gtt:
      Allow >= 4GB sizes for vm"), i915_gem_obj_offset and i915_gem_obj_ggtt_offset
      return an unsigned long, which in only 4-bytes long in 32-bit kernels.
      
      Change return type (and other related offset variables) to u64.
      
      Since Global GTT is always limited to 4GB, this change would not be required
      in i915_gem_obj_ggtt_offset, but this is done for consistency.
      
      v2: Remove unnecessary offset variable in do_pin, as we already have
          vma->node.start (Chris).
          Update GGTT offset too (Tvrtko).
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Signed-off-by: NMichel Thierry <michel.thierry@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      088e0df4
    • M
      drm/i915/gen8: Initialize PDPs and PML4 · 69ab76fd
      Michel Thierry 提交于
      Similar to PDs, while setting up a page directory pointer, make all entries
      of the pdp point to the scratch pd before mapping (and make all its entries
      point to the scratch page); this is to be safe in case of out of bound
      access or  proactive prefetch.
      
      Also add a scratch pdp, which the PML4 entries point to.
      
      v2: Handle scratch_pdp allocation failure correctly, and keep
      initialize_px functions together (Akash)
      v3: Rebase after Mika's ppgtt cleanup / scratch merge patch series. Rely on
      the added macros to initialize the pdps.
      v4: Rebase after final merged version of Mika's ppgtt/scratch patches
      (and removed commit message part related to v3).
      v5: Update commit message to also mention PML4 table initialization and
      the new scratch pdp (Akash).
      Suggested-by: NAkash Goel <akash.goel@intel.com>
      Signed-off-by: NMichel Thierry <michel.thierry@intel.com>
      Reviewed-by: NAkash Goel <akash.goel@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      69ab76fd
    • M
      drm/i915/gen8: implement alloc/free for 4lvl · 762d9936
      Michel Thierry 提交于
      PML4 has no special attributes, and there will always be a PML4.
      So simply initialize it at creation, and destroy it at the end.
      
      The code for 4lvl is able to call into the existing 3lvl page table code
      to handle all of the lower levels.
      
      v2: Return something at the end of gen8_alloc_va_range_4lvl to keep the
      compiler happy. And define ret only in one place.
      Updated gen8_ppgtt_unmap_pages and gen8_ppgtt_free to handle 4lvl.
      v3: Use i915_dma_unmap_single instead of pci API. Fix a
      couple of incorrect checks when unmapping pdp and pd pages (Akash).
      v4: Call __pdp_fini also for 32b PPGTT. Clean up alloc_pdp param list.
      v5: Prevent (harmless) out of range access in gen8_for_each_pml4e.
      v6: Simplify alloc_vma_range_4lvl and gen8_ppgtt_init_common error
      paths. (Akash)
      v7: Rebase, s/gen8_ppgtt_free_*/gen8_ppgtt_cleanup_*/.
      v8: Change location of pml4_init/fini. It will make next patches
      cleaner.
      v9: Rebase after Mika's ppgtt cleanup / scratch merge patch series, while
      trying to reuse as much as possible for pdp alloc. pml4_init/fini
      replaced by setup/cleanup_px macros.
      v10: Rebase after Mika's merged ppgtt cleanup patch series.
      v11: Rebase after final merged version of Mika's ppgtt/scratch
      patches.
      v12: Fix pdpe start value in trace (Akash)
      v13: Define all 4lvl functions in this patch directly, instead of
      previous patches, add i915_page_directory_pointer_entry_alloc here,
      use test_bit to detect when pdp is already allocated (Akash).
      v14: Move pdp allocation into a new gen8_ppgtt_alloc_page_dirpointers
      funtion, as we do for pds and pts; move pd and pdp setup functions to
      this patch (Akash).
      v15: Added kfree(pdp) from previous patch to this (Akash).
      
      Cc: Akash Goel <akash.goel@intel.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: Michel Thierry <michel.thierry@intel.com> (v2+)
      Reviewed-by: NAkash Goel <akash.goel@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      762d9936
    • M
      drm/i915/gen8: Add PML4 structure · 81ba8aef
      Michel Thierry 提交于
      Introduces the Page Map Level 4 (PML4), ie. the new top level structure
      of the page tables.
      
      To facilitate testing, 48b mode will be available on Broadwell and
      GEN9+, when i915.enable_ppgtt = 3.
      
      v2: Remove unnecessary CONFIG_X86_64 checks, ppgtt code is already
      32/64-bit safe (Chris).
      v3: Add goto free_scratch in temp 48-bit mode init code (Akash).
      v4: kfree the pdp until the 4lvl alloc/free patch (Akash).
      v5: Postpone 48-bit code in sanitize_enable_ppgtt (Akash).
      v6: Keep _insert_pte_entries changes outside this patch (Akash).
      
      Cc: Akash Goel <akash.goel@intel.com>
      Signed-off-by: NMichel Thierry <michel.thierry@intel.com>
      Reviewed-by: NAkash Goel <akash.goel@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      81ba8aef
    • M
      drm/i915/gen8: Make pdp allocation more dynamic · 6ac18502
      Michel Thierry 提交于
      This transitional patch doesn't do much for the existing code. However,
      it should make upcoming patches to use the full 48b address space a bit
      easier.
      
      32-bit ppgtt uses just 4 PDPs, while 48-bit ppgtt will have up-to 512;
      this patch prepares the existing functions to query the right number of pdps
      at run-time. This also means that used_pdpes should also be allocated during
      ppgtt_init, as the bitmap size will depend on the ppgtt address range
      selected.
      
      v2: Renamed  pdp_free to be similar to  pd/pt (unmap_and_free_pdp).
      v3: To facilitate testing, 48b mode will be available on Broadwell and
      GEN9+, when i915.enable_ppgtt = 3.
      v4: Rebase after s/page_tables/page_table/, added extra information
      about 4-level page table formats and use IS_ENABLED macro.
      v5: Check CONFIG_X86_64 instead of CONFIG_64BIT.
      v6: Rebase after Mika's ppgtt cleanup / scratch merge patch series, and
      follow
      his nomenclature in pdp functions (there is no alloc_pdp yet).
      v7: Rebase after merged version of Mika's ppgtt cleanup patch series.
      v8: Rebase after final merged version of Mika's ppgtt/scratch patches.
      v9: Introduce PML4 (and 48-bit checks) until next patch (Akash).
      v10: Also use test_bit to detect when pd/pt are already allocated (Akash)
      
      Cc: Akash Goel <akash.goel@intel.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: Michel Thierry <michel.thierry@intel.com> (v2+)
      Reviewed-by: NAkash Goel <akash.goel@intel.com>
      [danvet: Amend commit message as suggested by Michel.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6ac18502
    • M
      drm/i915: Remove unnecessary gen8_clamp_pd · 09120d4e
      Michel Thierry 提交于
      gen8_clamp_pd clamps to the next page directory boundary, but the macro
      gen8_for_each_pde already has a check to stop at the page directory
      boundary.
      
      Furthermore, i915_pte_count also restricts to the next page table
      boundary.
      
      v2: Rebase after Mika's ppgtt cleanup / scratch merge patch series.
      Suggested-by: NAkash Goel <akash.goel@intel.com>
      Signed-off-by: NMichel Thierry <michel.thierry@intel.com>
      Reviewed-by: N"Akash Goel" <akash.goel@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      09120d4e
  5. 26 6月, 2015 6 次提交
  6. 24 6月, 2015 1 次提交
  7. 23 6月, 2015 3 次提交
  8. 08 5月, 2015 2 次提交
  9. 24 4月, 2015 1 次提交
  10. 20 4月, 2015 2 次提交
  11. 10 4月, 2015 5 次提交
  12. 27 3月, 2015 3 次提交
    • J
      drm/i915: Compare GGTT view structs instead of types · 9abc4648
      Joonas Lahtinen 提交于
      To allow for views where the view type is not defined by the view type only,
      like it is in stereo or rotated 90 degree view, change the semantic to require
      the whole view structure for comparison when we match a GGTT view.
      
      This allows including parameters like offset to be included in the view which
      is useful for eg. partial views.
      
      v3:
      - Rely on ggtt_view type being 0 for non-GGTT vma's, which equals to
        I915_GGTT_VIEW_NORMAL. (Daniel Vetter)
      - Do not use potentially slower comparison when we only want to know if
        something is or is not a normal view.
      - Rebase on top of rotated view patches. Add rotated view singleton.
      - If one view is missing in comparison they're equal only if both are missing.
      
      v4:
      - Use comparison helper in obj_to_ggtt_view too. (Tvrtko Ursulin)
      - Do WARN_ON if one view is NULL. (Tvrtko Ursulin)
      
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Signed-off-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      9abc4648
    • M
      drm/i915: Finish gen6/7 dynamic page table allocation · 4933d519
      Michel Thierry 提交于
      This patch continues on the idea from "Track GEN6 page table usage".
      From here on, in the steady state, PDEs are all pointing to the scratch
      page table (as recommended in the spec). When an object is allocated in
      the VA range, the code will determine if we need to allocate a page for
      the page table. Similarly when the object is destroyed, we will remove,
      and free the page table pointing the PDE back to the scratch page.
      
      Following patches will work to unify the code a bit as we bring in GEN8
      support. GEN6 and GEN8 are different enough that I had a hard time to
      get to this point with as much common code as I do.
      
      The aliasing PPGTT must pre-allocate all of the page tables. There are a
      few reasons for this. Two trivial ones: aliasing ppgtt goes through the
      ggtt paths, so it's hard to maintain, we currently do not restore the
      default context (assuming the previous force reload is indeed
      necessary). Most importantly though, the only way (it seems from
      empirical evidence) to invalidate the CS TLBs on non-render ring is to
      either use ring sync (which requires actually stopping the rings in
      order to synchronize when the sync completes vs. where you are in
      execution), or to reload DCLV.  Since without full PPGTT we do not ever
      reload the DCLV register, there is no good way to achieve this. The
      simplest solution is just to not support dynamic page table
      creation/destruction in the aliasing PPGTT.
      
      We could always reload DCLV, but this seems like quite a bit of excess
      overhead only to save at most 2MB-4k of memory for the aliasing PPGTT
      page tables.
      
      v2: Make the page table bitmap declared inside the function (Chris)
      Simplify the way scratching address space works.
      Move the alloc/teardown tracepoints up a level in the call stack so that
      both all implementations get the trace.
      
      v3: Updated trace event to spit out a name
      
      v4: Aliasing ppgtt is now initialized differently (in setup global gtt)
      
      v5: Rebase to latest code. Also removed unnecessary aliasing ppgtt check
      for trace, as it is no longer possible after the PPGTT cleanup patch series
      of a couple of months ago (Daniel).
      
      v6: Implement changes from code review (Daniel):
       - allocate/teardown_va_range calls added.
       - Add a scratch page allocation helper (only need the address).
       - Move trace events to a new patch.
       - Use updated mark_tlbs_dirty.
       - Moved pt preallocation for aliasing ppgtt into gen6_ppgtt_init.
      
      v7: teardown_va_range removed (Daniel).
          In init, gen6_ppgtt_clear_range call is only needed for aliasing ppgtt.
      
      v8: Rebase after s/page_tables/page_table/.
      
      v9: Remove unnecessary scratch flag in page_table struct, future patches
      can just compare against ppgtt->scratch_pt, and alloc_pt_scratch becomes
      redundant. Initialize scratch_pt and pt. (Mika)
      
      v10: Clean up aliasing ppgtt init error path and prevent leaking the
      ppgtt obj when init fails. (Mika)
      Updated commit author. (Daniel)
      
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: Michel Thierry <michel.thierry@intel.com> (v4+)
      Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      4933d519
    • M
      drm/i915: Prevent out of range pt in gen6_for_each_pde · fdc454c1
      Michel Thierry 提交于
      Found by static analysis tool, this was harmless as the pt was not
      used out of scope though.
      
      Introduced by commit 678d96fb
      ("drm/i915: Track GEN6 page table usage").
      
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NMichel Thierry <michel.thierry@intel.com>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      fdc454c1
  13. 23 3月, 2015 1 次提交
    • T
      drm/i915/skl: Support secondary (rotated) frame buffer mapping · 50470bb0
      Tvrtko Ursulin 提交于
      90/270 rotated scanout needs a rotated GTT view of the framebuffer.
      
      This is put in a separate VMA with a dedicated ggtt view and wired such that
      it is created when a framebuffer is pinned to a 90/270 rotated plane.
      
      Rotation is only possible with Yb/Yf buffers and error is propagated to
      user space in case of a mismatch.
      
      Special rotated page view is constructed at the VMA creation time by
      borrowing the DMA addresses from obj->pages.
      
      v2:
          * Do not bother with pages for rotated sg list, just populate the DMA
            addresses. (Daniel Vetter)
          * Checkpatch cleanup.
      
      v3:
          * Rebased on top of new plane handling (create rotated mapping when
            setting the rotation property).
          * Unpin rotated VMA on unpinning from display plane.
          * Simplify rotation check using bitwise AND. (Chris Wilson)
      
      v4:
          * Fix unpinning of optional rotated mapping so it is really considered
            to be optional.
      
      v5:
         * Rebased for fb modifier changes.
         * Rebased for atomic commit.
         * Only pin needed view for display. (Ville Syrjälä, Daniel Vetter)
      
      v6:
         * Rebased after preparatory work has been extracted out. (Daniel Vetter)
      
      v7:
         * Slightly simplified tiling geometry calculation.
         * Moved rotated GGTT view implementation into i915_gem_gtt.c (Daniel Vetter)
      
      v8:
         * Do not use i915_gem_obj_size to get object size since that actually
           returns the size of an VMA which may not exist.
         * Rebased for ggtt view changes.
      
      v9:
         * Rebased after code review changes on the preceding patches.
         * Tidy function definitions. (Joonas Lahtinen)
      
      For: VIZ-4726
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: Michel Thierry <michel.thierry@intel.com> (v4)
      Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      50470bb0
  14. 20 3月, 2015 3 次提交
    • B
      drm/i915: Track page table reload need · 563222a7
      Ben Widawsky 提交于
      This patch was formerly known as, "Force pd restore when PDEs change,
      gen6-7." I had to change the name because it is needed for GEN8 too.
      
      The real issue this is trying to solve is when a new object is mapped
      into the current address space. The GPU does not snoop the new mapping
      so we must do the gen specific action to reload the page tables.
      
      GEN8 and GEN7 do differ in the way they load page tables for the RCS.
      GEN8 does so with the context restore, while GEN7 requires the proper
      load commands in the command streamer. Non-render is similar for both.
      
      Caveat for GEN7
      The docs say you cannot change the PDEs of a currently running context.
      We never map new PDEs of a running context, and expect them to be
      present - so I think this is okay. (We can unmap, but this should also
      be okay since we only unmap unreferenced objects that the GPU shouldn't
      be tryingto va->pa xlate.) The MI_SET_CONTEXT command does have a flag
      to signal that even if the context is the same, force a reload. It's
      unclear exactly what this does, but I have a hunch it's the right thing
      to do.
      
      The logic assumes that we always emit a context switch after mapping new
      PDEs, and before we submit a batch. This is the case today, and has been
      the case since the inception of hardware contexts. A note in the comment
      let's the user know.
      
      It's not just for gen8. If the current context has mappings change, we
      need a context reload to switch
      
      v2: Rebased after ppgtt clean up patches. Split the warning for aliasing
      and true ppgtt options. And do not break aliasing ppgtt, where to->ppgtt
      is always null.
      
      v3: Invalidate PPGTT TLBs inside alloc_va_range.
      
      v4: Rename ppgtt_invalidate_tlbs to mark_tlbs_dirty and move
      pd_dirty_rings from i915_address_space to i915_hw_ppgtt. Fixes when
      neither ctx->ppgtt and aliasing_ppgtt exist.
      
      v5: Removed references to teardown_va_range.
      
      v6: Updated needs_pd_load_pre/post.
      
      v7: Fix pd_dirty_rings check in needs_pd_load_post, and update/move
      comment about updated PDEs to object_pin/bind (Mika).
      
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: Michel Thierry <michel.thierry@intel.com> (v2+)
      Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      563222a7
    • B
      drm/i915: Track GEN6 page table usage · 678d96fb
      Ben Widawsky 提交于
      Instead of implementing the full tracking + dynamic allocation, this
      patch does a bit less than half of the work, by tracking and warning on
      unexpected conditions. The tracking itself follows which PTEs within a
      page table are currently being used for objects. The next patch will
      modify this to actually allocate the page tables only when necessary.
      
      With the current patch there isn't much in the way of making a gen
      agnostic range allocation function. However, in the next patch we'll add
      more specificity which makes having separate functions a bit easier to
      manage.
      
      One important change introduced here is that DMA mappings are
      created/destroyed at the same page directories/tables are
      allocated/deallocated.
      
      Notice that aliasing PPGTT is not managed here. The patch which actually
      begins dynamic allocation/teardown explains the reasoning for this.
      
      v2: s/pdp.page_directory/pdp.page_directories
      Make a scratch page allocation helper
      
      v3: Rebase and expand commit message.
      
      v4: Allocate required pagetables only when it is needed, _bind_to_vm
      instead of bind_vma (Daniel).
      
      v5: Rebased to remove the unnecessary noise in the diff, also:
       - PDE mask is GEN agnostic, renamed GEN6_PDE_MASK to I915_PDE_MASK.
       - Removed unnecessary checks in gen6_alloc_va_range.
       - Changed map/unmap_px_single macros to use dma functions directly and
         be part of a static inline function instead.
       - Moved drm_device plumbing through page tables operation to its own
         patch.
       - Moved allocate/teardown_va_range calls until they are fully
         implemented (in subsequent patch).
       - Merged pt and scratch_pt unmap_and_free path.
       - Moved scratch page allocator helper to the patch that will use it.
      
      v6: Reduce complexity by not tearing down pagetables dynamically, the
      same can be achieved while freeing empty vms. (Daniel)
      
      v7: s/i915_dma_map_px_single/i915_dma_map_single
      s/gen6_write_pdes/gen6_write_pde
      Prevent a NULL case when only GGTT is available. (Mika)
      
      v8: Rebased after s/page_tables/page_table/.
      
      v9: Reworked i915_pte_index and i915_pte_count.
      Also exercise bitmap allocation here (gen6_alloc_va_range) and fix
      incorrect write_page_range in i915_gem_restore_gtt_mappings (Mika).
      
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: Michel Thierry <michel.thierry@intel.com> (v3+)
      Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      678d96fb
    • M
      drm/i915: page table generalizations · 07749ef3
      Michel Thierry 提交于
      No functional changes, but will improve code clarity and removed some
      duplicated defines.
      Signed-off-by: NMichel Thierry <michel.thierry@intel.com>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      07749ef3
  15. 25 2月, 2015 2 次提交
    • B
      drm/i915: Create page table allocators · 06fda602
      Ben Widawsky 提交于
      As we move toward dynamic page table allocation, it becomes much easier
      to manage our data structures if break do things less coarsely by
      breaking up all of our actions into individual tasks.  This makes the
      code easier to write, read, and verify.
      
      Aside from the dissection of the allocation functions, the patch
      statically allocates the page table structures without a page directory.
      This remains the same for all platforms,
      
      The patch itself should not have much functional difference. The primary
      noticeable difference is the fact that page tables are no longer
      allocated, but rather statically declared as part of the page directory.
      This has non-zero overhead, but things gain additional complexity as a
      result.
      
      This patch exists for a few reasons:
      1. Splitting out the functions allows easily combining GEN6 and GEN8
      code. Page tables have no difference based on GEN8. As we'll see in a
      future patch when we add the DMA mappings to the allocations, it
      requires only one small change to make work, and error handling should
      just fall into place.
      
      2. Unless we always want to allocate all page tables under a given PDE,
      we'll have to eventually break this up into an array of pointers (or
      pointer to pointer).
      
      3. Having the discrete functions is easier to review, and understand.
      All allocations and frees now take place in just a couple of locations.
      Reviewing, and catching leaks should be easy.
      
      4. Less important: the GFP flags are confined to one location, which
      makes playing around with such things trivial.
      
      v2: Updated commit message to explain why this patch exists
      
      v3: For lrc, s/pdp.page_directory[i].daddr/pdp.page_directory[i]->daddr/
      
      v4: Renamed free_pt/pd_single functions to unmap_and_free_pt/pd (Daniel)
      
      v5: Added additional safety checks in gen8 clear/free/unmap.
      
      v6: Use WARN_ON and return -EINVAL in alloc_pt_range (Mika).
      
      v7: Make err_out loop symmetrical to the way we allocate in
      alloc_pt_range. Also s/page_tables/page_table and correct commit
      message (Mika)
      
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: Michel Thierry <michel.thierry@intel.com> (v3+)
      Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      06fda602
    • B
      drm/i915: Complete page table structures · 7324cc04
      Ben Widawsky 提交于
      Move the remaining members over to the new page table structures.
      
      This can be squashed with the previous commit if desire. The reasoning
      is the same as that patch. I simply felt it is easier to review if split.
      
      v2: In lrc: s/ppgtt->pd_dma_addr[i]/ppgtt->pdp.page_directory[i].daddr/
      v3: Rebase.
      v4: Rebased after s/page_tables/page_table/.
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: Michel Thierry <michel.thierry@intel.com> (v2+)
      Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7324cc04