1. 13 4月, 2012 10 次提交
  2. 10 4月, 2012 3 次提交
    • D
      drm/i915: use render gen to switch ring irq functions · 901781b9
      Daniel Vetter 提交于
      Top-level interrupt bits are usually found in the display block. It
      therefore makes sense to use HAS_PCH_SPLIT in i915_irq.c
      
      But the irq stuff in intel_ring.c only concerns itself with render
      core/gt-level interrupt sources. It therefore makes more sense to
      switch based on gpu gen.
      
      Kills a vlv special case.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      901781b9
    • B
      drm/i915: open code gen6+ ring irqs · 25c06300
      Ben Widawsky 提交于
      We can now open-code the get/put irq functions as they were just
      abstracting single register definitions.
      
      It would be nice to merge this in with the IRQ handling code... but that
      is too much work for me at present. In addition I could probably
      collapse this in to a lot of the Ironlake stuff, but I don't think it's
      worth the potential regressions.
      
      This patch itself should not effect functionality.
      
      CC: Jesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NBen Widawsky <benjamin.widawsky@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      25c06300
    • B
      drm/i915: ring irq cleanups · e2a1e2f0
      Ben Widawsky 提交于
      - gen6 put/get only need one argument
          rflags and gflags are always the same (see above explanation)
      - remove a couple redundantly defined IRQs
      - reordered some lines to make things go in descending order
      
      Every ring has its own interrupts, enables, masks, and status bits that
      are fed into the main interrupt enable/mask/status registers. At one
      point in time it seemed like a good idea to make our functions support
      the notion that each interrupt may have a different bit position in the
      corresponding register (blitter parser error may be bit n in IMR, but
      bit m in blitter IMR). It turned out though that the HW designers did us
      a solid on Gen6+ and this unfortunate situation has been avoided. This
      allows our interrupt code to be cleaned up a bit.
      
      I jammed this into one commit because there should be no functional
      change with this commit, and staging it into multiple commits was
      unnecessarily artificial IMO.
      
      CC: Chris Wilson <chris@chris-wilson.co.uk>
      CC: Jesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NBen Widawsky <benjamin.widawsky@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      [danvet:
      - fixed up merged conflict with vlv changes.
      - added GEN6 to GT blitter bit, we only use it on gen6+.
      - added a comment to both ring irq bits and GT irq bits that on gen6+
        these alias.
      - added comment that GT_BSD_USER_INTERRUPT is ilk-only.
      - I've got confused a bit that we still use GT_USER_INTERRUPT on ivb
        for the render ring - but this goes back to ilk where we have only
        gt interrupt bits and so we be equally confusing if changed.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e2a1e2f0
  3. 01 4月, 2012 1 次提交
  4. 29 3月, 2012 1 次提交
  5. 19 3月, 2012 1 次提交
  6. 28 2月, 2012 1 次提交
    • C
      drm/i915: Remove use of the autoreported ringbuffer HEAD position · 5d031e5b
      Chris Wilson 提交于
      This is a revert of 6aa56062.
      
      This was originally introduced to workaround reads of the ringbuffer
      registers returning 0 on SandyBridge causing hangs due to ringbuffer
      overflow. The root cause here was reads through the GT powerwell require
      the forcewake dance, something we only learnt of later. Now it appears
      that reading the reported head position from the HWS is returning
      garbage, leading once again to hangs.
      
      For example, on q35 the autoreported head reports:
        [  217.975608] head now 00010000, actual 00010000
        [  436.725613] head now 00200000, actual 00200000
        [  462.956033] head now 00210000, actual 00210010
        [  485.501409] head now 00400000, actual 00400020
        [  508.064280] head now 00410000, actual 00410000
        [  530.576078] head now 00600000, actual 00600020
        [  553.273489] head now 00610000, actual 00610018
      which appears reasonably sane. In contrast, if we look at snb:
        [  141.970680] head now 00e10000, actual 00008238
        [  141.974062] head now 02734000, actual 000083c8
        [  141.974425] head now 00e10000, actual 00008488
        [  141.980374] head now 032b5000, actual 000088b8
        [  141.980885] head now 03271000, actual 00008950
        [  142.040628] head now 02101000, actual 00008b40
        [  142.180173] head now 02734000, actual 00009050
        [  142.181090] head now 00000000, actual 00000ae0
        [  142.183737] head now 02734000, actual 00009050
      
      In addition, the automatic reporting of the head position is scheduled
      to be defeatured in the future. It has no more utility, remove it.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45492Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Tested-by: NEric Anholt <eric@anholt.net>
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      5d031e5b
  7. 15 2月, 2012 1 次提交
    • C
      drm/i915: Record the tail at each request and use it to estimate the head · a71d8d94
      Chris Wilson 提交于
      By recording the location of every request in the ringbuffer, we know
      that in order to retire the request the GPU must have finished reading
      it and so the GPU head is now beyond the tail of the request. We can
      therefore provide a conservative estimate of where the GPU is reading
      from in order to avoid having to read back the ring buffer registers
      when polling for space upon starting a new write into the ringbuffer.
      
      A secondary effect is that this allows us to convert
      intel_ring_buffer_wait() to use i915_wait_request() and so consolidate
      upon the single function to handle the complicated task of waiting upon
      the GPU. A necessary precaution is that we need to make that wait
      uninterruptible to match the existing conditions as all the callers of
      intel_ring_begin() have not been audited to handle ERESTARTSYS
      correctly.
      
      By using a conservative estimate for the head, and always processing all
      outstanding requests first, we prevent a race condition between using
      the estimate and direct reads of I915_RING_HEAD which could result in
      the value of the head going backwards, and the tail overflowing once
      again. We are also careful to mark any request that we skip over in
      order to free space in ring as consumed which provides a
      self-consistency check.
      
      Given sufficient abuse, such as a set of unthrottled GPU bound
      cairo-traces, avoiding the use of I915_RING_HEAD gives a 10-20% boost on
      Sandy Bridge (i5-2520m):
        firefox-paintball  18927ms -> 15646ms: 1.21x speedup
        firefox-fishtank   12563ms -> 11278ms: 1.11x speedup
      which is a mild consolation for the performance those traces achieved from
      exploiting the buggy autoreported head.
      
      v2: Add a few more comments and make request->tail a conservative
      estimate as suggested by Daniel Vetter.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      [danvet: resolve conflicts with retirement defering and the lack of
      the autoreport head removal (that will go in through -fixes).]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a71d8d94
  8. 13 2月, 2012 2 次提交
    • D
      drm/i915: enable forcewake voodoo also for gen6 · 99ffa162
      Daniel Vetter 提交于
      We still have reports of missed irqs even on Sandybridge with the
      HWSTAM workaround in place. Testing by the bug reporter gets rid of
      them with the forcewake voodoo and no HWSTAM writes.
      
      Because I've slightly botched the rebasing I've left out the ACTHD
      readback which is also required to get IVB working. Seems to still
      work on the tester's machine, so I think we should go with the more
      minmal approach on SNB. Especially since I've only found weak evidence
      for holding forcewake while waiting for an interrupt to arrive, but
      none for the ACTHD readback.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45181
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45332
      Tested-by: Nicolas Kalkhof nkalkhof()at()web.de
      Acked-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      99ffa162
    • D
      drm/i915: fixup seqno allocation logic for lazy_request · 53d227f2
      Daniel Vetter 提交于
      Currently we reserve seqnos only when we emit the request to the ring
      (by bumping dev_priv->next_seqno), but start using it much earlier for
      ring->oustanding_lazy_request. When 2 threads compete for the gpu and
      run on two different rings (e.g. ddx on blitter vs. compositor)
      hilarity ensued, especially when we get constantly interrupted while
      reserving buffers.
      
      Breakage seems to have been introduced in
      
      commit 6f392d54
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Sat Aug 7 11:01:22 2010 +0100
      
          drm/i915: Use a common seqno for all rings.
      
      This patch fixes up the seqno reservation logic by moving it into
      i915_gem_next_request_seqno. The ring->add_request functions now
      superflously still return the new seqno through a pointer, that will
      be refactored in the next patch.
      
      Note that with this change we now unconditionally allocate a seqno,
      even when ->add_request might fail because the rings are full and the
      gpu died. But this does not open up a new can of worms because we can
      already leave behind an outstanding_request_seqno if e.g. the caller
      gets interrupted with a signal while stalling for the gpu in the
      eviciton paths. And with the bugfix we only ever have one seqno
      allocated per ring (and only that ring), so there are no ordering
      issues with multiple outstanding seqnos on the same ring.
      
      v2: Keep i915_gem_get_seqno (but move it to i915_gem.c) to make it
      clear that we only have one seqno counter for all rings. Suggested by
      Chris Wilson.
      
      v3: As suggested by Chris Wilson use i915_gem_next_request_seqno
      instead of ring->oustanding_lazy_request to make the follow-up
      refactoring more clearly correct. Also improve the commit message
      with issues discussed on irc.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45181
      Tested-by: Nicolas Kalkhof nkalkhof()at()web.de
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      53d227f2
  9. 30 1月, 2012 2 次提交
  10. 25 1月, 2012 1 次提交
  11. 21 1月, 2012 1 次提交
  12. 20 1月, 2012 1 次提交
    • D
      drm/i915: paper over missed irq issues with force wake voodoo · 4cd53c0c
      Daniel Vetter 提交于
      Two things seem to do the trick on my ivb machine here:
      - prevent the gt from powering down while waiting for seqno
        notification interrupts by grabbing the force_wake in get_irq (and
        dropping it in put_irq again).
      - ordering writes from the ring's CS by reading a CS register, ACTHD
        seems to work.
      
      Only the blt&bsd ring on ivb seem to be massively affected by this,
      but for paranoia do this dance also on the render ring and on snb
      (i.e. all gpus with forcewake).
      
      Tested with Eric's glCopyPixels loop which without this patch scores a
      missed irq every few seconds.
      
      This patch needs my forcewake rework to use a spinlock instead of
      dev->struct_mutex.
      
      After crawling through docs a lot I've found the following nugget:
      
      Internal doc "SNB GT PM Programming Guide", Section 4.3.1:
      
      "GT does not generate interrupts while in RC6 (by design)"
      
      So it looks like rc6 and irq generation are indeed related.
      
      v2: Improve the comment per Eugeni Dodonov's suggestion.
      
      v3: Add the documentation snipped. Also restrict the w/a to ivb only
      for -fixes, as suggested by Keith Packard.
      
      Cc: stable@kernel.org
      Cc: Eric Anholt <eric@anholt.net>
      Cc: Kenneth Graunke <kenneth@whitecape.org>
      Cc: Eugeni Dodonov <eugeni.dodonov@intel.com>
      Tested-by: NEugeni Dodonov <eugeni.dodonov@intel.com>
      Reviewed-by: NEugeni Dodonov <eugeni.dodonov@intel.com>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NKeith Packard <keithp@keithp.com>
      4cd53c0c
  13. 04 1月, 2012 3 次提交
  14. 21 10月, 2011 3 次提交
  15. 22 9月, 2011 1 次提交
    • B
      drm/i915: Dumb down the semaphore logic · c8c99b0f
      Ben Widawsky 提交于
      While I think the previous code is correct, it was hard to follow and
      hard to debug. Since we already have a ring abstraction, might as well
      use it to handle the semaphore updates and compares.
      
      I don't expect this code to make semaphores better or worse, but you
      never know...
      
      v2:
      Remove magic per Keith's suggestions.
      Ran Daniel's gem_ring_sync_loop test on this.
      
      v3:
      Ignored one of Keith's suggestions.
      
      v4:
      Removed some bloat per Daniel's recommendation.
      
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Keith Packard <keithp@keithp.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NKeith Packard <keithp@keithp.com>
      c8c99b0f
  16. 20 9月, 2011 1 次提交
  17. 20 8月, 2011 1 次提交
  18. 23 7月, 2011 1 次提交
    • K
      drm/i915: Initialize RCS ring status page address in intel_render_ring_init_dri · f3234706
      Keith Packard 提交于
      Physically-addressed hardware status pages are initialized early in
      the driver load process by i915_init_phys_hws. For UMS environments,
      the ring structure is not initialized until the X server starts. At
      that point, the entire ring structure is re-initialized with all new
      values. Any values set in the ring structure (including
      ring->status_page.page_addr) will be lost when the ring is
      re-initialized.
      
      This patch moves the initialization of the status_page.page_addr value
      to intel_render_ring_init_dri.
      Signed-off-by: NKeith Packard <keithp@keithp.com>
      Cc: stable@kernel.org
      f3234706
  19. 10 6月, 2011 1 次提交
  20. 17 5月, 2011 2 次提交
  21. 14 5月, 2011 2 次提交