1. 04 10月, 2019 1 次提交
    • 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
  2. 25 9月, 2019 1 次提交
  3. 31 8月, 2019 1 次提交
  4. 27 8月, 2019 1 次提交
  5. 09 8月, 2019 1 次提交
  6. 08 8月, 2019 1 次提交
  7. 06 8月, 2019 1 次提交
  8. 31 7月, 2019 1 次提交
  9. 29 7月, 2019 3 次提交
  10. 26 7月, 2019 1 次提交
  11. 19 7月, 2019 1 次提交
  12. 17 7月, 2019 1 次提交
  13. 10 7月, 2019 2 次提交
  14. 27 6月, 2019 1 次提交
  15. 25 6月, 2019 1 次提交
  16. 14 6月, 2019 1 次提交
  17. 12 6月, 2019 1 次提交
  18. 10 6月, 2019 1 次提交
  19. 28 5月, 2019 2 次提交
  20. 27 4月, 2019 2 次提交
  21. 25 4月, 2019 2 次提交
  22. 24 4月, 2019 1 次提交
  23. 27 3月, 2019 1 次提交
  24. 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
  25. 21 3月, 2019 1 次提交
  26. 14 3月, 2019 1 次提交
    • R
      drm/i915/gen11+: First assume next platforms will inherit stuff · 2dd24a9c
      Rodrigo Vivi 提交于
      This exactly same approach was already used from gen9
      to gen10 and from gen10 to gen11. Let's also use it
      for gen11+.
      
      Let's first assume that we inherit a similar platform
      and than we apply the differences on top.
      
      Different from the previous attempts this will be
      done this time with coccinelle. We obviously need to
      exclude some case that is really exclusive for gen11
      like  PCH, Firmware, and few others. Luckly this was
      easy to filter by selecting the files we are touching
      with coccinelle as exposed below:
      
      spatch -sp_file gen11\+.cocci --in-place i915_perf.c \
             intel_bios.c intel_cdclk.c intel_ddi.c \
             intel_device_info.c intel_display.c intel_dpll_mgr.c \
             intel_dsi_vbt.c intel_hdmi.c intel_mocs.c intel_color.c
      
      @noticelake@ expression e; @@
      -!IS_ICELAKE(e)
      +INTEL_GEN(e) < 11
      @notgen11@ expression e; @@
      -!IS_GEN(e, 11)
      +INTEL_GEN(e) < 11
      @icelake@ expression e; @@
      -IS_ICELAKE(e)
      +INTEL_GEN(e) >= 11
      @gen11@ expression e; @@
      -IS_GEN(e, 11)
      +INTEL_GEN(e) >= 11
      
      No functional change.
      
      v2: Remove intel_lrc.c per Tvrtko request since those were w/a
          for ICL hw issuea and media related configuration.
      
      Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Cc: Lucas De Marchi <lucas.demarchi@intel.com>
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Reviewed-by: NLucas De Marchi <lucas.demarchi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190308214300.25057-1-rodrigo.vivi@intel.com
      2dd24a9c
  27. 08 3月, 2019 1 次提交
  28. 06 3月, 2019 2 次提交
  29. 05 3月, 2019 1 次提交
  30. 05 2月, 2019 1 次提交
    • L
      drm/i915/perf: lock powergating configuration to default when active · ec431eae
      Lionel Landwerlin 提交于
      If some of the contexts submitting workloads to the GPU have been
      configured to shutdown slices/subslices, we might loose the NOA
      configurations written in the NOA muxes.
      
      One possible solution to this problem is to reprogram the NOA muxes
      when we switch to a new context. We initially tried this in the
      workaround batchbuffer but some concerns where raised about the cost
      of reprogramming at every context switch. This solution is also not
      without consequences from the userspace point of view. Reprogramming
      of the muxes can only happen once the powergating configuration has
      changed (which happens after context switch). This means for a window
      of time during the recording, counters recorded by the OA unit might
      be invalid. This requires userspace dealing with OA reports to discard
      the invalid values.
      
      Minimizing the reprogramming could be implemented by tracking of the
      last programmed configuration somewhere in GGTT and use MI_PREDICATE
      to discard some of the programming commands, but the command streamer
      would still have to parse all the MI_LRI instructions in the
      workaround batchbuffer.
      
      Another solution, which this change implements, is to simply disregard
      the user requested configuration for the period of time when i915/perf
      is active.
      
      On most platforms there are no issues with this apart from a performance
      penality for some media workloads that benefit from running on a partially
      powergated GPU. We already prevent RC6 from affecting the programming so
      it doesn't sound completely unreasonable to hold on powergating for the
      same reason.
      
      On Icelake however there would a functional problem if the slices not-
      containing the VME block were left enabled with a running media workload
      which explicitly disabled them. To avoid a GPU hang in this case, on
      Icelake we lock the enablement to only slices which contain VME blocks.
      Downside is that it means degraded GPU performance when OA is active but
      there is no known alternative solution for this.
      
      v2: Leave RPCS programming in intel_lrc.c (Lionel)
      
      v3: Update for s/union intel_sseu/struct intel_sseu/ (Lionel)
          More to_intel_context() (Tvrtko)
          s/dev_priv/i915/ (Tvrtko)
      
      Tvrtko Ursulin:
      
      v4:
       * Rebase for make_rpcs changes.
      
      v5:
       * Apply OA restriction from make_rpcs directly.
      
      v6:
       * Rebase for context image setup changes.
      
      v7:
       * Move stream assignment before metric enable.
      
      v8-9:
       * Rebase.
      
      v10:
       * Squashed with ICL support patch.
      
      Bspec: 21140
      Co-developed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Signed-off-by: NLionel Landwerlin <lionel.g.landwerlin@intel.com>
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
      Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> # v9
      Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190205095032.22673-2-tvrtko.ursulin@linux.intel.com
      ec431eae
  31. 17 1月, 2019 1 次提交
  32. 15 1月, 2019 2 次提交