1. 27 Mar, 2015 6 commits
    • Michel Thierry's avatar
      drm/i915: Finish gen6/7 dynamic page table allocation · 4933d519
      Michel Thierry authored
      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: default avatarBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: Michel Thierry <michel.thierry@intel.com> (v4+)
      Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      4933d519
    • Michel Thierry's avatar
      drm/i915: Remove unnecessary gen6_ppgtt_unmap_pages · 59568eb5
      Michel Thierry authored
      We are already unmapping them in gen6_ppgtt_free. This function became
      redundant since commit 06fda602
      ("drm/i915: Create page table allocators").
      
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: default avatarMichel Thierry <michel.thierry@intel.com>
      Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      59568eb5
    • Michel Thierry's avatar
      drm/i915: Fix i915_dma_map_single positive error code · 1266cdb1
      Michel Thierry authored
      i915_dma_map_single relies on dma_mapping_error, which returns positive
      error codes. Found by static checker.
      
      Introduced by commit 678d96fb
      ("drm/i915: Track GEN6 page table usage").
      
      v2: Return negative error code and renamed commit title. (Dan)
      v3: Missing reported-by tag (Daniel)
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Cc: Dan Carpenter <dan.carpenter@oracle.com>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarMichel Thierry <michel.thierry@intel.com>
      Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      1266cdb1
    • Michel Thierry's avatar
      drm/i915: Prevent out of range pt in gen6_for_each_pde · fdc454c1
      Michel Thierry authored
      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: default avatarMichel Thierry <michel.thierry@intel.com>
      Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      fdc454c1
    • Tommi Rantala's avatar
      drm/i915: fix definition of the DRM_IOCTL_I915_GET_SPRITE_COLORKEY ioctl · 2c60fae1
      Tommi Rantala authored
      Fix definition of the DRM_IOCTL_I915_GET_SPRITE_COLORKEY ioctl, so that it
      is different from the DRM_IOCTL_I915_SET_SPRITE_COLORKEY ioctl.
      
      Note that this is just for accuracy, the ioctl implementation itself is totally
      unused and already ripped out.
      Signed-off-by: default avatarTommi Rantala <tt.rantala@gmail.com>
      [danvet: Add note that this is a dead ioctl.]
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      2c60fae1
    • Daniel Vetter's avatar
      drm/i915: Rip out GET_SPRITE_COLORKEY ioctl · a8265c59
      Daniel Vetter authored
      It's completely unused and Tommi noticed that the #define is borked
      since forever. I've done a git search in userspace and only found
      broken definitions and no users anywhere.
      
      Cc: Tommi Rantala <tt.rantala@gmail.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      a8265c59
  2. 26 Mar, 2015 20 commits
  3. 25 Mar, 2015 3 commits
  4. 24 Mar, 2015 3 commits
  5. 23 Mar, 2015 8 commits