1. 20 3月, 2015 4 次提交
  2. 18 3月, 2015 1 次提交
    • M
      drm/i915: Setup all page directories for gen8 · 2934368e
      Mika Kuoppala 提交于
      If the requested size is less than what the full range
      of pdps can address, we end up setting pdps for only the
      requested area.
      
      The logical context however needs all pdp entries to be valid.
      Prior to commit 06fda602 ("drm/i915: Create page table allocators")
      we have been writing pdp entries with dma address of zero instead
      of valid pdps. This is supposedly bad even if those pdps are not
      addressed.
      
      As commit 06fda602 ("drm/i915: Create page table allocators")
      introduced more dynamic structure for pdps, we ended up oopsing
      when we populated the lrc context. Analyzing this oops revealed
      the fact that we have not been writing valid pdps with bsw, as
      it is doing the ppgtt init with 2GB limit in some cases.
      
      We should do the right thing and setup the non addressable part
      pdps/pde/pte to scratch page through the minimal structure by
      having just pdp with pde entries pointing to same page with
      pte entries pointing to scratch page.
      
      But instead of going through that trouble, setup all the pdps
      through individual pd pages and pt entries, even for non
      addressable parts. And let the clear range point them to scratch
      page. This way we populate the lrc with valid pdps and wait
      for dynamic page allocation work to land, and do the heavy lifting
      for truncating page table tree according to usage.
      
      The regression of oopsing in init was introduced by
      commit 06fda602 ("drm/i915: Create page table allocators")
      
      v2: Clear the range for the unused part also (Ville)
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89350
      Cc: Michel Thierry <michel.thierry@intel.com>
      Cc: Ben Widawsky <benjamin.widawsky@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Tested-by: NValtteri Rantala <valtteri.rantala@intel.com>
      Signed-off-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      2934368e
  3. 05 3月, 2015 1 次提交
  4. 27 2月, 2015 1 次提交
  5. 26 2月, 2015 1 次提交
  6. 25 2月, 2015 4 次提交
    • M
      drm/i915: Plumb drm_device through page tables operations · 06dc68d6
      Michel Thierry 提交于
      The next patch in the series will require it for alloc_pt_single.
      
      v2: Rebased after s/page_tables/page_table/.
      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>
      06dc68d6
    • 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
    • B
      drm/i915: page table abstractions · d7b3de91
      Ben Widawsky 提交于
      When we move to dynamic page allocation, keeping page_directory and pagetabs as
      separate structures will help to break actions into simpler tasks.
      
      To help transition the code nicely there is some wasted space in gen6/7.
      This will be ameliorated shortly.
      
      Following the x86 pagetable terminology:
      PDPE = struct i915_page_directory_pointer_entry.
      PDE = struct i915_page_directory_entry [page_directory].
      PTE = struct i915_page_table_entry [page_tables].
      
      v2: fixed mismatches after clean-up/rebase.
      
      v3: Clarify the names of the multiple levels of page tables (Daniel)
      
      v4: Addressing Mika's review comments.
      s/gen8_free_page_directories/gen8_free_page_directory and free the
      page tables for the directory there.
      In gen8_ppgtt_allocate_page_directories, do not leak previously allocated
      pt in case the page_directory alloc fails.
      Update error return handling in gen8_ppgtt_alloc.
      
      v5: Do not leak pt on error in gen6_ppgtt_allocate_page_tables. (Mika)
      
      v6: s/page_tables/page_table/. (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>
      d7b3de91
  7. 14 2月, 2015 4 次提交
  8. 18 12月, 2014 2 次提交
  9. 16 12月, 2014 1 次提交
  10. 15 12月, 2014 3 次提交
    • T
      drm/i915: Documentation for multiple GGTT views · 45f8f69a
      Tvrtko Ursulin 提交于
      A short section describing background, implementation and intended usage.
      
      v2:
          * Align section name between template and DOC comment. (Michel Thierry)
      
      For: VIZ-4544
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NMichel Thierry <michel.thierry@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      45f8f69a
    • T
      drm/i915: Infrastructure for supporting different GGTT views per object · fe14d5f4
      Tvrtko Ursulin 提交于
      Things like reliable GGTT mappings and mirrored 2d-on-3d display will need
      to map objects into the same address space multiple times.
      
      Added a GGTT view concept and linked it with the VMA to distinguish between
      multiple instances per address space.
      
      New objects and GEM functions which do not take this new view as a parameter
      assume the default of zero (I915_GGTT_VIEW_NORMAL) which preserves the
      previous behaviour.
      
      This now means that objects can have multiple VMA entries so the code which
      assumed there will only be one also had to be modified.
      
      Alternative GGTT views are supposed to borrow DMA addresses from obj->pages
      which is DMA mapped on first VMA instantiation and unmapped on the last one
      going away.
      
      v2:
          * Removed per view special casing in i915_gem_ggtt_prepare /
            finish_object in favour of creating and destroying DMA mappings
            on first VMA instantiation and last VMA destruction. (Daniel Vetter)
          * Simplified i915_vma_unbind which does not need to count the GGTT views.
            (Daniel Vetter)
          * Also moved obj->map_and_fenceable reset under the same check.
          * Checkpatch cleanups.
      
      v3:
          * Only retire objects once the last VMA is unbound.
      
      v4:
          * Keep scatter-gather table for alternative views persistent for the
            lifetime of the VMA.
          * Propagate binding errors to callers and handle appropriately.
      
      v5:
          * Explicitly look for normal GGTT view in i915_gem_obj_bound to align
            usage in i915_gem_object_ggtt_unpin. (Michel Thierry)
          * Change to single if statement in i915_gem_obj_to_ggtt. (Michel Thierry)
          * Removed stray semi-colon in i915_gem_object_set_cache_level.
      
      For: VIZ-4544
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NMichel Thierry <michel.thierry@intel.com>
      [danvet: Drop hunk from i915_gem_shrink since it's just prettification
      but upsets a __must_check warning.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      fe14d5f4
    • D
      drm/i915: Use BUILD_BUG if possible in the i915 WARN_ON · 5f77eeb0
      Daniel Vetter 提交于
      Faster feedback to errors is always better. This is inspired by the
      addition to WARN_ONs to mask/enable helpers for registers to make sure
      callers have the arguments ordered correctly: Pretty much always the
      arguments are static.
      
      We use WARN_ON(1) a lot in default switch statements though where we
      should always handle all cases. So add a new macro specifically for
      that.
      
      The idea to use __builtin_constant_p is from Chris Wilson.
      
      v2: Use the ({}) gcc-ism to avoid the static inline, suggested by
      Dave. My first attempt used __cond as the temp var, which is the same
      used by BUILD_BUG_ON, but with inverted sense. Hilarity ensued, so
      sprinkle i915 into the name.
      
      Also use a temporary variable to only evaluate the condition once,
      suggested by Damien.
      
      v3: It's crazy but apparently 32bit gcc can't compile out the
      BUILD_BUG_ON in a lot of cases and just falls over. I have no idea
      why, but until clue grows just disable this nifty idea on 32bit
      builds. Reported by 0-day builder.
      
      v4: Got it all wrong, apparently its the gcc version. We need 4.9+.
      Now reported by Imre.
      
      v5: Chris suggested to add the case to MISSING_CASE for speedier
      debug.
      
      v6: Even some gcc 4.9 versions don't see through the maze, so give up
      for now. Keep the skeleton and MISSING_CASE stuff though.
      
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Damien Lespiau <damien.lespiau@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Dave Gordon <david.s.gordon@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      5f77eeb0
  11. 04 12月, 2014 1 次提交
  12. 20 11月, 2014 1 次提交
  13. 15 11月, 2014 2 次提交
  14. 14 11月, 2014 2 次提交
  15. 08 11月, 2014 1 次提交
  16. 07 11月, 2014 1 次提交
    • R
      drm/i915: Disable caches for Global GTT. · d6a8b72e
      Rodrigo Vivi 提交于
      Global GTT doesn't have pat_sel[2:0] so it always point to pat_sel = 000;
      So the only way to avoid screen corruptions is setting PAT 0 to Uncached.
      
      MOCS can still be used though. But if userspace is trusting PTE for
      cache selection the safest thing to do is to let caches disabled.
      
      BSpec: "For GGTT, there is NO pat_sel[2:0] from the entry,
      so RTL will always use the value corresponding to pat_sel = 000"
      
      - System agent ggtt writes (i.e. cpu gtt mmaps) already work before
      this patch, i.e. the same uncached + snooping access like on gen6/7
      seems to be in effect.
      - So this just fixes blitter/render access. Again it looks like it's
      not just uncached access, but uncached + snooping. So we can still
      hold onto all our assumptions wrt cpu clflushing on LLC machines.
      
      v2: Cleaner patch as suggested by Chris.
      v3: Add Daniel's comment
      
      Reference: https://bugs.freedesktop.org/show_bug.cgi?id=85576
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: James Ausmus <james.ausmus@intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: Stable@vger.kernel.org
      Tested-by: NJames Ausmus <james.ausmus@intel.com>
      Reviewed-by: NJames Ausmus <james.ausmus@intel.com>
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      d6a8b72e
  17. 04 11月, 2014 1 次提交
  18. 24 10月, 2014 1 次提交
  19. 29 9月, 2014 1 次提交
  20. 24 9月, 2014 3 次提交
  21. 19 9月, 2014 3 次提交
  22. 03 9月, 2014 1 次提交