1. 20 9月, 2012 2 次提交
    • B
      drm/i915: Error checks in gen6_set_rps · 79249636
      Ben Widawsky 提交于
      With the new "standardized" sysfs interfaces we need to be a bit more
      careful about setting the RPS values.
      
      Because the sysfs code and the rps workqueue can run at the same time,
      if the sysfs setter wins the race to the mutex, the workqueue can come
      in and set a value which is out of range (ie. we're no longer protecting
      by RPINTLIM).
      
      I was not able to actually make this error occur in testing.
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      79249636
    • C
      drm/i915: Replace the array of pages with a scatterlist · 9da3da66
      Chris Wilson 提交于
      Rather than have multiple data structures for describing our page layout
      in conjunction with the array of pages, we can migrate all users over to
      a scatterlist.
      
      One major advantage, other than unifying the page tracking structures,
      this offers is that we replace the vmalloc'ed array (which can be up to
      a megabyte in size) with a chain of individual pages which helps reduce
      memory pressure.
      
      The disadvantage is that we then do not have a simple array to iterate,
      or to access randomly. The common case for this is in the relocation
      processing, which will typically fit within a single scatterlist page
      and so be almost the same cost as the simple array. For iterating over
      the array, the extra function call could be optimised away, but in
      reality is an insignificant cost of either binding the pages, or
      performing the pwrite/pread.
      
      v2: Fix drm_clflush_sg() to not invoke wbinvd as well! And fix the
      trivial compile error from rebasing.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      9da3da66
  2. 11 9月, 2012 1 次提交
  3. 03 9月, 2012 2 次提交
  4. 24 8月, 2012 2 次提交
    • 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
    • B
      drm/i915: Extract reading INSTDONE · bd9854f9
      Ben Widawsky 提交于
      INSTDONE is used in many places, and it varies from generation to
      generation. This provides a good reason for us to extract the logic to
      read the relevant information.
      
      The patch has no functional change. It's prep for some new stuff.
      
      v2: move the memset inside of i915_get_extra_instdone (Jani)
      v3,4: bugs caught by (Jani)
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      bd9854f9
  5. 23 8月, 2012 1 次提交
  6. 21 8月, 2012 1 次提交
    • 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
  7. 10 8月, 2012 4 次提交
  8. 26 7月, 2012 2 次提交
  9. 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
  10. 23 6月, 2012 1 次提交
    • D
      drm/i915: rip out the PM_IIR WARN · 58bf8062
      Daniel Vetter 提交于
      After banging my head against this for the past few months, I still
      don't see how this could possible race under the premise that once an
      irq bit is masked in PM_IMR and reset in PM_IIR it won't show up again
      until we unmask it in PM_IMR.
      
      Still, we have reports of this being seen in the wild. Now Bspec has
      this little bit of lovely language in the PMIIR register:
      
      Public SNB Docs, Vol3Part2, 2.5.14 "PMIIR":
      
      "For each bit, the IIR can store a second pending interrupt if two or
      more of the same interrupt conditions occur before the first condition
      is cleared. Upon clearing the interrupt, the IIR bit will momentarily
      go low, then return high to indicate there is another interrupt
      pending."
      
      Now if we presume that PMIMR only prevent new interrupts from being
      queued, we could easily end up masking an interrupt and clearing it,
      but the 2nd pending interrupt setting the bit in PMIIR right away
      again. Which leads, the next time the irq handler runs, to hitting the
      WARN.
      
      Also, no bad side effects of this have ever been reported. And we've
      tracked down our issues with the gpu turbo getting stuck to bogus
      interrupt generation limits in th RPLIMIT register.
      
      So let's just rip out this WARN as bogus and call it a day. The only
      shallow thing here is that this 2-deep irq queue in the hw makes you
      wonder how racy the windows irq handler is ...
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=42907
      Cc: stable@vger.kernel.org
      Acked-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      58bf8062
  11. 21 6月, 2012 1 次提交
    • J
      drm/i915: support page flipping on ValleyView · 31acc7f5
      Jesse Barnes 提交于
      And restructure the IRQ handling a little.  We can use pipestat for most
      things, and make sure we don't affect pipe events when enabling and
      disabling vblank interupts.
      
      We can leave vblank interrupts masked but enabled so we're not dependent
      on the first client to toggle the disable timer.  We can also mask all
      render based interrupts, since the ring code will handle unmasking them
      for us.
      
      v2: roll in vblank masking, remove unneeded variable (Daniel)
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      31acc7f5
  12. 14 6月, 2012 1 次提交
  13. 07 6月, 2012 1 次提交
  14. 01 6月, 2012 2 次提交
  15. 31 5月, 2012 2 次提交
    • B
      drm/i915: enable parity error interrupts · 15b9f80e
      Ben Widawsky 提交于
      The previous patch put all the code, and handlers in place. It should
      now be safe to enable the parity error interrupt. The parity error must
      be unmasked in both the GTIMR, and the CS IMR. Unfortunately, the docs
      aren't clear about this; nevertheless it's the truth.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      15b9f80e
    • B
      drm/i915: Dynamic Parity Detection handling · e3689190
      Ben Widawsky 提交于
      On IVB hardware we are given an interrupt whenever a L3 parity error
      occurs in the L3 cache. The L3 cache is used by internal GPU clients
      only.  This is a very rare occurrence (in fact to test this I need to
      use specially instrumented silicon).
      
      When a row in the L3 cache detects a parity error the HW generates an
      interrupt. The interrupt is masked in GTIMR until we get a chance to
      read some registers and alert userspace via a uevent. With this
      information userspace can use a sysfs interface (follow-up patch) to
      remap those rows.
      
      Way above my level of understanding, but if a given row fails, it is
      statistically more likely to fail again than a row which has not failed.
      Therefore it is desirable for an operating system to maintain a lifelong
      list of failing rows and always remap any bad rows on driver load.
      Hardware limits the number of rows that are remappable per bank/subbank,
      and should more than that many rows detect parity errors, software
      should maintain a list of the most frequent errors, and remap those
      rows.
      
      V2: Drop WARN_ON(IS_GEN6) (Jesse)
      DRM_DEBUG row/bank/subbank on errror (Jesse)
      Comment updates (Jesse)
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e3689190
  16. 24 5月, 2012 1 次提交
  17. 22 5月, 2012 2 次提交
  18. 20 5月, 2012 2 次提交
  19. 10 5月, 2012 2 次提交
  20. 06 5月, 2012 3 次提交
  21. 03 5月, 2012 6 次提交