1. 11 6月, 2019 2 次提交
  2. 28 5月, 2019 5 次提交
  3. 27 4月, 2019 1 次提交
  4. 22 3月, 2019 2 次提交
    • C
      drm/i915: Create/destroy VM (ppGTT) for use with contexts · e0695db7
      Chris Wilson 提交于
      In preparation to making the ppGTT binding for a context explicit (to
      facilitate reusing the same ppGTT between different contexts), allow the
      user to create and destroy named ppGTT.
      
      v2: Replace global barrier for swapping over the ppgtt and tlbs with a
      local context barrier (Tvrtko)
      v3: serialise with struct_mutex; it's lazy but required dammit
      v4: Rewrite igt_ctx_shared_exec to be more different (aimed to be more
      similarly, turned out different!)
      
      v5: Fix up test unwind for aliasing-ppgtt (snb)
      v6: Tighten language for uapi struct drm_i915_gem_vm_control.
      v7: Patch the context image for runtime ppgtt switching!
      
      Testcase: igt/gem_vm_create
      Testcase: igt/gem_ctx_param/vm
      Testcase: igt/gem_ctx_clone/vm
      Testcase: igt/gem_ctx_shared
      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/20190322092325.5883-2-chris@chris-wilson.co.uk
      e0695db7
    • 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
  5. 21 3月, 2019 1 次提交
  6. 15 3月, 2019 3 次提交
  7. 06 3月, 2019 1 次提交
  8. 28 2月, 2019 1 次提交
  9. 21 2月, 2019 1 次提交
  10. 18 1月, 2019 1 次提交
  11. 15 1月, 2019 2 次提交
  12. 08 1月, 2019 1 次提交
  13. 05 12月, 2018 1 次提交
  14. 06 11月, 2018 1 次提交
  15. 31 10月, 2018 1 次提交
  16. 26 10月, 2018 1 次提交
  17. 27 9月, 2018 1 次提交
  18. 20 9月, 2018 1 次提交
  19. 07 8月, 2018 1 次提交
  20. 17 7月, 2018 1 次提交
  21. 07 7月, 2018 3 次提交
  22. 06 7月, 2018 1 次提交
  23. 05 7月, 2018 1 次提交
    • C
      drm/i915/gtt: Pull global wc page stash under its own locking · 63fd659f
      Chris Wilson 提交于
      Currently, the wc-stash used for providing flushed WC pages ready for
      constructing the page directories is assumed to be protected by the
      struct_mutex. However, we want to remove this global lock and so must
      install a replacement global lock for accessing the global wc-stash (the
      per-vm stash continues to be guarded by the vm).
      
      We need to push ahead on this patch due to an oversight in hastily
      removing the struct_mutex guard around the igt_ppgtt_alloc selftest. No
      matter, it will prove very useful (i.e. will be required) in the near
      future.
      
      v2: Restore the onstack stash so that we can drop the vm->mutex in
      future across the allocation.
      v3: Restore the lost pagevec_init of the onstack allocation, and repaint
      function names.
      v4: Reorder init so that we don't try and use i915_address_space before
      it is ininitialised.
      
      Fixes: 1f6f0023 ("drm/i915/selftests: Drop struct_mutex around lowlevel pggtt allocation")
      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/20180704185518.4193-1-chris@chris-wilson.co.uk
      63fd659f
  24. 29 6月, 2018 1 次提交
  25. 14 6月, 2018 1 次提交
  26. 06 6月, 2018 1 次提交
  27. 13 5月, 2018 1 次提交
  28. 04 5月, 2018 1 次提交
    • C
      drm/i915: Lazily unbind vma on close · 3365e226
      Chris Wilson 提交于
      When userspace is passing around swapbuffers using DRI, we frequently
      have to open and close the same object in the foreign address space.
      This shows itself as the same object being rebound at roughly 30fps
      (with a second object also being rebound at 30fps), which involves us
      having to rewrite the page tables and maintain the drm_mm range manager
      every time.
      
      However, since the object still exists and it is only the local handle
      that disappears, if we are lazy and do not unbind the VMA immediately
      when the local user closes the object but defer it until the GPU is
      idle, then we can reuse the same VMA binding. We still have to be
      careful to mark the handle and lookup tables as closed to maintain the
      uABI, just allowing the underlying VMA to be resurrected if the user is
      able to access the same object from the same context again.
      
      If the object itself is destroyed (neither userspace keeping a handle to
      it), the VMA will be reaped immediately as usual.
      
      In the future, this will be even more useful as instantiating a new VMA
      for use on the GPU will become heavier. A nuisance indeed, so nip it in
      the bud.
      
      v2: s/__i915_vma_final_close/i915_vma_destroy/ etc.
      v3: Leave a hint as to why we deferred the unbind on close.
      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/20180503195115.22309-1-chris@chris-wilson.co.uk
      3365e226
  29. 22 2月, 2018 1 次提交