1. 13 12月, 2012 1 次提交
    • D
      drm/i915: rework locking for intel_dpio|sbi_read|write · 09153000
      Daniel Vetter 提交于
      Spinning for up to 200 us with interrupts locked out is not good. So
      let's just spin (and even that seems to be excessive).
      
      And we don't call these functions from interrupt context, so this is
      not required. Besides that doing anything in interrupt contexts which
      might take a few hundred us is a no-go. So just convert the entire
      thing to a mutex. Also move the mutex-grabbing out of the read/write
      functions (add a WARN_ON(!is_locked)) instead) since all callers are
      nicely grouped together.
      
      Finally the real motivation for this change: Dont grab the modeset
      mutex in the dpio debugfs file, we don't need that consistency. And
      correctness of the dpio interface is ensured with the dpio_lock.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      09153000
  2. 06 12月, 2012 2 次提交
  3. 04 12月, 2012 1 次提交
    • D
      drm/i915: fixup sparse warnings · 1a240d4d
      Daniel Vetter 提交于
      - __iomem where there is none (I love how we mix these things up).
      - Use gfp_t instead of an other plain type.
      - Unconfuse one place about enum pipe vs enum transcoder - for the pch
        transcoder we actually use the pipe enum. Fixup the other cases
        where we assign the pipe to the cpu transcoder with explicit casts.
      - Declare the mch_lock properly in a header.
      
      There is still a decent mess in intel_bios.c about __iomem, but heck,
      this is x86 and we're allowed to do that.
      
      Makes-sparse-happy: Chris Wilson <chris@chris-wilson.co.uk>
      [danvet: Use a space after the cast consistently and fix up the
      newly-added cast in i915_irq.c to properly use __iomem.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      1a240d4d
  4. 01 12月, 2012 1 次提交
  5. 29 11月, 2012 2 次提交
  6. 12 11月, 2012 3 次提交
  7. 16 10月, 2012 2 次提交
  8. 03 10月, 2012 2 次提交
  9. 20 9月, 2012 1 次提交
  10. 03 9月, 2012 1 次提交
  11. 24 8月, 2012 1 次提交
    • B
      drm/i915: Use new INSTDONE registers (Gen7+) · 050ee91f
      Ben Widawsky 提交于
      Using the extracted INSTDONE reading, and our new register definitions,
      update our hangcheck detection and error collection to use it. This
      primarily means changing == to memcmp, and changing = to memcpy.
      Hopefully this will give more info on error dump, and provide more
      accurate hangcheck detection (both are actually TBD).
      
      Also, remove the reading of instdone1 from the ring error collection
      function, and just crap everything in capture_error_state (that could be
      split into a separate patch if it wasn't so trivial).
      
      v2: Now assuming i915_get_extra_instdone does the memset we can clean up the
      code a bit (Jani)
      
      v3: use ARRAY_SIZE as requested earlier by Jani (didn't change sizeof)
      Updated commit msg
      
      Cc: Jani Nikula <jani.nikula@intel.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      050ee91f
  12. 23 8月, 2012 1 次提交
  13. 21 8月, 2012 3 次提交
    • C
      drm/i915: Show pin count in debugfs · c110a6d7
      Chris Wilson 提交于
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c110a6d7
    • C
    • C
      drm/i915: Track unbound pages · 6c085a72
      Chris Wilson 提交于
      When dealing with a working set larger than the GATT, or even the
      mappable aperture when touching through the GTT, we end up with evicting
      objects only to rebind them at a new offset again later. Moving an
      object into and out of the GTT requires clflushing the pages, thus
      causing a double-clflush penalty for rebinding.
      
      To avoid having to clflush on rebinding, we can track the pages as they
      are evicted from the GTT and only relinquish those pages on memory
      pressure.
      
      As usual, if it were not for the handling of out-of-memory condition and
      having to manually shrink our own bo caches, it would be a net reduction
      of code. Alas.
      
      Note: The patch also contains a few changes to the last-hope
      evict_everything logic in i916_gem_execbuffer.c - we no longer try to
      only evict the purgeable stuff in a first try (since that's superflous
      and only helps in OOM corner-cases, not fragmented-gtt trashing
      situations).
      
      Also, the extraction of the get_pages retry loop from bind_to_gtt (and
      other callsites) to get_pages should imo have been a separate patch.
      
      v2: Ditch the newly added put_pages (for unbound objects only) in
      i915_gem_reset. A quick irc discussion hasn't revealed any important
      reason for this, so if we need this, I'd like to have a git blame'able
      explanation for it.
      
      v3: Undo the s/drm_malloc_ab/kmalloc/ in get_pages that Chris noticed.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      [danvet: Split out code movements and rant a bit in the commit message
      with a few Notes. Done v2]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6c085a72
  14. 12 8月, 2012 1 次提交
  15. 10 8月, 2012 5 次提交
  16. 26 7月, 2012 2 次提交
  17. 20 7月, 2012 1 次提交
    • C
      drm/i915: Add comments to explain the BSD tail write workaround · 12f55818
      Chris Wilson 提交于
      Having had to dive into the bspec to understand what each stage of the
      workaround meant, and how that the ring broadcasting IDLE corresponded
      with the GT powering down the ring (i.e. rc6) add comments to aide
      the next reader.
      
      And since the register "is used to control all aspects of PSMI and power
      saving functions" that makes it quite interesting to inspect with
      regards to RC6 hangs, so add it to the error-state.
      
      v2: Rediscover the piece of magic, set the RNCID to 0 before waiting for
      the ring to wake up.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      12f55818
  18. 14 6月, 2012 1 次提交
  19. 05 6月, 2012 1 次提交
  20. 22 5月, 2012 1 次提交
  21. 20 5月, 2012 1 次提交
    • C
      drm/i915: Introduce for_each_ring() macro · b4519513
      Chris Wilson 提交于
      In many places we wish to iterate over the rings associated with the
      GPU, so refactor them to use a common macro.
      
      Along the way, there are a few code removals that should be side-effect
      free and some rearrangement which should only have a cosmetic impact,
      such as error-state.
      
      Note that this slightly changes the semantics in the hangcheck code:
      We now always cycle through all enabled rings instead of
      short-circuiting the logic.
      
      v2: Pull in a couple of suggestions from Ben and Daniel for
      intel_ring_initialized() and not removing the warning (just moving them
      to a new home, closer to the error).
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NBen Widawsky <ben@bwidawsk.net>
      [danvet: Added note to commit message about the small behaviour
      change, suggested by Ben Widawsky.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b4519513
  22. 06 5月, 2012 3 次提交
    • D
      drm/i915: allow the existing error_state to be destroyed · d5442303
      Daniel Vetter 提交于
      ... by writing (anything) to i915_error_state.
      
      This way we can simulate a bunch of gpu hangs and run the error_state
      capture code every time (without the need to reload the module).
      
      To make that happen we need to abandon the simple seq_file wrappers
      provided by the drm core. While at it put the new error_state
      refcounting to some good use and associated the error_state to the
      debugfs when opening the file. Otherwise the error_state could change
      while someone is reading it. This should help greatly when we finally
      get around to split up the giant single seq_file block that the
      error_state file currently is into smaller parts.
      
      v2: Actually squash all the fixes into the patch ...
      Reviewed-by: NEugeni Dodonov <eugeni.dodonov@intel.com>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d5442303
    • D
      drm/i915: rework dev->first_error locking · 742cbee8
      Daniel Vetter 提交于
      - reduce the irq disabled section, even for a debugfs file this was
        way too long.
      - always disable irqs when taking the lock.
      
      v2: Thou shalt not mistake locking for reference counting, so:
      - reference count the error_state to protect from concurent freeeing.
        This will be only really used in the next patch.
      Reviewed-by: NEugeni Dodonov <eugeni.dodonov@intel.com>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      742cbee8
    • D
      drm/i915: add interface to simulate gpu hangs · e5eb3d63
      Daniel Vetter 提交于
      gpu reset is a very important piece of our infrastructure.
      Unfortunately we only really it test by actually hanging the gpu,
      which often has bad side-effects for the entire system. And the gpu
      hang handling code is one of the rather complicated pieces of code we
      have, consisting of
      - hang detection
      - error capture
      - actual gpu reset
      - reset of all the gem bookkeeping
      - reinitialition of the entire gpu
      
      This patch adds a debugfs to selectively stopping rings by ceasing to
      update the hw tail pointer, which will result in the gpu no longer
      updating it's head pointer and eventually to the hangcheck firing.
      This way we can exercise the gpu hang code under controlled conditions
      without a dying gpu taking down the entire systems.
      
      Patch motivated by me forgetting to properly reinitialize ppgtt after
      a gpu reset.
      
      Usage:
      
      echo $((1 << $ringnum)) > i915_ring_stop # stops one ring
      
      echo 0xffffffff > i915_ring_stop # stops all, future-proof version
      
      then run whatever testload is desired. i915_ring_stop automatically
      resets after a gpu hang is detected to avoid hanging the gpu to fast
      and declaring it wedged.
      
      v2: Incorporate feedback from Chris Wilson.
      
      v3: Add the missing cleanup.
      
      v4: Fix up inconsistent size of ring_stop_read vs _write, noticed by
      Eugeni Dodonov.
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NEugeni Dodonov <eugeni.dodonov@intel.com>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e5eb3d63
  23. 03 5月, 2012 3 次提交