1. 12 10月, 2019 2 次提交
  2. 11 10月, 2019 2 次提交
  3. 08 10月, 2019 3 次提交
  4. 04 10月, 2019 3 次提交
    • C
      drm/i915: Move context management under GEM · a4e7ccda
      Chris Wilson 提交于
      Keep track of the GEM contexts underneath i915->gem.contexts and assign
      them their own lock for the purposes of list management.
      
      v2: Focus on lock tracking; ctx->vm is protected by ctx->mutex
      v3: Correct split with removal of logical HW ID
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191004134015.13204-15-chris@chris-wilson.co.uk
      a4e7ccda
    • C
      drm/i915: Remove logical HW ID · 2935ed53
      Chris Wilson 提交于
      With the introduction of ctx->engines[] we allow multiple logical
      contexts to be used on the same engine (e.g. with virtual engines).
      According to bspec, aach logical context requires a unique tag in order
      for context-switching to occur correctly between them. [Simple
      experiments show that it is not so easy to trick the HW into performing
      a lite-restore with matching logical IDs, though my memory from early
      Broadwell experiments do suggest that it should be generating
      lite-restores.]
      
      We only need to keep a unique tag for the active lifetime of the
      context, and for as long as we need to identify that context. The HW
      uses the tag to determine if it should use a lite-restore (why not the
      LRCA?) and passes the tag back for various status identifies. The only
      status we need to track is for OA, so when using perf, we assign the
      specific context a unique tag.
      
      v2: Calculate required number of tags to fill ELSP.
      
      Fixes: 976b55f0 ("drm/i915: Allow a context to define its set of engines")
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111895Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Acked-by: NDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191004134015.13204-14-chris@chris-wilson.co.uk
      2935ed53
    • C
      drm/i915: Pull i915_vma_pin under the vm->mutex · 2850748e
      Chris Wilson 提交于
      Replace the struct_mutex requirement for pinning the i915_vma with the
      local vm->mutex instead. Note that the vm->mutex is tainted by the
      shrinker (we require unbinding from inside fs-reclaim) and so we cannot
      allocate while holding that mutex. Instead we have to preallocate
      workers to do allocate and apply the PTE updates after we have we
      reserved their slot in the drm_mm (using fences to order the PTE writes
      with the GPU work and with later unbind).
      
      In adding the asynchronous vma binding, one subtle requirement is to
      avoid coupling the binding fence into the backing object->resv. That is
      the asynchronous binding only applies to the vma timeline itself and not
      to the pages as that is a more global timeline (the binding of one vma
      does not need to be ordered with another vma, nor does the implicit GEM
      fencing depend on a vma, only on writes to the backing store). Keeping
      the vma binding distinct from the backing store timelines is verified by
      a number of async gem_exec_fence and gem_exec_schedule tests. The way we
      do this is quite simple, we keep the fence for the vma binding separate
      and only wait on it as required, and never add it to the obj->resv
      itself.
      
      Another consequence in reducing the locking around the vma is the
      destruction of the vma is no longer globally serialised by struct_mutex.
      A natural solution would be to add a kref to i915_vma, but that requires
      decoupling the reference cycles, possibly by introducing a new
      i915_mm_pages object that is own by both obj->mm and vma->pages.
      However, we have not taken that route due to the overshadowing lmem/ttm
      discussions, and instead play a series of complicated games with
      trylocks to (hopefully) ensure that only one destruction path is called!
      
      v2: Add some commentary, and some helpers to reduce patch churn.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191004134015.13204-4-chris@chris-wilson.co.uk
      2850748e
  5. 25 9月, 2019 1 次提交
  6. 31 8月, 2019 1 次提交
  7. 27 8月, 2019 1 次提交
  8. 09 8月, 2019 1 次提交
  9. 08 8月, 2019 1 次提交
  10. 06 8月, 2019 1 次提交
  11. 31 7月, 2019 1 次提交
  12. 29 7月, 2019 3 次提交
  13. 26 7月, 2019 1 次提交
  14. 19 7月, 2019 1 次提交
  15. 17 7月, 2019 1 次提交
  16. 10 7月, 2019 2 次提交
  17. 27 6月, 2019 1 次提交
  18. 25 6月, 2019 1 次提交
  19. 14 6月, 2019 1 次提交
  20. 12 6月, 2019 1 次提交
  21. 10 6月, 2019 1 次提交
  22. 28 5月, 2019 2 次提交
  23. 27 4月, 2019 2 次提交
  24. 25 4月, 2019 2 次提交
  25. 24 4月, 2019 1 次提交
  26. 27 3月, 2019 1 次提交
  27. 22 3月, 2019 1 次提交
    • C
      drm/i915: Flush pages on acquisition · a679f58d
      Chris Wilson 提交于
      When we return pages to the system, we ensure that they are marked as
      being in the CPU domain since any external access is uncontrolled and we
      must assume the worst. This means that we need to always flush the pages
      on acquisition if we need to use them on the GPU, and from the beginning
      have used set-domain. Set-domain is overkill for the purpose as it is a
      general synchronisation barrier, but our intent is to only flush the
      pages being swapped in. If we move that flush into the pages acquisition
      phase, we know then that when we have obj->mm.pages, they are coherent
      with the GPU and need only maintain that status without resorting to
      heavy handed use of set-domain.
      
      The principle knock-on effect for userspace is through mmap-gtt
      pagefaulting. Our uAPI has always implied that the GTT mmap was async
      (especially as when any pagefault occurs is unpredicatable to userspace)
      and so userspace had to apply explicit domain control itself
      (set-domain). However, swapping is transparent to the kernel, and so on
      first fault we need to acquire the pages and make them coherent for
      access through the GTT. Our use of set-domain here leaks into the uABI
      that the first pagefault was synchronous. This is unintentional and
      baring a few igt should be unoticed, nevertheless we bump the uABI
      version for mmap-gtt to reflect the change in behaviour.
      
      Another implication of the change is that gem_create() is presumed to
      create an object that is coherent with the CPU and is in the CPU write
      domain, so a set-domain(CPU) following a gem_create() would be a minor
      operation that merely checked whether we could allocate all pages for
      the object. On applying this change, a set-domain(CPU) causes a clflush
      as we acquire the pages. This will have a small impact on mesa as we move
      the clflush here on !llc from execbuf time to create, but that should
      have minimal performance impact as the same clflush exists but is now
      done early and because of the clflush issue, userspace recycles bo and
      so should resist allocating fresh objects.
      
      Internally, the presumption that objects are created in the CPU
      write-domain and remain so through writes to obj->mm.mapping is more
      prevalent than I expected; but easy enough to catch and apply a manual
      flush.
      
      For the future, we should push the page flush from the central
      set_pages() into the callers so that we can more finely control when it
      is applied, but for now doing it one location is easier to validate, at
      the cost of sometimes flushing when there is no need.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Matthew Auld <matthew.william.auld@gmail.com>
      Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Cc: Antonio Argenziano <antonio.argenziano@intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Reviewed-by: NMatthew Auld <matthew.william.auld@gmail.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190321161908.8007-1-chris@chris-wilson.co.uk
      a679f58d
  28. 21 3月, 2019 1 次提交