1. 09 9月, 2016 3 次提交
    • C
      drm/i915/guc: Prepare for nonblocking execbuf submission · dadd481b
      Chris Wilson 提交于
      Currently the presumption is that the request construction and its
      submission to the GuC are all under the same holding of struct_mutex. We
      wish to relax this to separate the request construction and the later
      submission to the GuC. This requires us to reserve some space in the
      GuC command queue for the future submission. For flexibility to handle
      out-of-order request submission we do not preallocate the next slot in
      the GuC command queue during request construction, just ensuring that
      there is enough space later.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Link: http://patchwork.freedesktop.org/patch/msgid/20160909131201.16673-17-chris@chris-wilson.co.uk
      dadd481b
    • C
      drm/i915: Drive request submission through fence callbacks · 5590af3e
      Chris Wilson 提交于
      Drive final request submission from a callback from the fence. This way
      the request is queued until all dependencies are resolved, at which
      point it is handed to the backend for queueing to hardware. At this
      point, no dependencies are set on the request, so the callback is
      immediate.
      
      A side-effect of imposing a heavier-irqsafe spinlock for execlist
      submission is that we lose the softirq enabling after scheduling the
      execlists tasklet. To compensate, we manually kickstart the softirq by
      disabling and enabling the bh around the fence signaling.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Reviewed-by: NJohn Harrison <john.c.harrison@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20160909131201.16673-14-chris@chris-wilson.co.uk
      5590af3e
    • C
      drm/i915: Update reset path to fix incomplete requests · 821ed7df
      Chris Wilson 提交于
      Update reset path in preparation for engine reset which requires
      identification of incomplete requests and associated context and fixing
      their state so that engine can resume correctly after reset.
      
      The request that caused the hang will be skipped and head is reset to the
      start of breadcrumb. This allows us to resume from where we left-off.
      Since this request didn't complete normally we also need to cleanup elsp
      queue manually. This is vital if we employ nonblocking request
      submission where we may have a web of dependencies upon the hung request
      and so advancing the seqno manually is no longer trivial.
      
      ABI: gem_reset_stats / DRM_IOCTL_I915_GET_RESET_STATS
      
      We change the way we count pending batches. Only the active context
      involved in the reset is marked as either innocent or guilty, and not
      mark the entire world as pending. By inspection this only affects
      igt/gem_reset_stats (which assumes implementation details) and not
      piglit.
      
      ARB_robustness gives this guide on how we expect the user of this
      interface to behave:
      
       * Provide a mechanism for an OpenGL application to learn about
         graphics resets that affect the context.  When a graphics reset
         occurs, the OpenGL context becomes unusable and the application
         must create a new context to continue operation. Detecting a
         graphics reset happens through an inexpensive query.
      
      And with regards to the actual meaning of the reset values:
      
         Certain events can result in a reset of the GL context. Such a reset
         causes all context state to be lost. Recovery from such events
         requires recreation of all objects in the affected context. The
         current status of the graphics reset state is returned by
      
      	enum GetGraphicsResetStatusARB();
      
         The symbolic constant returned indicates if the GL context has been
         in a reset state at any point since the last call to
         GetGraphicsResetStatusARB. NO_ERROR indicates that the GL context
         has not been in a reset state since the last call.
         GUILTY_CONTEXT_RESET_ARB indicates that a reset has been detected
         that is attributable to the current GL context.
         INNOCENT_CONTEXT_RESET_ARB indicates a reset has been detected that
         is not attributable to the current GL context.
         UNKNOWN_CONTEXT_RESET_ARB indicates a detected graphics reset whose
         cause is unknown.
      
      The language here is explicit in that we must mark up the guilty batch,
      but is loose enough for us to relax the innocent (i.e. pending)
      accounting as only the active batches are involved with the reset.
      
      In the future, we are looking towards single engine resetting (with
      minimal locking), where it seems inappropriate to mark the entire world
      as innocent since the reset occurred on a different engine. Reducing the
      information available means we only have to encounter the pain once, and
      also reduces the information leaking from one context to another.
      
      v2: Legacy ringbuffer submission required a reset following hibernation,
      or else we restore stale values to the RING_HEAD and walked over
      stolen garbage.
      
      v3: GuC requires replaying the requests after a reset.
      
      v4: Restore engine IRQ after reset (so waiters will be woken!)
          Rearm hangcheck if resetting with a waiter.
      
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Cc: Arun Siluvery <arun.siluvery@linux.intel.com>
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20160909131201.16673-13-chris@chris-wilson.co.uk
      821ed7df
  2. 05 9月, 2016 1 次提交
  3. 27 8月, 2016 1 次提交
  4. 17 8月, 2016 1 次提交
  5. 15 8月, 2016 5 次提交
  6. 10 8月, 2016 4 次提交
  7. 05 8月, 2016 1 次提交
  8. 03 8月, 2016 3 次提交
  9. 20 7月, 2016 2 次提交
  10. 06 7月, 2016 1 次提交
  11. 05 7月, 2016 1 次提交
  12. 04 7月, 2016 1 次提交
  13. 21 6月, 2016 2 次提交
  14. 14 6月, 2016 6 次提交
  15. 13 6月, 2016 2 次提交
  16. 07 6月, 2016 1 次提交
    • D
      drm/i915/guc: disable GuC submission earlier during GuC (re)load · 29fb72c7
      Dave Gordon 提交于
      When resetting and reloading the GuC, the GuC submission management code
      also needs to destroy and recreate the GuC client(s). Currently this is
      done by a separate call from the GuC loader, but really, it's just an
      internal detail of the submission code. So here we remove the call from
      the loader (which is too late, really, because the GuC has already been
      reloaded at this point) and put it into guc_submission_init() instead.
      This means that any preexisting client is destroyed *before* the GuC
      (re)load and then recreated after, iff the firmware was successfully
      loaded. If the GuC reload fails, we don't recreate the client, so
      fallback to execlists mode (if active) won't leak the client object
      (previously, the now-unusable client would have been left allocated,
      and leaked if the driver were unloaded).
      Signed-off-by: NDave Gordon <david.s.gordon@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      29fb72c7
  17. 24 5月, 2016 3 次提交
  18. 23 5月, 2016 2 次提交
    • D
      drm/i915/guc: rework guc_add_workqueue_item() · 0a31afbc
      Dave Gordon 提交于
      Mostly little optimisations and future-proofing against code breakage.
      For instance, if the driver is correctly following the submission
      protocol, the "out of space" condition is impossible, so the previous
      runtime WARN_ON() is promoted to a GEM_BUG_ON() for a more dramatic
      effect in development and less impact in end-user systems.
      
      Similarly we can make alignment checking more stringent and replace
      other WARN_ON() conditions that don't relate to the runtime hardware
      state with either BUILD_BUG_ON() for compile-time-detectable issues, or
      GEM_BUG_ON() for logical "can't happen" errors.
      
      With those changes, we can convert it to void, as suggested by Chris
      Wilson, and update the calling code appropriately.
      
      v2:
          Note that we're now putting the request seqno in the "fence_id"
          field of each GuC-work-item, in case it turns up somewhere useful
          (e.g. in a GuC log) [Tvrtko Ursulin].
      Signed-off-by: NDave Gordon <david.s.gordon@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      0a31afbc
    • D
      drm/i915/guc: don't spinwait if the GuC's workqueue is full · 551aaecd
      Dave Gordon 提交于
      Rather than wait to see whether more space becomes available in the GuC
      submission workqueue, we can just return -EAGAIN and let the caller try
      again in a little while. This gets rid of an uninterruptable sleep in
      the polling code :)
      
      We'll also add a counter to the GuC client statistics, to see how often
      we find the WQ full.
      
      v2:
          Flag the likely() code path (Tvtrko Ursulin).
      
      v4:
          Add/update comments about failure counters (Tvtrko Ursulin).
      Signed-off-by: NDave Gordon <david.s.gordon@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      551aaecd