1. 25 2月, 2015 1 次提交
    • 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
  2. 14 2月, 2015 4 次提交
  3. 18 12月, 2014 2 次提交
  4. 16 12月, 2014 1 次提交
  5. 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
  6. 04 12月, 2014 1 次提交
  7. 20 11月, 2014 1 次提交
  8. 15 11月, 2014 2 次提交
  9. 14 11月, 2014 2 次提交
  10. 08 11月, 2014 1 次提交
  11. 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
  12. 04 11月, 2014 1 次提交
  13. 24 10月, 2014 1 次提交
  14. 29 9月, 2014 1 次提交
  15. 24 9月, 2014 3 次提交
  16. 19 9月, 2014 3 次提交
  17. 03 9月, 2014 3 次提交
  18. 20 8月, 2014 1 次提交
    • O
      drm/i915/bdw: Don't write PDP in the legacy way when using LRCs · b7c71823
      Oscar Mateo 提交于
      This is mostly for correctness so that we know we are running the LR
      context correctly (this is, the PDPs are contained inside the context
      object).
      
      v2: Move the check to inside the enable PPGTT function. The switch
      happens in two places: the legacy context switch (that we won't hit
      when Execlists are enabled) and the PPGTT enable, which unfortunately
      we need. This would look much nicer if the ppgtt->enable was part of
      the ring init, where it logically belongs.
      
      v3: Move the check to the start of the enable PPGTT function.  None
      of the legacy PPGTT enabling is required when using LRCs as the
      PPGTT is enabled in the context descriptor and the PDPs are written
      in the LRC.
      
      v4: Clarify comment based on review feedback.
      Signed-off-by: NOscar Mateo <oscar.mateo@intel.com>
      Signed-off-by: NThomas Daniel <thomas.daniel@intel.com>
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      [danvet: Resolve conflicts with ppgtt_enable rework.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b7c71823
  19. 13 8月, 2014 8 次提交