1. 02 Dec, 2019 21 commits
  2. 01 Dec, 2019 1 commit
  3. 30 Nov, 2019 4 commits
  4. 29 Nov, 2019 8 commits
  5. 28 Nov, 2019 4 commits
  6. 27 Nov, 2019 2 commits
    • Chris Wilson's avatar
      drm/i915/gt: Defer breadcrumb processing to after the irq handler · e3f3a0f2
      Chris Wilson authored
      The design of our interrupt handlers is that we ack the receipt of the
      interrupt first, inside the critical section where the master interrupt
      control is off and other cpus cannot start processing the next
      interrupt; and then process the interrupt events afterwards. However,
      Icelake introduced a whole new set of banked GT_IIR that are inherently
      serialised and slow to retrieve the IIR and must be processed within the
      critical section. We can still push our breadcrumbs out of this critical
      section by using our irq_worker. On bdw+, this should not make too much
      of a difference as we only slightly defer the breadcrumbs, but on icl+
      this should make a big difference to our throughput of interrupts from
      concurrently executing engines.
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191127115813.3345823-1-chris@chris-wilson.co.uk
      e3f3a0f2
    • Chris Wilson's avatar
      drm/i915: Serialise i915_active_fence_set() with itself · df9f85d8
      Chris Wilson authored
      The expected downside to commit 58b4c1a0 ("drm/i915: Reduce nested
      prepare_remote_context() to a trylock") was that it would need to return
      -EAGAIN to userspace in order to resolve potential mutex inversion. Such
      an unsightly round trip is unnecessary if we could atomically insert a
      barrier into the i915_active_fence, so make it happen.
      
      Currently, we use the timeline->mutex (or some other named outer lock)
      to order insertion into the i915_active_fence (and so individual nodes
      of i915_active). Inside __i915_active_fence_set, we only need then
      serialise with the interrupt handler in order to claim the timeline for
      ourselves.
      
      However, if we remove the outer lock, we need to ensure the order is
      intact between not only multiple threads trying to insert themselves
      into the timeline, but also with the interrupt handler completing the
      previous occupant. We use xchg() on insert so that we have an ordered
      sequence of insertions (and each caller knows the previous fence on
      which to wait, preserving the chain of all fences in the timeline), but
      we then have to cmpxchg() in the interrupt handler to avoid overwriting
      the new occupant. The only nasty side-effect is having to temporarily
      strip off the RCU-annotations to apply the atomic operations, otherwise
      the rules are much more conventional!
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=112402
      Fixes: 58b4c1a0 ("drm/i915: Reduce nested prepare_remote_context() to a trylock")
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191127134527.3438410-1-chris@chris-wilson.co.uk
      df9f85d8