1. 05 7月, 2016 1 次提交
  2. 04 7月, 2016 3 次提交
  3. 03 7月, 2016 1 次提交
  4. 02 7月, 2016 2 次提交
    • C
      drm/i915: Use HWS for seqno tracking everywhere · 1b7744e7
      Chris Wilson 提交于
      By using the same address for storing the HWS on every platform, we can
      remove the platform specific vfuncs and reduce the get-seqno routine to
      a single read of a cached memory location.
      
      v2: Fix semaphore_passed() to look at the signaling engine (not the
      waiter's)
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1467390209-3576-8-git-send-email-chris@chris-wilson.co.uk
      1b7744e7
    • C
      drm/i915: Slaughter the thundering i915_wait_request herd · 688e6c72
      Chris Wilson 提交于
      One particularly stressful scenario consists of many independent tasks
      all competing for GPU time and waiting upon the results (e.g. realtime
      transcoding of many, many streams). One bottleneck in particular is that
      each client waits on its own results, but every client is woken up after
      every batchbuffer - hence the thunder of hooves as then every client must
      do its heavyweight dance to read a coherent seqno to see if it is the
      lucky one.
      
      Ideally, we only want one client to wake up after the interrupt and
      check its request for completion. Since the requests must retire in
      order, we can select the first client on the oldest request to be woken.
      Once that client has completed his wait, we can then wake up the
      next client and so on. However, all clients then incur latency as every
      process in the chain may be delayed for scheduling - this may also then
      cause some priority inversion. To reduce the latency, when a client
      is added or removed from the list, we scan the tree for completed
      seqno and wake up all the completed waiters in parallel.
      
      Using igt/benchmarks/gem_latency, we can demonstrate this effect. The
      benchmark measures the number of GPU cycles between completion of a
      batch and the client waking up from a call to wait-ioctl. With many
      concurrent waiters, with each on a different request, we observe that
      the wakeup latency before the patch scales nearly linearly with the
      number of waiters (before external factors kick in making the scaling much
      worse). After applying the patch, we can see that only the single waiter
      for the request is being woken up, providing a constant wakeup latency
      for every operation. However, the situation is not quite as rosy for
      many waiters on the same request, though to the best of my knowledge this
      is much less likely in practice. Here, we can observe that the
      concurrent waiters incur extra latency from being woken up by the
      solitary bottom-half, rather than directly by the interrupt. This
      appears to be scheduler induced (having discounted adverse effects from
      having a rbtree walk/erase in the wakeup path), each additional
      wake_up_process() costs approximately 1us on big core. Another effect of
      performing the secondary wakeups from the first bottom-half is the
      incurred delay this imposes on high priority threads - rather than
      immediately returning to userspace and leaving the interrupt handler to
      wake the others.
      
      To offset the delay incurred with additional waiters on a request, we
      could use a hybrid scheme that did a quick read in the interrupt handler
      and dequeued all the completed waiters (incurring the overhead in the
      interrupt handler, not the best plan either as we then incur GPU
      submission latency) but we would still have to wake up the bottom-half
      every time to do the heavyweight slow read. Or we could only kick the
      waiters on the seqno with the same priority as the current task (i.e. in
      the realtime waiter scenario, only it is woken up immediately by the
      interrupt and simply queues the next waiter before returning to userspace,
      minimising its delay at the expense of the chain, and also reducing
      contention on its scheduler runqueue). This is effective at avoid long
      pauses in the interrupt handler and at avoiding the extra latency in
      realtime/high-priority waiters.
      
      v2: Convert from a kworker per engine into a dedicated kthread for the
      bottom-half.
      v3: Rename request members and tweak comments.
      v4: Use a per-engine spinlock in the breadcrumbs bottom-half.
      v5: Fix race in locklessly checking waiter status and kicking the task on
      adding a new waiter.
      v6: Fix deciding when to force the timer to hide missing interrupts.
      v7: Move the bottom-half from the kthread to the first client process.
      v8: Reword a few comments
      v9: Break the busy loop when the interrupt is unmasked or has fired.
      v10: Comments, unnecessary churn, better debugging from Tvrtko
      v11: Wake all completed waiters on removing the current bottom-half to
      reduce the latency of waking up a herd of clients all waiting on the
      same request.
      v12: Rearrange missed-interrupt fault injection so that it works with
      igt/drv_missed_irq_hang
      v13: Rename intel_breadcrumb and friends to intel_wait in preparation
      for signal handling.
      v14: RCU commentary, assert_spin_locked
      v15: Hide BUG_ON behind the compiler; report on gem_latency findings.
      v16: Sort seqno-groups by priority so that first-waiter has the highest
      task priority (and so avoid priority inversion).
      v17: Add waiters to post-mortem GPU hang state.
      v18: Return early for a completed wait after acquiring the spinlock.
      Avoids adding ourselves to the tree if the is already complete, and
      skips the awkward question of why we don't do completion wakeups for
      waits earlier than or equal to ourselves.
      v19: Prepare for init_breadcrumbs to fail. Later patches may want to
      allocate during init, so be prepared to propagate back the error code.
      
      Testcase: igt/gem_concurrent_blit
      Testcase: igt/benchmarks/gem_latency
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: "Rogozhkin, Dmitry V" <dmitry.v.rogozhkin@intel.com>
      Cc: "Gong, Zhipeng" <zhipeng.gong@intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Cc: Dave Gordon <david.s.gordon@intel.com>
      Cc: "Goel, Akash" <akash.goel@intel.com>
      Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> #v18
      Link: http://patchwork.freedesktop.org/patch/msgid/1467390209-3576-6-git-send-email-chris@chris-wilson.co.uk
      688e6c72
  5. 11 5月, 2016 1 次提交
  6. 09 5月, 2016 1 次提交
  7. 09 4月, 2016 1 次提交
  8. 08 4月, 2016 1 次提交
  9. 07 4月, 2016 1 次提交
  10. 31 3月, 2016 1 次提交
    • J
      drm/i915: Refer to GGTT {,VM} consistently · 72e96d64
      Joonas Lahtinen 提交于
      Refer to the GGTT VM consistently as "ggtt->base" instead of just "ggtt",
      "vm" or indirectly through other variables like "dev_priv->ggtt.base"
      to avoid confusion with the i915_ggtt object itself and PPGTT VMs.
      
      Refer to the GGTT as "ggtt" instead of indirectly through chaining.
      
      As a bonus gets rid of the long-standing i915_obj_to_ggtt vs.
      i915_gem_obj_to_ggtt conflict, due to removal of i915_obj_to_ggtt!
      
      v2:
      - Added some more after grepping sources with Chris
      
      v3:
      - Refer to GGTT VM through ggtt->base consistently instead of ggtt_vm
        (Chris)
      
      v4:
      - Convert all dev_priv->ggtt->foo accesses to ggtt->foo.
      
      v5:
      - Make patch checker happy
      
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      72e96d64
  11. 24 3月, 2016 1 次提交
  12. 22 3月, 2016 1 次提交
  13. 18 3月, 2016 1 次提交
  14. 16 3月, 2016 4 次提交
    • T
      drm/i915: More intel_engine_cs renaming · 666796da
      Tvrtko Ursulin 提交于
      Some trivial ones, first pass done with Coccinelle:
      
      @@
      @@
      (
      - I915_NUM_RINGS
      + I915_NUM_ENGINES
      |
      - intel_ring_flag
      + intel_engine_flag
      |
      - for_each_ring
      + for_each_engine
      |
      - i915_gem_request_get_ring
      + i915_gem_request_get_engine
      |
      - intel_ring_idle
      + intel_engine_idle
      |
      - i915_gem_reset_ring_status
      + i915_gem_reset_engine_status
      |
      - i915_gem_reset_ring_cleanup
      + i915_gem_reset_engine_cleanup
      |
      - init_ring_lists
      + init_engine_lists
      )
      
      But that didn't fully work so I cleaned it up with:
      
      for f in *.[hc]; do sed -i -e s/I915_NUM_RINGS/I915_NUM_ENGINES/ $f; done
      for f in *.[hc]; do sed -i -e s/i915_gem_request_get_ring/i915_gem_request_get_engine/ $f; done
      for f in *.[hc]; do sed -i -e s/intel_ring_flag/intel_engine_flag/ $f; done
      for f in *.[hc]; do sed -i -e s/intel_ring_idle/intel_engine_idle/ $f; done
      for f in *.[hc]; do sed -i -e s/init_ring_lists/init_engine_lists/ $f; done
      for f in *.[hc]; do sed -i -e s/i915_gem_reset_ring_cleanup/i915_gem_reset_engine_cleanup/ $f; done
      for f in *.[hc]; do sed -i -e s/i915_gem_reset_ring_status/i915_gem_reset_engine_status/ $f; done
      
      v2: Rebase.
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      666796da
    • T
      drm/i915: Rename intel_engine_cs struct members · 4a570db5
      Tvrtko Ursulin 提交于
      below and a couple manual fixups.
      
      @@
      identifier I, J;
      @@
      struct I {
      ...
      - struct intel_engine_cs *J;
      + struct intel_engine_cs *engine;
      ...
      }
      @@
      identifier I, J;
      @@
      struct I {
      ...
      - struct intel_engine_cs J;
      + struct intel_engine_cs engine;
      ...
      }
      @@
      struct drm_i915_private *d;
      @@
      (
      - d->ring
      + d->engine
      )
      @@
      struct i915_execbuffer_params *p;
      @@
      (
      - p->ring
      + p->engine
      )
      @@
      struct intel_ringbuffer *r;
      @@
      (
      - r->ring
      + r->engine
      )
      @@
      struct drm_i915_gem_request *req;
      @@
      (
      - req->ring
      + req->engine
      )
      
      v2: Script missed the tracepoint code - fixed up by hand.
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      4a570db5
    • T
      drm/i915: Rename intel_engine_cs function parameters · 0bc40be8
      Tvrtko Ursulin 提交于
      @@
      identifier func;
      @@
      func(..., struct intel_engine_cs *
      - ring
      + engine
      , ...)
      {
      <...
      - ring
      + engine
      ...>
      }
      @@
      identifier func;
      type T;
      @@
      T func(..., struct intel_engine_cs *
      - ring
      + engine
      , ...);
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      0bc40be8
    • T
      drm/i915: Rename local struct intel_engine_cs variables · e2f80391
      Tvrtko Ursulin 提交于
      Done by the Coccinelle script below plus a manual
      intervention to GEN8_RING_SEMAPHORE_INIT.
      
      @@
      expression E;
      @@
      - struct intel_engine_cs *ring = E;
      + struct intel_engine_cs *engine = E;
      <+...
      - ring
      + engine
      ...+>
      @@
      @@
      - struct intel_engine_cs *ring;
      + struct intel_engine_cs *engine;
      <+...
      - ring
      + engine
      ...+>
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      e2f80391
  15. 04 3月, 2016 1 次提交
  16. 01 3月, 2016 1 次提交
  17. 26 2月, 2016 1 次提交
  18. 10 2月, 2016 1 次提交
  19. 21 1月, 2016 1 次提交
  20. 18 11月, 2015 2 次提交
  21. 10 11月, 2015 1 次提交
  22. 26 10月, 2015 1 次提交
  23. 23 10月, 2015 2 次提交
    • T
      drm/i915: Cope with request list state change during error state capture · 9c8e1bdb
      Tomas Elf 提交于
      Since we're not synchronizing the ring request list during error state capture
      the request list state might change between the time the corresponding error
      request list was allocated and dimensioned to the time when the ring request
      list is actually captured into the error state. If this happens then do an
      early exit and be aware that the captured error state might not be fully
      reliable.
      
      * v2:
      - Chris Wilson: Removed WARN_ON from size check since having the error state
        request list and the live driver request list diverge like this is a
        legitimate behaviour.
      
      - Tomas Elf: Removed update of num_request field since this made no sense. Just
        exit and move on.
      
      * v3:
      - Chris Wilson: Removed error message at the point of early exit. The user is
        not interested in any state changes happening during the error state capture,
        only in the state that we're trying to capture at the point of the error.
      Signed-off-by: NTomas Elf <tomas.elf@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      9c8e1bdb
    • D
      Revert "drm/i915: Add soft-pinning API for execbuffer" · bfd7bbdd
      Daniel Vetter 提交于
      This reverts commit 51056723.
      
      I somehow managed to combine a patch from Tomas Elf with a totally
      unrelated commit message from Chris Wilson. Let's revert this and
      reapply properly.
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      bfd7bbdd
  24. 22 10月, 2015 1 次提交
    • C
      drm/i915: Add soft-pinning API for execbuffer · 51056723
      Chris Wilson 提交于
      Userspace can pass in an offset that it presumes the object is located
      at. The kernel will then do its utmost to fit the object into that
      location. The assumption is that userspace is handling its own object
      locations (for example along with full-ppgtt) and that the kernel will
      rarely have to make space for the user's requests.
      
      v2: Fix i915_gem_evict_range() (now evict_for_vma) to handle ordinary
      and fixed objects within the same batch
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: "Daniel, Thomas" <thomas.daniel@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      51056723
  25. 02 10月, 2015 3 次提交
  26. 30 9月, 2015 1 次提交
  27. 23 9月, 2015 1 次提交
  28. 02 9月, 2015 1 次提交
  29. 15 8月, 2015 2 次提交
    • A
      drm/i915: Integrate GuC-based command submission · d1675198
      Alex Dai 提交于
      GuC-based submission is mostly the same as execlist mode, up to
      intel_logical_ring_advance_and_submit(), where the context being
      dispatched would be added to the execlist queue; at this point
      we submit the context to the GuC backend instead.
      
      There are, however, a few other changes also required, notably:
      1.  Contexts must be pinned at GGTT addresses accessible by the GuC
          i.e. NOT in the range [0..WOPCM_SIZE), so we have to add the
          PIN_OFFSET_BIAS flag to the relevant GGTT-pinning calls.
      
      2.  The GuC's TLB must be invalidated after a context is pinned at
          a new GGTT address.
      
      3.  GuC firmware uses the one page before Ring Context as shared data.
          Therefore, whenever driver wants to get base address of LRC, we
          will offset one page for it. LRC_PPHWSP_PN is defined as the page
          number of LRCA.
      
      4.  In the work queue used to pass requests to the GuC, the GuC
          firmware requires the ring-tail-offset to be represented as an
          11-bit value, expressed in QWords. Therefore, the ringbuffer
          size must be reduced to the representable range (4 pages).
      
      v2:
          Defer adding #defines until needed [Chris Wilson]
          Rationalise type declarations [Chris Wilson]
      
      v4:
          Squashed kerneldoc patch into here [Daniel Vetter]
      
      v5:
          Update request->tail in code common to both GuC and execlist modes.
          Add a private version of lr_context_update(), as sharing the
              execlist version leads to race conditions when the CPU and
              the GuC both update TAIL in the context image.
          Conversion of error-captured HWS page to string must account
              for offset from start of object to actual HWS (LRC_PPHWSP_PN).
      
      Issue: VIZ-4884
      Signed-off-by: NAlex Dai <yu.dai@intel.com>
      Signed-off-by: NDave Gordon <david.s.gordon@intel.com>
      Reviewed-by: NTom O'Rourke <Tom.O'Rourke@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d1675198
    • M
      drm/i915: Expand error state's address width to 64b · e1f12325
      Michel Thierry 提交于
      v2: For semaphore errors, object is mapped to GGTT and offset will not
      be > 4GB, print only lower 32-bits (Akash)
      v3: Print gtt_offset in groups of 32-bit (Chris)
      
      Cc: Akash Goel <akash.goel@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NMichel Thierry <michel.thierry@intel.com>
      Reviewed-by: NAkash Goel <akash.goel@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e1f12325