1. 09 9月, 2016 1 次提交
    • 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 4 次提交
    • 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
    • D
      drm/i915/guc: pass request (not client) to i915_guc_{wq_check_space, submit}() · 7c2c270d
      Dave Gordon 提交于
      The knowledge of how to derive the relevant client from the request
      should be localised within i915_guc_submission.c; the LRC code shouldn't
      have to know about the internal details of the GuC submission process.
      And all the information the GuC code needs should be encapsulated in (or
      reachable from) the request.
      
      v2:
          GEM_BUG_ON() for bad GuC client (Tvrtko Ursulin).
          Add/update kerneldoc explaining check_space/submit protocol
      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>
      7c2c270d
    • D
      drm/i915/guc: add enable_guc_loading parameter · fce91f22
      Dave Gordon 提交于
      Split the function of "enable_guc_submission" into two separate
      options.  The new one ("enable_guc_loading") controls only the
      *fetching and loading* of the GuC firmware image. The existing
      one is redefined to control only the *use* of the GuC for batch
      submission once the firmware is loaded.
      
      In addition, the degree of control has been refined from a simple
      bool to an integer key, allowing several options:
      -1 (default)     whatever the platform default is
       0  DISABLE      don't load/use the GuC
       1  BEST EFFORT  try to load/use the GuC, fallback if not available
       2  REQUIRE      must load/use the GuC, else leave the GPU wedged
      
      The new platform default (as coded here) will be to attempt to
      load the GuC iff the device has a GuC that requires firmware,
      but not yet to use it for submission. A later patch will change
      to enable it if appropriate.
      
      v4:
          Changed some error-message levels, mostly ERROR->INFO, per
          review comments by Tvrtko Ursulin.
      
      v5:
          Dropped one more error message, disabled GuC submission on
          hypothetical firmware-free devices [Tvrtko Ursulin].
      
      v6:
          Logging tidy by Tvrtko Ursulin:
           * Do not log falling back to execlists when wedging the GPU.
           * Do not log fw load errors when load was disabled by user.
           * Pass down some error code from fw load for log message to
             make more sense.
      Signed-off-by: NDave Gordon <david.s.gordon@intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> (v5)
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Tested-by: NFiedorowicz, Lukasz <lukasz.fiedorowicz@intel.com>
      Signed-off-by: NDave Gordon <david.s.gordon@intel.com>
      Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> (v5)
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: Nick Hoath <nicholas.hoath@intel.com> (v6)
      fce91f22