1. 19 11月, 2020 1 次提交
  2. 18 11月, 2020 1 次提交
  3. 09 11月, 2020 1 次提交
  4. 04 11月, 2020 2 次提交
  5. 03 11月, 2020 1 次提交
  6. 23 10月, 2020 1 次提交
    • C
      drm/i915/gt: Use the local HWSP offset during submission · c10f6019
      Chris Wilson 提交于
      We wrap the timeline on construction of the next request, but there may
      still be requests in flight that have not yet finalized the breadcrumb.
      (The breadcrumb is delayed as we need engine-local offsets, and for the
      virtual engine that is not known until execution.) As such, by the time
      we write to the timeline's HWSP offset it may have changed, and we
      should use the value we preserved in the request instead.
      
      Though the window is small and infrequent (at full flow we can expect a
      timeline's seqno to wrap once every 30 minutes), the impact of writing
      the old seqno into the new HWSP is severe: the old requests are never
      completed, and the new requests are completed before they are even
      submitted.
      
      Fixes: ebece753 ("drm/i915: Keep timeline HWSP allocated until idle across the system")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: <stable@vger.kernel.org> # v5.2+
      Reviewed-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20201022064127.10159-1-chris@chris-wilson.co.uk
      c10f6019
  7. 20 10月, 2020 4 次提交
  8. 16 10月, 2020 3 次提交
    • C
      drm/i915/gt: Confirm the context survives execution · 89db9537
      Chris Wilson 提交于
      Repeat our sanitychecks from before execution to after execution. One
      expects that if we were to see these, the gpu would already be on fire,
      but the timing may be informative.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20201015190816.31763-1-chris@chris-wilson.co.uk
      89db9537
    • C
      drm/i915/gt: Undo forced context restores after trivial preemptions · bb65548e
      Chris Wilson 提交于
      We may try to preempt the currently executing request, only to find that
      after unravelling all the dependencies that the original executing
      context is still the earliest in the topological sort and re-submitted
      back to HW (if we do detect some change in the ELSP that requires
      re-submission). However, due to the way we check for wrap-around during
      the unravelling, we mark any context that has been submitted just once
      (i.e. with the rq->wa_tail set, but the ring->tail earlier) as
      potentially wrapping and requiring a forced restore on resubmission.
      This was expected to be not a problem, as it was anticipated that most
      unwinding for preemption would result in a context switch and the few
      that did not would be lost in the noise. It did not take long for
      someone to find one particular workload where the cost of those extra
      context restores was measurable.
      
      However, since we know the wa_tail is of fixed size, and we know that a
      request must be larger than the wa_tail itself, we can safely maintain
      the check for request wrapping and check against a slightly future point
      in the ring that includes an expected wa_tail. (That is if the
      ring->tail is already set to rq->wa_tail, including another 8 bytes in
      the check does not invalidate the incremental wrap detection.)
      
      Fixes: 8ab3a381 ("drm/i915/gt: Incrementally check for rewinding")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Bruce Chang <yu.bruce.chang@intel.com>
      Cc: Ramalingam C <ramalingam.c@intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: <stable@vger.kernel.org> # v5.4+
      Reviewed-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20201002083425.4605-1-chris@chris-wilson.co.uk
      bb65548e
    • C
      drm/i915/gt: Delay execlist processing for tgl · 6ca7217d
      Chris Wilson 提交于
      When running gem_exec_nop, it floods the system with many requests (with
      the goal of userspace submitting faster than the HW can process a single
      empty batch). This causes the driver to continually resubmit new
      requests onto the end of an active context, a flood of lite-restore
      preemptions. If we time this just right, Tigerlake hangs.
      
      Inserting a small delay between the processing of CS events and
      submitting the next context, prevents the hang. Naturally it does not
      occur with debugging enabled. The suspicion then is that this is related
      to the issues with the CS event buffer, and inserting an mmio read of
      the CS pointer status appears to be very successful in preventing the
      hang. Other registers, or uncached reads, or plain mb, do not prevent
      the hang, suggesting that register is key -- but that the hang can be
      prevented by a simple udelay, suggests it is just a timing issue like
      that encountered by commit 233c1ae3 ("drm/i915/gt: Wait for CSB
      entries on Tigerlake"). Also note that the hang is not prevented by
      applying CTX_DESC_FORCE_RESTORE, or by inserting a delay on the GPU
      between requests.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Bruce Chang <yu.bruce.chang@intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: stable@vger.kernel.org
      Acked-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20201015195023.32346-1-chris@chris-wilson.co.uk
      6ca7217d
  9. 01 10月, 2020 1 次提交
  10. 18 9月, 2020 1 次提交
  11. 16 9月, 2020 1 次提交
    • C
      drm/i915: Be wary of data races when reading the active execlists · b82a8b93
      Chris Wilson 提交于
      To implement preempt-to-busy (and so efficient timeslicing and best utilization
      of the hardware submission ports) we let the GPU run asynchronously in respect
      to the ELSP submission queue. This created challenges in keeping and accessing
      the driver state mirroring the asynchronous GPU execution.
      
      The latest occurence of this was spotted by KCSAN:
      
      [ 1413.563200] BUG: KCSAN: data-race in __await_execution+0x217/0x370 [i915]
      [ 1413.563221]
      [ 1413.563236] race at unknown origin, with read to 0xffff88885bb6c478 of 8 bytes by task 9654 on cpu 1:
      [ 1413.563548]  __await_execution+0x217/0x370 [i915]
      [ 1413.563891]  i915_request_await_dma_fence+0x4eb/0x6a0 [i915]
      [ 1413.564235]  i915_request_await_object+0x421/0x490 [i915]
      [ 1413.564577]  i915_gem_do_execbuffer+0x29b7/0x3c40 [i915]
      [ 1413.564967]  i915_gem_execbuffer2_ioctl+0x22f/0x5c0 [i915]
      [ 1413.564998]  drm_ioctl_kernel+0x156/0x1b0
      [ 1413.565022]  drm_ioctl+0x2ff/0x480
      [ 1413.565046]  __x64_sys_ioctl+0x87/0xd0
      [ 1413.565069]  do_syscall_64+0x4d/0x80
      [ 1413.565094]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      To complicate matters, we have to both avoid the read tearing of *active and
      avoid any write tearing as perform the pending[] -> inflight[] promotion of the
      execlists.
      
      This is because we cannot rely on the memcpy doing u64 aligned copies on all
      kernels/platforms and so we opt to open-code it with explicit WRITE_ONCE
      annotations to satisfy KCSAN.
      
      v2: When in doubt, write the same comment again.
      v3: Expanded commit message.
      
      Fixes: b55230e5 ("drm/i915: Check for awaits on still currently executing requests")
      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/20200716142207.13003-1-chris@chris-wilson.co.ukSigned-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      [Joonas: Rebased and reordered into drm-intel-gt-next branch]
      [Joonas: Added expanded commit message from Tvrtko and Chris]
      Signed-off-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      (cherry picked from commit b4d9145b)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      b82a8b93
  12. 15 9月, 2020 4 次提交
  13. 07 9月, 2020 9 次提交
  14. 18 8月, 2020 1 次提交
  15. 17 7月, 2020 1 次提交
  16. 15 7月, 2020 2 次提交
  17. 14 7月, 2020 1 次提交
  18. 13 7月, 2020 2 次提交
  19. 10 7月, 2020 1 次提交
  20. 09 7月, 2020 2 次提交