1. 27 10月, 2017 1 次提交
  2. 26 10月, 2017 2 次提交
  3. 24 10月, 2017 2 次提交
    • C
      drm/i915/execlists: Remove the priority "optimisation" · 64b80085
      Chris Wilson 提交于
      Originally we set the priority to max upon inserting the request into
      the execlists queue (and removing it from the scheduler lists). We could
      then use the prio==INT_MAX as a shortcut within execlists_schedule() to
      detect the end of the dependency chain. Since commit 1f181225
      ("drm/i915/execlists: Keep request->priority for its lifetime") this is
      no longer true as we use the request completion as an indicator the
      schedule dependency chain is complete instead. (This allows us to then
      reschedule requests even when its context is in flight.) However, this
      makes the GEM_BUG_ON() inside execlists_schedule() racy as we may change
      the rq->prio at the same time. As the assertion is useful, let's keep
      the assertion and remove the micro-optimisation.
      
      Fixes: 1f181225 ("drm/i915/execlists: Keep request->priority for its lifetime")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Michał Winiarski <michal.winiarski@intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171024115501.21033-1-chris@chris-wilson.co.ukReviewed-by: NMichał Winiarski <michal.winiarski@intel.com>
      64b80085
    • C
      drm/i915: Filter out spurious execlists context-switch interrupts · 4a118ecb
      Chris Wilson 提交于
      Back in commit a4b2b015 ("drm/i915: Don't mark an execlists
      context-switch when idle") we noticed the presence of late
      context-switch interrupts. We were able to filter those out by looking
      at whether the ELSP remained active, but in commit beecec90
      ("drm/i915/execlists: Preemption!") that became problematic as we now
      anticipate receiving a context-switch event for preemption while ELSP
      may be empty. To restore the spurious interrupt suppression, add a
      counter for the expected number of pending context-switches and skip if
      we do not need to handle this interrupt to make forward progress.
      
      v2: Don't forget to switch on for preempt.
      v3: Reduce the counter to a on/off boolean tracker. Declare the HW as
      active when we first submit, and idle after the final completion event
      (with which we confirm the HW says it is idle), and track each source
      of activity separately. With a finite number of sources, it should aide
      us in debugging which gets stuck.
      
      Fixes: beecec90 ("drm/i915/execlists: Preemption!")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Michal Winiarski <michal.winiarski@intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171023213237.26536-3-chris@chris-wilson.co.ukReviewed-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      4a118ecb
  4. 17 10月, 2017 1 次提交
  5. 16 10月, 2017 1 次提交
  6. 10 10月, 2017 1 次提交
  7. 07 10月, 2017 1 次提交
  8. 05 10月, 2017 4 次提交
    • C
      drm/i915/execlists: Preemption! · beecec90
      Chris Wilson 提交于
      When we write to ELSP, it triggers a context preemption at the earliest
      arbitration point (3DPRIMITIVE, some PIPECONTROLs, a few other
      operations and the explicit MI_ARB_CHECK). If this is to the same
      context, it triggers a LITE_RESTORE where the RING_TAIL is merely
      updated (used currently to chain requests from the same context
      together, avoiding bubbles). However, if it is to a different context, a
      full context-switch is performed and it will start to execute the new
      context saving the image of the old for later execution.
      
      Previously we avoided preemption by only submitting a new context when
      the old was idle. But now we wish embrace it, and if the new request has
      a higher priority than the currently executing request, we write to the
      ELSP regardless, thus triggering preemption, but we tell the GPU to
      switch to our special preemption context (not the target). In the
      context-switch interrupt handler, we know that the previous contexts
      have finished execution and so can unwind all the incomplete requests
      and compute the new highest priority request to execute.
      
      It would be feasible to avoid the switch-to-idle intermediate by
      programming the ELSP with the target context. The difficulty is in
      tracking which request that should be whilst maintaining the dependency
      change, the error comes in with coalesced requests. As we only track the
      most recent request and its priority, we may run into the issue of being
      tricked in preempting a high priority request that was followed by a
      low priority request from the same context (e.g. for PI); worse still
      that earlier request may be our own dependency and the order then broken
      by preemption. By injecting the switch-to-idle and then recomputing the
      priority queue, we avoid the issue with tracking in-flight coalesced
      requests. Having tried the preempt-to-busy approach, and failed to find
      a way around the coalesced priority issue, Michal's original proposal to
      inject an idle context (based on handling GuC preemption) succeeds.
      
      The current heuristic for deciding when to preempt are only if the new
      request is of higher priority, and has the privileged priority of
      greater than 0. Note that the scheduler remains unfair!
      
      v2: Disable for gen8 (bdw/bsw) as we need additional w/a for GPGPU.
      Since, the feature is now conditional and not always available when we
      have a scheduler, make it known via the HAS_SCHEDULER GETPARAM (now a
      capability mask).
      v3: Stylistic tweaks.
      v4: Appease Joonas with a snippet of kerneldoc, only to fuel to fire of
      the preempt vs preempting debate.
      Suggested-by: NMichal Winiarski <michal.winiarski@intel.com>
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Michal Winiarski <michal.winiarski@intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Cc: Ben Widawsky <benjamin.widawsky@intel.com>
      Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
      Cc: Zhi Wang <zhi.a.wang@intel.com>
      Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171003203453.15692-8-chris@chris-wilson.co.uk
      beecec90
    • C
      drm/i915/execlists: Keep request->priority for its lifetime · 1f181225
      Chris Wilson 提交于
      With preemption, we will want to "unsubmit" a request, taking it back
      from the hw and returning it to the priority sorted execution list. In
      order to know where to insert it into that list, we need to remember
      its adjust priority (which may change even as it was being executed).
      
      This also affects reset for execlists as we are now unsubmitting the
      requests following the reset (rather than directly writing the ELSP for
      the inflight contexts). This turns reset into an accidental preemption
      point, as after the reset we may choose a different pair of contexts to
      submit to hw.
      
      GuC is not updated as this series doesn't add preemption to the GuC
      submission, and so it can keep benefiting from the early pruning of the
      DFS inside execlists_schedule() for a little longer. We also need to
      find a way of reducing the cost of that DFS...
      
      v2: Include priority in error-state
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Michał Winiarski <michal.winiarski@intel.com>
      Reviewed-by: NMichał Winiarski <michal.winiarski@intel.com>
      Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171003203453.15692-6-chris@chris-wilson.co.uk
      1f181225
    • C
      drm/i915/execlists: Move bdw GPGPU w/a to emit_bb · 3ad7b52d
      Chris Wilson 提交于
      Move the re-enabling of MI arbitration from a per-bb w/a buffer to the
      emission of the batch buffer itself.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171003203453.15692-5-chris@chris-wilson.co.uk
      3ad7b52d
    • C
      drm/i915/execlists: Distinguish the incomplete context notifies · d6c05113
      Chris Wilson 提交于
      Let the listener know that the context we just scheduled out was not
      complete, and will be scheduled back in at a later point.
      
      v2: Handle CONTEXT_STATUS_PREEMPTED in gvt by aliasing it to
      CONTEXT_STATUS_OUT for the moment, gvt can expand upon the difference
      later.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: "Zhenyu Wang" <zhenyuw@linux.intel.com>
      Cc: "Wang, Zhi A" <zhi.a.wang@intel.com>
      Cc: Michał Winiarski <michal.winiarski@intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171003203453.15692-3-chris@chris-wilson.co.uk
      d6c05113
  9. 04 10月, 2017 1 次提交
  10. 29 9月, 2017 3 次提交
  11. 27 9月, 2017 1 次提交
  12. 26 9月, 2017 1 次提交
  13. 25 9月, 2017 7 次提交
  14. 22 9月, 2017 1 次提交
  15. 18 9月, 2017 6 次提交
  16. 14 9月, 2017 2 次提交
    • C
      drm/i915/execlists: Read the context-status HEAD from the HWSP · 767a983a
      Chris Wilson 提交于
      The engine also provides a mirror of the CSB write pointer in the HWSP,
      but not of our read pointer. To take advantage of this we need to
      remember where we read up to on the last interrupt and continue off from
      there. This poses a problem following a reset, as we don't know where
      the hw will start writing from, and due to the use of power contexts we
      cannot perform that query during the reset itself. So we continue the
      current modus operandi of delaying the first read of the context-status
      read/write pointers until after the first interrupt. With this we should
      now have eliminated all uncached mmio reads in handling the
      context-status interrupt, though we still have the uncached mmio writes
      for submitting new work, and many uncached mmio reads in the global
      interrupt handler itself. Still a step in the right direction towards
      reducing our resubmit latency, although it appears lost in the noise!
      
      v2: Cannonlake moved the CSB write index
      v3: Include the sw/hwsp state in debugfs/i915_engine_info
      v4: Also revert to using CSB mmio for GVT-g
      v5: Prevent the compiler reloading tail (Mika)
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Michel Thierry <michel.thierry@intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
      Cc: Zhi Wang <zhi.a.wang@intel.com>
      Acked-by: NMichel Thierry <michel.thierry@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20170913085605.18299-6-chris@chris-wilson.co.ukReviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      767a983a
    • C
      drm/i915/execlists: Read the context-status buffer from the HWSP · 6d2cb5aa
      Chris Wilson 提交于
      The engine provides a mirror of the CSB in the HWSP. If we use the
      cacheable reads from the HWSP, we can shave off a few mmio reads per
      context-switch interrupt (which are quite frequent!). Just removing a
      couple of mmio is not enough to actually reduce any latency, but a small
      reduction in overall cpu usage.
      
      Much appreciation for Ben dropping the bombshell that the CSB was in the
      HWSP and for Michel in digging out the details.
      
      v2: Don't be lazy, add the defines for the indices.
      v3: Include the HWSP in debugfs/i915_engine_info
      v4: Check for GVT-g, it currently depends on intercepting CSB mmio
      v5: Fixup GVT-g mmio path
      v6: Disable HWSP if VT-d is active as the iommu adds unpredictable
      memory latency. (Mika)
      v7: Also markup the CSB read with READ_ONCE() as it may still be an mmio
      read and we want to stop the compiler from issuing a later (v.slow) reload.
      Suggested-by: NBen Widawsky <benjamin.widawsky@intel.com>
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Michel Thierry <michel.thierry@intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
      Cc: Zhi Wang <zhi.a.wang@intel.com>
      Acked-by: NMichel Thierry <michel.thierry@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20170913133534.26927-1-chris@chris-wilson.co.ukReviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      6d2cb5aa
  17. 13 9月, 2017 3 次提交
  18. 21 8月, 2017 1 次提交
  19. 19 8月, 2017 1 次提交